HAL: CAN Receive has Timed Out

can
pdp
ctre

#1
Error at frc.robot.Main.main(Main.java:29): HAL: CAN Receive has Timed Out

edu.wpi.first.hal.PDPJNI.getPDPChannelCurrent(Native Method)

edu.wpi.first.wpilibj.PowerDistributionPanel.getCurrent(PowerDistributionPanel.java:66)

edu.wpi.first.wpilibj.PowerDistributionPanel.lambda$initSendable$0(PowerDistributionPanel.java:119)

edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl.lambda$addDoubleProperty$3(SendableBuilderImpl.java:242)

edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl.updateTable(SendableBuilderImpl.java:95)

edu.wpi.first.wpilibj.livewindow.LiveWindow.updateValues(LiveWindow.java:290)

edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:263)

edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:81)

edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:263)

frc.robot.Main.main(Main.java:29)

Is there anything I can do to prevent this? Trying to keep out console log clean, and these keep creeping their way in.

The PDP firmware is V1.40, the Server Version is 1.1.0, I am using Phoenix Tuner 1.2. WPILib 2019.2.1


#2

Found this:

        LiveWindow.disableTelemetry(pdp);

Which I think will help in this instance, but if am readying values from the PDP (i.e. to monitor current), will we still this? Is there anyway to just use the latest value, without waiting for the latest value?

FYI I double checked the CAN bus, the wiring looks solid and I do not have any trouble accessing any of the other devices on the bus.


#3

If your PDP has firmware 1.40, the other common root-cause for the errors you are seeing is if the PDP CAN ID is not 0.

By default, the PDP constructor assumes a CAN ID of 0 unless you specify otherwise.


#4
private PowerDistributionPanel pdp = new PowerDistributionPanel(RobotMap.pdpCANId);

where RobotMap.pdpCANId is equal to 10, which is also what it is set to in Phoenix tuner. In the tuner I also verified that we are using firmware 1.40 (which has not been updated since 2015 right?)