CAN: Message not found?

This is my first attempt at writing a program to activate a solenoid. It doesn’t work. I’ve attached the code. It builds successfully. I know that it deploys because I see the smartdashboard widget (see screenshot)

I get the following errors in the RIOLOG:
********** Robot program startup complete **********
CAN: Message not found
Error at frc.robot.Main.main(Main.java:23): CAN: Message not found
edu.wpi.first.hal.CTREPCMJNI.getSolenoids(Native Method)
Loop time of 0.02s overrun
edu.wpi.first.wpilibj.PneumaticsControlModule.getSolenoids(PneumaticsControlModule.java:135)
edu.wpi.first.wpilibj.DoubleSolenoid.get(DoubleSolenoid.java:150)
edu.wpi.first.wpilibj.DoubleSolenoid.lambda$initSendable$1(DoubleSolenoid.java:222)
edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl.lambda$addStringProperty$8(SendableBuilderImpl.java:289)
edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl.update(SendableBuilderImpl.java:104)
edu.wpi.first.wpilibj.livewindow.LiveWindow.lambda$updateValues$3(LiveWindow.java:191)
edu.wpi.first.util.sendable.SendableRegistry.foreachLiveWindow(SendableRegistry.java:491)
edu.wpi.first.wpilibj.livewindow.LiveWindow.updateValues(LiveWindow.java:147)
edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:333)
edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:131)
edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:373)
edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:463)
frc.robot.Main.main(Main.java:23)
Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:359): Loop time of 0.02s overrun
SmartDashboard.updateValues(): 0.000679s
disabledInit(): 0.000431s
robotPeriodic(): 0.007581s
LiveWindow.updateValues(): 0.109206s
Shuffleboard.update(): 0.000118s
disabledPeriodic(): 0.000778s
Warning at edu.wpi.first.wpilibj.Tracer.lambda$printEpochs$0(Tracer.java:63): SmartDashboard.updateValues(): 0.000679s
disabledInit(): 0.000431s
robotPeriodic(): 0.007581s
LiveWindow.updateValues(): 0.109206s
Shuffleboard.update(): 0.000118s
disabledPeriodic(): 0.000778s
src.zip (8.5 KB)

Thanks!

Do you only get that message once at the beginning of running code? If so, because of how the CAN setup is implemented that is not super surprising of an error.

If that is the case, are you sure the solenoid is not activating? Do you have your code somewhere to review?

Can you put your code on Github so we can see it easily?

The code is in a zip file attached to the original post. Are you able to download it? I zipped up the src folder (and everything beneath it). If the zip attachment doesn’t work, let me know and I’ll see if I can find another place to put it.

And I’m sure the solenoid isn’t activating. And the compressor doesn’t turn on either (which it’s supposed to do when you create a solenoid object)

If you’re sharing a zip because you’re not using source control (i.e. git/github), then you should absolutely look into it.

If you’re doing so out of concern for secrecy or something like that, well, I don’t quite understand the concern, but fair enough.

Is your PCM running the latest firmware version and is it still on the default CAN device id of 0?

1 Like

The firmware has been updated in the PCM (we’re using the new Rev module which was in the KoP). We also have the new Power Distribution hub which we also updated the firmware on. The PCM and PDH have CAN IDs 1 which I assumed was ok since they are different device types. We also have a Spark Max on that same board which also has a CAN id of 1.

Actually we do use Git and Github but our repo is private (team lead decision…I don’t have the power to change that) so I’d have to move the code to another repo to share it.

1 Like

Found it!
My mistake was not updating the code to reflect that we changed the PCM from CTRE to Rev. :frowning:

1 Like

I found the problem, port should be given at 0 Can connection in PCM

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.