RobotPy D eploy Error? What are we missing?

Hi! We ran into a code deploy problem we are not sure how to fix them(first year using python). I linked the error message below. I entered in the command “py robotcode.py deploy” which brought the error message. I have robotpy installed on the roboRIO. Any help will be greatly appreciated.

python_probelm.png


python_probelm.png

You should put your robot code into its own directory. It looks like the directory where your robotcode.py is has other files in it (e.g. a pyfrc directory), so it’s getting confused between the installed pyfrc (in C:\Python34) and the one in the local directory.

Ok so I got a new problem when trying to upload. With your help I was able to get farther. See image for details.

new_problem.png


new_problem.png

That looks like a successful upload (the last message is just saying there wasn’t previous robot code running). Note you should be uploading as “lvuser” rather than admin. If the robot code still isn’t running, either check netconsole or use putty to log in as lvuser, run “sh robotCommand” (if the first time prints out an error like “socket in use” or “FRC pid XXX did not die within 110 ms, aborting”, wait a few seconds and try again), and see if that prints out any errors.

Thanks for the responses and I am very happy to see the actual developer of robotpy here. I got a new error when I did what you said. See picture again.

next_problem.png


next_problem.png

Is your robot script named robot.py? Are there any files in the py directory? I’m not the author of the pyfrc parts, virtuald is (he frequents Chief Delphi as well), but it looks like pyfrc’s deploy feature may always make robotCommand call robot.py, rather than using the actual name of the script used when deploying. As a workaround, try renaming your script to robot.py if it isn’t already.

If there are no files in the py directory, it could also be permissions related since you were uploading as admin previously–if that’s the case, try logging in as admin, removing /home/lvuser/py, and then retrying your upload as lvuser.

Ok so I deleted the directory and I tried to upload the code again(see pic). I think the problem is that the command line saved my username and password for admin. How do I make it so I log in as lvuser after it already saved the info in cache? Thanks again!

another-problem.png


another-problem.png

Remove .deploy_cfg and it will ask again (or just edit it). Also, upgrade to pyfrc 2015.1.0, as it no longer asks you for a username, and has other fixes.

c:\python34\scripts\pip.exe install -U pyfrc

Ok so I installed the latest Pyfrc and now, for some odd reason, I get a permission denied error. See picture for details. Thanks again for all the help!!

problems.png


problems.png

Use putty to log in as admin, then run “rm /home/lvuser/robotCommand”. You may also need to do “rm -r /home/lvuser/py”.

I am super happy and thankful to say that the deploy worked! It showed up in the FRC driver station and everything! Thank you both so much for taking the time to help us with robotpy and pyfrc!!

Great to hear. Sorry about the problems… I expect that you shouldn’t run into any more deploy issues now that you’re using the newest version of pyfrc.