RoboRIO Deployment from Linux

RoboRIO Deployment from Linux

Using open-ds and the proper radio configurations, you can deploy to the RoboRIO from Linux!

This might be useful for team members who mostly program on Linux, if you have vision/coprocessor code that is easier to develop on Linux but you also need to work on robot code, or if you want to set up a Raspberry Pi or other ARM64 system as a lab computer to do programming.

Networking setup

  1. Connect power to the roboRIO

  2. Plug a Power-Over-Ethernet splitter into the radio’s left port, and connect the power cable to power and the other cable to the roboRIO (by plugging in a normal Ethernet cable)

  3. Plug an Ethernet cable into the radio’s right port and the other end into your computer (you may need a USB-to-Ethernet adapter if you’re doing this from a laptop)

WPILib Installation

Download the latest version of WPILib.

Extract the tarball and run WPILibInstaller (inside the extraction directory). It will guide you through the steps to install WPILib.

Using the system VS Code/VSCodium (optional)

To use the system VS Code, open VS Code, open the Extensions tab, click the three dots, and click “Install from VSIX…”. Choose ~/wpilib/2024/vsCodeExtensions/vscode-wpilib-2024.1.1.vsix.

Driver Station (open-ds) Installation

Note: open-ds is not the official driver station and may have missing features

To install open-ds, please install a JDK or JRE for Java 8 or later.

On Debian and Ubuntu, please install:


sudo apt install default-jdk

On other distros, consult your package manager documentation or package manager search tool.

If your distro does not provide a JDK, you can download a JRE from [Eclipse Temurin (AdoptOpenJDK)](https://adoptium.net/temurin/releases/?os=linux&package=jre).

Now, you can download the JAR for open-ds from GitHub Releases. I will provide an updated JAR, a .desktop file, and a complete installer in the future, but for now, you can use the following command to launch the JAR:


java -jar open-ds-v0.2.4.jar

Phoenix Tuner X installation (optional)

(these instructions assume Ubuntu or Debian)

(this will install the Android version of Phoenix Tuner X)

First, install the Android rootfs and userspace libraries:


sudo apt install curl ca-certificates -y

curl https://repo.waydro.id | sudo bash

sudo apt install waydroid -y

sudo waydroid init

waydroid prop set persist.waydroid.multi_windows true

waydroid session stop

Now, download and install Phoenix Tuner X:


wget https://github.com/ethanc8/someblobs/releases/download/phoenix-tuner-x-2024.6.1.0/Tuner.X_2024.6.1.0_apkcombo.com.apk

waydroid app install "./Tuner X*.apk"

waydroid app launch com.ctre.phoenix_tuner

TODO

If any of you want to help me with this, please leave a comment!

  • Support other ways to connect to the RoboRIO
    • Direct via USB
    • Direct via Ethernet (plug in to RoboRIO)
    • Direct via RS-232 serial port (via USB adapter or GPIO)
    • Wi-Fi to router
  • Test on arm64 systems
  • Support flashing the RoboRIO ([my notes](https://gist.github.com/ethanc8/57a26e21e87deb82e78bc89e5805b3e2))
  • Support configuring the radio
  • [ ] Determine other features supported by FRC Game Tools
  • Start maintaining open-ds
  • Make an installer for the Linux Game Tools
  • Port to Android
2 Likes

This is also available as a GitHub Gist, which appears to be formatted a bit better: RoboRIO Deployment from Linux · GitHub

Uhh… WPILib (and associated tools, like VSCode, Glass, SmartDashboard, etc) already support installing and running on Linux: WPILib Installation Guide — FIRST Robotics Competition documentation

What isn’t supported is ARM architecture like that on the RPi. (Edit: See Peter’s comment) Also, the official DS application does not run anywhere but Windows due to the LabVIEW runtime dependency

2 Likes

Actually… look at the installers available in 2024.2.1 :slight_smile:

2 Likes

:grimacing:

I stand corrected :sweat_smile:

The installer ARM support is new as of 2024.2.1, so you’re not too far behind the times :smile:

The irony is I already have 2024.2.1 installed on my PC… so it’s not like I missed the update or anything. Whoops

Yes, this just has instructions to install the official WPILib, but it also includes instructions for wiring it correctly (I’ve encountered problems (such as 10.20.22.2 being inaccessible) with situations such as USB connection and Wi-Fi connection before, which didn’t cause problems on Windows). Also, it includes an open-source driver station, open-ds, and I’m working on trying to get other FRC Game Tools functionality working, such as USB connection, Wi-Fi connection, radio flashing, etc. Finally, this has instructions on how to add the WPILib extension to system VS Code, since the WPILib extension on the Extensions Marketplace didn’t work earlier this season, but the one bundled with the installer did work.

The usb connection requires (Windows) drivers from NI*.

This should work the same as a wired Ethernet connection.

The extension published on marketplace was intentionally updated this year to direct users to use the full installer- which, as mentioned above, now supports Linux arm64

*if you search around there is a post with instructions on how to configure Linux to allow connection over usb

2 Likes

It’s less confusing to use the system VSCode, especially since the operating system will group the windows from the system VSCode and the WPILib vscode together.

2 Likes

The usb connection requires (Windows) drivers from NI*.
*if you search around there is a post with instructions on how to configure Linux to allow connection over usb

I’ve been trying to get this working with Linux, but it hasn’t worked so far.

This should work the same as a wired Ethernet connection.

On the 2023 firmware, I could ping the roboRIO but it rejected all connections to port 20. It might have been corrupted, though.

I’m guessing you mean port 22- that will happen if you check the “enable firewall” box when configuring your radio. The firewall is not recommended for home practice/development use.

WPILib installs its own copy of VSCode for multiple reasons:

  • it forces use of the wpilib installed jdk
  • it ensures a clean, known good configuration
  • it reduces support burden (because of the above)

Obviously you are free to do what you please with your installation, but the only fully supported installation is through the vscode packaged with the full installer.

I’ve got it working previously. It does require running a DHCP server on the laptop side for the roboRIO to be assigned an IP (that isn’t an autoconfigured IPv4 address), so if DHCP isn’t configured appropriately the roboRIO won’t receive the normal USB IP.

You’ll probably have the most luck discovering the roboRIO with an mDNS address when using the USB connection, for the above reason.

There was also QDriverStation that seemed promising, and looked great:

Driving was really the only missing piece of the puzzle on Linux. Every other part of the stack already works, code development, deploying, simulation, etc.

Oh yeah, I guess the vendor software, like the REV Hardware Client and the Phoenix software is also a missing link.

Have we figured out how to make the operating system give the WPILib VSCode a different icon and not group the windows with the system VSCode? Also, WPILib might be able to modify package.json to change the name of the product to “WPILib VSCode” in their installer.

Phoenix Tuner X has an Android version, which can be run on Linux via Waydroid. This should be pretty reliable/close-to-native since it’s running on the same kernel and has a full Android rootfs.

I haven’t looked into REV Hardware Client.

Other missing links are the Radio Configuration Utility (I could decompile the JAR and fix it) and the RoboRIO Imaging Tool (which can be done using NI’s libraries for other RIOs, but I haven’t tested because I don’t want to corrupt the disk of any of our RoboRIOs)

Ah yeah forgot about those utilities. I guess with the roboRIO 2.0 the issue is partially fixed, since you can just write the image to the microSD card in whatever way you choose, but you still need a utility to set the team number.

That may have been the case. All of our radios that I’ve tested this season do not expose Wi-Fi. Is there any way to check the current radio configuration without reconfiguring it?

Oh, wait, even though NI has a firmware update and an image flashing API, I don’t think they have a “set team number” API (not applicable to other RIOs). I may be able to extract the VIs from the EXE and run them using Linux LabVIEW, but I don’t know LabVIEW so I don’t really want to do that. (Same solution could be applicable to the Driver Station)

WPILib packages a roboRIO Team Number Setter.