Accessing PI on Romi from java code

our team uses configuration files to run our java codebase on any physical robot even if the robot uses different motor controllers or even subsystems. we do this by creating a set of robot configuration files that are specific for each robot and load these config files when the java code starts on the robot. the configuration files are deployed to the robot via the src/main/deploy directory. but, to determine which robot the code is running on, we create a text file in the /home/lvusers directory with the name of the robot. currently we’re working around this by testing to see if a /home/lvusers directory exists on the machine that the java code is running on. if it’s a windows machine, there is no such directory, and we assume that we’re running a romi robot and load the configuration files for a Romi robot.
we now have 2 romi robots and the PID constants for the robots are slightly different (not surprising, the hardware is not perfectly the same) and we need to differentiate between the two romi’s.
my question is: i would like to put a text file on Romi with the PI. is there a way to access the PI directly from the java code so we can retrieve the text file saved on the PI?

bill
FRC4905 AndromedaOne

Though people more knowledgeable than me could speak of official channels, if you are not using bridged mode, an easy hack would be to use the cameraserver. You could add the config to the Python (or java) file and have it report back through network tables.

There is probably a better way, but that should work.

1 Like

There isn’t a way just yet, but I’m planning on adding a NT client to the Romi Web Service to allow it to post information about itself over NetworkTables

4 Likes

that would be awesome… thanks

I had another thought for a temporary solution. If each robot had its own unique access point, you May be able to run the config on the host computer.

excellent idea, and yes, each Romi has a unique SSID. the code is a bit on the ugly side, but it works!!
thanks

1 Like

Sorry this took a while, but I have a draft PR open which adds NT support to the Romi. Doing a little bit more testing on it and will have a new release done up once it’s merged

3 Likes

We just published v1.2.0 of the Romi software: Release Romi Web Service v1.2.0 · wpilibsuite/wpilib-ws-robot-romi · GitHub

This version includes some basic NetworkTables functionality, but more specifically to this thread, it provides the Romi identifier (basically the same name as the default SSID the Romi generates) under the NT key /Romi/Information/Identifier.

Grab the .tar.gz file from that link, and use the Romi Web UI to upload it. It’ll install, and to verify, you should see the updated version number in the status area of the Romi Web UI.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.