RobotPy No Robot Code

Everything is deployed successfully, but the comm light on the roboRIO is solid red. The DS is reading comms, but no robot code.

   #!/usr/bin/env python3

   import wpilib
   from wpilib.drive import DifferentialDrive
   import ctre


   class MyRobot(wpilib.TimedRobot):
       def robotInit(self):
           self.left = ctre.WPI_TalonSRX(0)
           self.right = ctre.WPI_TalonSRX(1)
   
           self.myRobot = DifferentialDrive(self.left, self.right)
   
           self.stick = wpilib.Joystick(0)
   
       def autonomousInit(self):
           pass
   
       def autonomousPeriodic(self):
           pass
   
       def teleopPeriodic(self):
           self.myRobot.arcadeDrive(self.stick.getRawAxis(0), self.stick.getRawAxis(1))
   
       def testPeriodic(self):
            pass


    if __name__ == "__main__":
       wpilib.run(MyRobot)

And what error message does it show in netconsole?

https://robotpy.readthedocs.io/en/stable/troubleshooting.html

The only error is “Connecting to 172.22.11.2:1741… :(“

Sounds like pynetconsole isn’t connecting. You can view the netconsole output via the driver station also.

https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599746-viewing-console-output

If I am not mistaken, 172.22.11.2 is the ip for the usb connection to the Rio, not the ethernet (or wifi).

~Mr. R^2

1 Like

@robo4630dragons did you figure out what your issue was?

We just had this issue Saturday. The kids had deployed the code, but hadn’t deployed the CTRE module packages. I assume the code was failing on the import of ctre, but once we deployed the packages to the RoboRio, it ran.

It could not find the ctre module because it wasn’t found in the robotpy installer packages. So I used the command “py -3 installer.py download-opkg python37-robotpy-ctre” instead of “py -3 installer.py download-opkg python36-robotpy-ctre” and it worked.