CTRE Can't Transmit CAN Frame on Code Deploy... 10% of the time

Our team has had this issue for about a year now.

Essentially, when we deploy code to our robot, sometimes every CAN device returns multiple errors and we end up having to re-deploy our code. We’ve been trying to fix this issue for this season, since last season we had a few issues where we would end up not being able to do anything in a match, since we, well, can’t control any motors. However, we can’t reproduce this issue very well, so it’s been difficult to debug, so I’m turning to the experts online for this one.

Our most recent robot that has had this issue (all robots on our team have had this issue since I’ve joined FRC) can be found here.

Any follow up questions needed to help diagnose this issue I’ll try to answer as quickly as possible. Thanks for anything.

Practice has ended today for me, however I have a few pictures of this issue from the event log:

1 Like
  • Does it always exhibit errors during code start up?
  • You mentioned re-deploys solve this? For how long? Or is it just reboots?
  • Is your code online? Were you using python last year also?
  • It says that wiring is likely the issue… and it is likely the issue. Have you checked your wiring? Is the CAN terminator set up properly?
  • It would be interesting to see some of the DS logs from matches where this was happening
  • RoboRIO I or II?

I’ll have to double check a few of these points sometime tomorrow, however I can give the following information that I know is correct:

  • Re-deploying our code sometimes fixes the issue; anytime we deploy code to the robot, there’s some chance that this issue pops up. There has been incidents where it happens 2 or 3 times in a row.
  • I have talked to our controls subteam, and they’ve agreed to inspect the wiring.
  • We do not have logs during last year’s matches at least from my knowledge, but I’ll double check.
  • We are using a RoboRIO II.

Sorry that I can’t answer all of your questions, it’s hard to answer some of these outside of practice. :sweat_smile:

Apparently this is a known issue, not specific to Python code. The core problem is that the old robot code isn’t shutting down properly and/or quickly and so the new robot code cannot use the CAN bus. There are a variety of reasons this can occur, often it’s something about the user code in other languages but unknown in python.

A workaround for this problem is to click “restart robot code” on the DS after you deploy, apparently some teams always do this.

1 Like

Add custom frc kill script to work around jvm bug by ThadHouse · Pull Request #699 · wpilibsuite/GradleRIO · GitHub was done for GradleRIO to address this issue. Will likely add this to the RobotPy installer this weekend.

Sounds good, thank you!

Better late than never? Updated kill script has been added to robotpy-installer 2024.2.0.

Thank you!