Driver Station Shows "No Robot Code" When Teleop Enabled

When the driver station is up connected to the Rio via USB, everything appears good: Communications, Robot Code, and Joystick (if plugged in) are green. When Teleop is enabled, the signal light flashes for a second before going solid, and the driver station shows no robot code.

The code builds, and the deploy appears successful at first. Looking at the output, though, there are things noted as "up-to-date but not deployed. The output in VSCode when deploying is below:

Summary

Executing task: gradlew deploy -PteamNumber=5785 --offline -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2024\jdk”

Task :discoverroborio
Discovering Target roborio
Using [email protected]:22 for target roborio

Task :deployprogramKillroborioroborio
-C-> md5sum /usr/local/frc/bin/frcKillRobot.sh @ /home/lvuser
-[0]-> 001696b0412c36f7be0c868ad493d16a /usr/local/frc/bin/frcKillRobot.sh

Skipping redeploy of frcKillRobot script
-C-> . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t 2> /dev/null @ /home/lvuser

Task :deployrobotCommandfrcJavaroborio
-C-> echo '/usr/local/frc/JRE/bin/java -XX:+UseSerialGC -Djava.lang.invoke.stringConcat=BC_SB -Djava.library.path=/usr/local/frc/third-party/lib -jar “/home/lvuser/2024_Basic_Test.jar” ’ > /home/lvuser/robotCommand @ /home/lvuser
-C-> chmod +x /home/lvuser/robotCommand; chown lvuser /home/lvuser/robotCommand @ /home/lvuser

Task :deployjrefrcJavaroborio
-C-> if [[ -f “/usr/local/frc/JRE/bin/java” ]]; then echo OK; else echo MISSING; fi @ /tmp
-[0]-> OK

-C-> opkg list-installed | grep openjdk @ /tmp
  -[0]-> frc2024-openjdk-17-jre - 17.0.9u7-1 - FRC OpenJDK Java Runtime Environment

Searching for JRE 17.0.9u7-1
Found JRE frc2024-openjdk-17-jre - 17.0.9u7-1 - FRC OpenJDK Java Runtime Environment
JRE Is Correct Version
Artifact skipped

Task :deployfrcStaticFileDeployroborio
-C-> mkdir -p @ /home/lvuser/deploy
-[1]
1 file(s) are up-to-date and were not deployed

Task :deployfrcJavaroborio
1 file(s) are up-to-date and were not deployed
-C-> chmod +x “/home/lvuser/2024_Basic_Test.jar”; chown lvuser “/home/lvuser/2024_Basic_Test.jar” @ /home/lvuser

Task :deploynativeZipsfrcJavaroborio
33 file(s) are up-to-date and were not deployed
-C-> chmod -R 777 “/usr/local/frc/third-party/lib” || true; chown -R lvuser:ni “/usr/local/frc/third-party/lib” @ /usr/local/frc/third-party/lib
-C-> ldconfig @ /usr/local/frc/third-party/lib

Task :deployprogramStartfrcJavaroborio
-C-> sync @ /home/lvuser
-C-> /usr/local/natinst/bin/nirtcfg --file=/etc/natinst/share/ni-rt.ini --get section=systemsettings,token=NoApp.enabled,value=unknown @ /home/lvuser
-[0]-> False

-C-> . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null @ /home/lvuser

BUILD SUCCESSFUL in 24s
13 actionable tasks: 11 executed, 2 up-to-date

  • Terminal will be reused by tasks, press any key to close it.

Looking at the log from the Rio when I tried to enable Teleop:

Summary
  • NT: Got a NT4 connection from 172.22.11.1 port 65527

  • NT: CONNECTED NT4 client ‘Dashboard@1’ (from 172.22.11.1:65527)

  • Unhandled exception: java.lang.NullPointerException: Cannot invoke “edu.wpi.first.wpilibj.XboxController.getLeftX()” because “this.xbox1” is null

  • Error at frc.robot.Robot.teleopPeriodic(Robot.java:169): Unhandled exception: java.lang.NullPointerException: Cannot invoke “edu.wpi.first.wpilibj.XboxController.getLeftX()” because “this.xbox1” is null

  • at frc.robot.Robot.teleopPeriodic(Robot.java:169)

  • at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:373)

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

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

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

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

  • DifferentialDrive… Output not updated often enough. See Using the WPILib Classes to Drive your Robot — FIRST Robotics Competition documentation for more information.

  • Error at edu.wpi.first.wpilibj.MotorSafety.check(MotorSafety.java:140): DifferentialDrive… Output not updated often enough. See Using the WPILib Classes to Drive your Robot — FIRST Robotics Competition documentation for more information.

  • 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.

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

  • Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:379): 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:386): The startCompetition() method (or methods called by it) should have handled the exception above.

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

  • [phoenix] Library shutdown cleanly

  • A fatal error has been detected by the Java Runtime Environment:

  • SIGSEGV (0xb) at pc=0xb6e3a01c, pid=2103, tid=2107

  • JRE version: OpenJDK Runtime Environment (17.0.9.7) (build 17.0.9.7-frc+0-2024-17.0.9u7-1)

  • Java VM: OpenJDK Client VM (17.0.9.7-frc+0-2024-17.0.9u7-1, mixed mode, emulated-client, serial gc, linux-arm)

  • Problematic frame:

  • C [libc.so.6+0x6c01c]

  • No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

  • An error report file with more information is saved as:

  • /tmp/hs_err_pid2103.log

I have tried to re-image the Rio since that seems to be a common fix, but no luck. The Rio has 6.0.0 firmware and 2024_v2.2 image. I’m not entirely sure where to go from here for troubleshooting, if anyone has any thoughts.

Error at frc.robot.Robot.teleopPeriodic(Robot.java:169): Unhandled exception: java.lang.NullPointerException: Cannot invoke “edu.wpi.first.wpilibj.XboxController.getLeftX()” because “this.xbox1” is null

In your Robot class, the variable xbox1 is null, so you can’t call getLeftX() on it (Which you do at like 169). You need to initialize your xbox1 variable.

1 Like