Phoenix Swerve Generator with new CANivore

Can someone help me I’m getting error code -10021 in the frc message console. I’m using phoenix swerve generator and I just put a new CANivore I want to use this for the drive train.

I think it will help to give us a lot more information here.

Was this on a bot that was previously working, but you just added a CANivore or is it new?

Were you able to do all the self check etc steps in the Swerve Generator?

Can you post all of the error message?

Can you see everything looking correct in TunerX?

So it’s more of a CANivore issue. I’ve switched the CANivore to handle the arm subsystem now. I get the same errors and I’ve found out with LED indicators that the voltage is too low and CANBus won’t work as effectively. My issue is that it’s connected to a 12V and 200ma on the Voltage regulator modules.

I assume that means you are seeing a solid red LED?

How do you have your CAN wired? (please be as detailed as possible, pictures are also great)

Can you simplify the CAN wiring and does that work (like only connect one device)?

Okay I fixed it sort of. I wired the drive train to the CANivore. Now both Stat and CAN led are green. My problem now is that I get this error

Device firmware could not be retrieved. Check that the device is running v6 firmware, the device ID is correct, the specified CAN bus is correct, and the device is powered.
   from: talon fx 3 ("")
     at: Stack Trace not received for performance reasons.

This was the code I used (fromCTRE swerve generator) to change the CANBus that the swerve motors are connected to

public CommandSwerveDrivetrain(SwerveDrivetrainConstants driveTrainConstants, double OdometryUpdateFrequency, SwerveModuleConstants... modules) {
        super(driveTrainConstants, OdometryUpdateFrequency, modules);
        driveTrainConstants.CANbusName = "Other";
        if (Utils.isSimulation()) {
            startSimThread();
        }
    }
    public CommandSwerveDrivetrain(SwerveDrivetrainConstants driveTrainConstants, SwerveModuleConstants... modules) {
        super(driveTrainConstants, modules);
        driveTrainConstants.CANbusName = "Other";
        if (Utils.isSimulation()) {
            startSimThread();
        }
    }

What do you see in Phoenix TunerX? Are all of you devices on the latest firmware?

The only thing you should need to do to configure it from the example or generated code is to change the kCANBus constant in the TunerConstants.java file to include the name of your CANBus if that isn’t already configured.

To go into a bit more detail how to parse the error and why your current code isn’t working as expected:

This error is telling you that our API could not communicate with the Talon FX with ID 3 on CAN bus "". As is mentioned in our API docs, "" is a way to refer to the roboRIO CAN bus. So this error is telling you that the device is being constructed on the roboRIO CAN bus instead of the intended CANivore bus.

The issue here is that CANbusName is being modified after devices were already constructed in the super(driveTrainConstants, modules) call, so the modification is effectively ignored. As Jason mentioned, the solution is to instead modify TunerConstants.kCANbusName to refer to the CANivore.

1 Like

Yes I have found that out to change the kCANBus name not too long ago. Thank you guys for your help and I’ll let you know how it goes. I had to revert the wiring for all devices using the rio CAN only because I have a showcase tommorow :sweat_smile:. I will continue working with the CANivore right after thank you guys!