TalonFX Phoenix6 Error

When I run the program using Phoenix6 library i am getting following errors in loop. I need help to resolve this problem. Thanks.

  • ********** Robot program starting **********

  • NT: Listening on NT3 port 1735, NT4 port 5810

  • navX-Sensor Java library for FRC

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • [phoenix] Library initialization is complete.

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • [phoenix-diagnostics] Server 2023.0.0 (Jan 6 2023, 01:03:37) running on port: 1250

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: No new response to update signal

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • CTR: CAN frame not received/too-stale.

  • Unhandled exception: java.lang.IllegalArgumentException: Default commands must require their subsystem!

  • Error at frc.robot.RobotContainer.(RobotContainer.java:39): Unhandled exception: java.lang.IllegalArgumentException: Default commands must require their subsystem!

  • at edu.wpi.first.wpilibj2.command.CommandScheduler.setDefaultCommand(CommandScheduler.java:409)

  • at edu.wpi.first.wpilibj2.command.Subsystem.setDefaultCommand(Subsystem.java:50)

  • at frc.robot.RobotContainer.(RobotContainer.java:39)

  • at frc.robot.Robot.robotInit(Robot.java:33)

  • at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:106)

  • at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:343)

  • The robot program quit unexpectedly. This is usually due to a code error.
    The above stacktrace can help determine where the error occurred.
    See Reading Stacktraces β€” FIRST Robotics Competition documentation for more information.

  • at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:433)

  • The startCompetition() method (or methods called by it) should have handled the exception above.

  • at frc.robot.Main.main(Main.java:23)

  • Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:358): The robot program quit unexpectedly. This is usually due to a code error.

  • The above stacktrace can help determine where the error occurred.

  • See Reading Stacktraces β€” FIRST Robotics Competition documentation for more information.

  • Error at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365): The startCompetition() method (or methods called by it) should have handled the exception above.

  • [phoenix-diagnostics] Server shutdown cleanly. (dur:0)

  • [phoenix] Library shutdown cleanly

  • ********** Robot program starting **********

There are 2 errors here.

Unhandled exception: java.lang.IllegalArgumentException: Default commands must require their subsystem!

Error at frc.robot.RobotContainer.(RobotContainer.java:39): Unhandled exception: java.lang.IllegalArgumentException: Default commands must require their subsystem!

First your command that you set as default needs to require a subsystem. Go look at line 39 in robot container.

CTR: CAN frame not received/too-stale.

Second make sure all you devices are using the same phoenix version. All devices should using v6 and code is also using v6. This might also just a a error to do with the can bus.

Thank you for your quick response but there is sth i dont understand about subsystem.
β€œFirst your command that you set as default needs to require a subsystem.” what does it mean?
Here my codes including 39th line:
/** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() {
39: s_Swerve.setDefaultCommand(
new TeleopSwerve(
s_Swerve,
() β†’ -driver.getRawAxis(translationAxis),
() β†’ -driver.getRawAxis(strafeAxis),
() β†’ -driver.getRawAxis(rotationAxis),
() β†’ robotCentric.getAsBoolean()
)
);
My subsystem folder includes Swerve.java.
Please help me to correct the problem.

In your TeleopSwerve command init function add the addRequirements(s_Swerve)

This command is already in my code

Does your team have a public codebase or a GitHub repo? If so it would help to have it

i tried to use that code but couldnt run it due to errors previously mentioned.

btw i am using the same versions as v6.

Are your devices all on the same can bus?

If so, you have a can ID conflict. You have a motor and a can coder both with ID = 1.

Edit it add:
Make sure you see all 12 devices in Phoenix Tuner X and that they blink/respond the way you expect.

This tells me you’re still running 2023 software. If this is your competition robot, make sure you reimage your roboRIO to the 2024 image and update to 2024 WPILib and 2024 Phoenix 6 API and firmware.

1 Like

That code doesn;t crash for me. I think we need your code to debug the default command issue.

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