RoboRIO USB on Linux

Mostly posting this for those in the future who are searching for how to use an NI (formerly the knights who called themselves National Instruments) RoboRIO (or RIO-esque) device on Linux over USB. I’m doing this on a raspberry pi running raspbian lite but it should work for Ubuntu and others.

When you plug the device in, it is actually found and comes up as a usb network adapter “usb0”. So the trick is that it is expecting DHCP so let’s give it DHCP in a reasonably clever way. First, use apt to install the isc-dhcp-server package.

Then we need to do some configuration:


# Example static IP configuration:
interface usb0
static ip_address=

Next is /etc/default/isc-dhcp-server


Then we need to set the subnet info in /etc/dhcp/dhcpd.conf

default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;

subnet netmask {

Then, here’s the clever part, let’s create some udev rules to start and stop our DHCP service when we plug and unplug in /etc/udev/rules.d/98-rio.rules

SUBSYSTEM=="net", ACTION=="add", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="3923", RUN="/sbin/ip addr add dev %k", ENV{SYSTEMD_WANTS}="isc-dhcp-server.service"

ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_MODEL}=="NI_roboRIO*", RUN="/usr/bin/systemctl stop isc-dhcp-server.service"

And then you have to run a couple of commands to restart udev:

udevadm control --reload
systemctl daemon-reload

This seems to be working very repeatably for me and I’m quite happy with it for what I need. Kind of cool. It’s possible I missed something so if you give it a try then let me know.



1 Like

1 Like

Thanks? It’s remarkably hard to find the info on this. I was actually surprised that it wasn’t documented by NI somewhere. They have recently added support for Ubuntu 18.04 and 20.04 as experimental for their Linux driver package.

I guess you could combine the two approaches and have a lighter weight DHCP solution. The udev rules make it a bit more repeatable for what I need.

I went to look at the linked python script and it appears the link from the blog is dead but it appears to be this script:

I like the udev script, it’s a better solution for this than what I had done.


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