Has anybody successfully created a commincation link between a RPi and a RoboRio with a radio in between? If so, could someone explain it or send old code?
Thanks,
-Max DeVos
KING TeC 2169
Has anybody successfully created a commincation link between a RPi and a RoboRio with a radio in between? If so, could someone explain it or send old code?
Thanks,
-Max DeVos
KING TeC 2169
We are using Python on our Pi and Java on our RoboRIO.
After installing Python on the Pi, you can install pynetworktables using pip
pip install pynetworktables
Then, sampling the code from here,
NetworkTables.setClientMode()
NetworkTables.setIPAddress('roboRIO-2169-FRC.local')
NetworkTables.initialize()
Now you can send code to the robot by using something like
table = NetworkTables.getTable('/testnetworktable')
table.putNumber('test_key', number_you_want_to_send)
or get code from the robot
foo = table.getBoolean('foo', True)
And now if you go to the Outline Viewer in Eclipse, start a client connection to the same IP address as before (roboRIO-2169-FRC.local) and you should get the data.
You can also swap out roboRIO-2169-FRC.local for a static IP of your robot 10.21.69.2 (I actually think that is the preferred way to do it).
You can read up on pynetworktables here.
Alright, that is extremely useful. Could you tell me what the Java side would look like?
That is pretty well documented here http://wpilib.screenstepslive.com/s/4485/m/24194/l/479908-reading-array-values-published-by-networktables.
After that it is up to you.