View Full Version : RoboRIO as I2C slave?
DrWateryCat
08-04-2015, 17:02
Hi all,
I would like to use a Raspberry Pi running a web server with a custom webiopi page as a kind of remote console to tweak certain aspects, such as other auto modes. Is there any way in WPIlibJ to accomplish this?
protoserge
08-04-2015, 17:33
Is this intended to be used in competition?
DrWateryCat
08-04-2015, 17:49
Is this intended to be used in competition?
Not really, just more as a cool thing I can show my team and use in an offseason competition in septemberish.
virtuald
08-04-2015, 18:29
It's probably easier to just wire your Pi into the router and use NetworkTables for communications. If you use pynetworktables2js (https://github.com/robotpy/pynetworktables2js), then you can talk directly to NetworkTables from javascript... and of course, if you're doing that, you don't even really need to run the web server on a Pi unless you want to.
jgalbraith
08-04-2015, 23:33
You can use the parameter system in the SmartDashboard to write modified constants to the RoboRIO. This system needs to be used carefully as it can damage the flash memory.
Better in my opinion is to create a parameter file in /home/lvuser or a subdirectory thereof and read in the parameters on robot initialization. You could modify the file via ftp. Restart the robot code via the driver station to check out the changes.
Edit: another option is to modify the file on the RaspberryPi and then use it to FTP the file to the roboRIO.
The easiest way IMHO is to use:
SmartDashboard.getNumber() - Use to return doubles. You should use SmartDashboard.putNumber() first to give yourself a place to input the number.
SmartDashboard.getString() - Use to return text. Again use putString() first
SmartDashboard.getBoolean() - Use to return true or false. Use putBoolean() first.
There are different ways to display these things on SmartDashboard as well such as choosing View>Editable in the menubar then right clicking on different objects to change their appearance, etc.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.