ERROR  -3  CTR: CAN frame not received/too-stale.  CANCoder 42 GetAbsolutePosition 

i use mk4 swerve. i keep getting these errors. How should I solve it? help please


Your cancoders are running phoenix pro firmware version. What version of the api are you using on the code to communicate with the encoders?

Edit: Also one of them is on a higher version. You should update all of them to the same version.

1 Like

We had a problem like that with one of ours. Make sure the encoder has the latest firmware. That fixed the problem for us.

I dont know how i control the API which version? İf you want check it for me from link.

Which file you used about it?

I just had the same problem (CANCoders Not Working - #8 by ie67). Changing the firmware fixed it for me. I was running the Phoenix 5 API but Phoenix 6 firmware. If you’re using Phoenix 5 API, the latest firmware version you can use is 22.1.1.0

2 Likes

When you look inside of the vendordeps folder this is where 3rd party libraries are stored.

You grabbed the 2023 Pro and 5 version of the library based on the data in that PhoenixProAnd5.json file

“fileName”: “PhoenixProAnd5.json”,
“name”: “CTRE-Phoenix (Pro And v5)”,
“version”: “23.0.4”,
“frcYear”: 2023,

So, can you send link for update?

You may already have the most recent version, but the link for re-adding the API is

https://maven.ctr-electronics.com/release/com/ctre/phoenixpro/PhoenixProAnd5-frc2023-latest.json

That comes from Software near the bottom. You have two other choices which are V5 only or Pro only. Because you have different versions of Pro and V5 devices I think you should use the Pro and V5 link. Because you already seem to have that one selected I’m not sure reinstalling it will do anything. It’s worth a try though.

You are currently a little behind the latest version of 23.0.12. you are using 23.0.4

To update the vendor libraries you can follow the instructions from 3rd Party Libraries — FIRST Robotics Competition documentation

Sorry, but I don’t have my team computer here so I’m not able to see the list of firmware files. If you can send me your list that shows in Phoenix tuner when you choose the firmware (screen shot of list?) , I can try to pick put the file for you. The filename should include the device type name (i.e., cancoder").

This is the zip with all of the files currently. If you unzip it you can see what’s in it or go to the Phoenix Releases repo on GitHub as well.

https://github.com/CrossTheRoadElec/Phoenix-Releases/blob/master/ctr-device-firmware.zip?raw=true

Also I’m noticing in your DS output it mentions the Pigeon IMU but in tuner I don’t see it listed. Are you sure the CAN connection is setup properly for all devices in your CAN network?

I actually didn’t use pigeon. I didn’t understand how I got an error in DS either. Why do you think it might be?

If it’s still a part of your code on the robot it will show that message. Somewhere in your code a Pigeon was declared with a CAN id of 6. You
could currently be running code on the bot that does not match what hardware you currently have attached. This will absolutely not work and will present stale errors like you are seeing.

Ensure your code is actually for the hardware selected and that the code is deployed successfully to the robot.

Specifically in the GitHub link you sent look at your Swerve Subsystem. You have a Pigeon 2 declaration. I think you really need to go through your code and make sure it is setup properly. If you are sure you didn’t have a Pigeon in the code you uploaded, you don’t know the code as well as you think you do or you didn’t save the update and publish it to GitHub that I can see.

gyro = new Pigeon2(Constants.Swerve.pigeonID)

Yes, I just started coding and I’m trying to learn.

I use GitHub - frc3512/SwerveBot-2022: The source code for the 2022 FRC postseason swerve drive robot.

That’s a good start, but you’ll have to customize it for your hardware. If you are just learning programming jumping into swerve, deploying someone else’s code, is a bad idea. You need to read through the code fully, adjust it to your hardware and understand what it is doing. Otherwise you can seriously injure yourself and others when it does something you weren’t expecting.

Have you written any code yourself just to do basics like get joystick input and output it to the motors or read the encoders on their own? You might want to take a step back and start with smaller parts of that project and work on small chunks at a time in seperate projects. Swerve drive is one of the more complex systems to understand and I still am left with questions even after 10+ years in FRC. I always start with making sure each sensor is working, then add one corner module at a time to make sure the motors work as expected. Then combine it all into a drive base as 3512 did in their example

I.e. make a project that only reads the encoders and make sure you understand it fully. Then work on a program to control the motors. Then combine with a larger subsystem and robot project like the one you linked.

You may also want to go through this video series:

As kingc95 mentioned, you have to know what version of the API you are using. If you’re using Phoenix 6 without the Pro option (you would have had to have purchased a license), you would use CANCoder-vK-24.0.4.1-Phoenix6-Beta.crf. From the screen shot you posted, it looks like you have the latest version of Phoenix Tuner, so you’re probably using Phoenix 6.

If you’re using Phoenix 5, you would use CANCoder-Application-vH-22.0.2.1-season2023.crf or, if you happen to have pro, I suggest CANCoder-vK-Application-23.1.3.0-Pro-season2023.crf

Good luck.

1 Like

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