Can't Deploy Python Code

Hi, I’m having trouble deploying my code to the robot. I’ve tried re-imaging the RIO and installing software again, even the bare minimum and I just can’t get it to deploy!
Here’s the error:


The code is valid according to the simulator and this is basic boilerplate code from last year. I was able to deploy just fine earlier and now it doesn’t do anything. I’ve also gotten returned non-zero status -1 (or something like that). I’ve tried all our code and every single on is doing the same thing, even ones we’ve gotten working earlier this year and in the past.

I tried looking things up and one thing suggested the RoboRIO was out of room. I tried SSHing into the device with PuTTY and there’s only like 4 MB left. I don’t know if that’s normal. I’ve tried different versions of software, but nothing I’ve tried works.

Any ideas? Thanks.

Yeah, definitely should have more than 4MB free on your roborio.

The easiest and least thought required solution is to reimage the roboRIO, which will start you out from scratch. However, it might be useful to figure out why it’s out of space!

If you want to clear it out manually (helping you avoid filling it up again), you can do something like the following procedure:

  • ssh to the roborio as ‘admin’
  • run cd /
  • run du -hs *
  • The output will be the path, followed by the amount of space that path takes up.

The general procedure at this point is follow the largest amount of space (eg, if /usr is taking up 450MB, cd into /usr and then run du -hs * again to find the offending subfolder. Keep following until you find objects that either (a) shouldn’t be there that accidentally got on the robot or (b) system/wpilib/robotpy components that are much larger than you might expect. Once you find offending files, maybe you delete them, maybe you don’t.

It’s likely that whatever is large is in either your admin accounts home folder or the lvuser home folder.

If you find that robotpy components are causing a problem, let me know.

1 Like

Also, one thing to keep in mind is that the robotpy deploy process will copy everything in the robot folder to the roborio, so if you have any large files there that could be causing the problem you’re facing.

3 Likes

Did you figure out what was happening?

Yes. We had to get things ready for competition, so sorry for the delay. I didn’t realize that everything in the robot folder actually got sent! My opkg cache and pip cache were all in the same folder, so I emptied that out and tried it after re-imaging it, but it still didn’t work. I sent the output to a text file, which I was going to post, but I happen to see something in there that gave me an idea.

So we have a bunch of backup copies of the code, and that’s all in the same folder. Even though I was just doing the first robot.py file, there was a syntax error (indentation) on the 4th one according to output! Then I decided to put it into a separate folder just for a peace of mind. Then it deployed faster than I’ve ever seen it deploy before! I never realized the opkg cache files show up in the console while deploying, and now that you say everything in the folder goes to the robot, now it seems really strange!

So yes, we got it figured out last minute! Thanks for your help!