Determine the IP address of the Driver Station

Our team is using an Jetson TX1 for image processing. We want to send the processed image to the Driver Station, cutting the roboRIO out of the equation.

We have a socket client on the Jetson and a socket server on the Driver Station. However we do not know the Driver Stations IP, as it could change. Using the documentation, it says to set a static ip address. I am extremely wary of this because when we go to competition I am concerned that flashing the radio will remove our static IP’s, and then our code will fail.

Am I missing something here? Can we use mDNS like the roboRIO does (ie. roboRIO-TEAM-FRC.local)? Or is it possible to set static ip address without them being blown away by flashing the router?

-Jacob Abraham
FRC Team 6479, Lead Programmer, Lead Driver

Set a static IP on the Driver Station laptop. Flashing the radio will not have an impact on this. You can set it to 10.TE.AM.5; make sure you’re using a class A subnet mask. Note that you won’t be able to connect over ethernet while you have a static IP on the driver station.

One solution you could use is to run a Network Tables client on the Jetson TX1. That way you can use the roboRIO-TEAM-FRC.local as the Network Tables server, and have the Jetston TX1 or the driverstation publish its own IP address for the other to read.

Could I then configure a static IP for the ethernet? Being able to run tethered at the competition would be a major plus.

You can just switch back to DHCP and it should connect just fine; this is what we did last year. You could write a batch script to do this for you or do it manually. The NetworkTables solution Will mentioned also works fine, just doesn’t fully bypass the RoboRIO like you mentioned originally.

Thank you. We actually figured out how to set static ips for ethernet and wireless. Then wrote a shell script to figure out which was connected and then to use that one. Thank you for your help

1 Like

Try (You might need to import some Libraries):

import socket
from networktables import NetworkTables as nt
import smbus

#setup network table connection to robot
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print(‘Network Tables is setup on Pi’)

while 1:
ip = socket.gethostbyname(‘roboRIO-<YOUR_TEAM_NUMBER_HERE>-FRC.local’)
print(‘Connected to robot’)
print(‘Waiting for NWT and Roborio connection’)
sd = nt.getTable(“SmartDashboard”)

Using static ip addresses is how everything worked until mdns was introduced. We don’t use mdns at all - we need to know the ip address of our components to send scripts to them. The old setup was the driver station is, the rio is and the radio is That is the convention we still use.