FRC: Prepare NI roboRIO¶
Why prepare Robot Controller?¶
In the previous 2019 season, preparing the Robot Controller typically meant:
Installing the Phoenix Diagnostics
Installing the Phoenix API into roboRIO (if using LabVIEW).
In the 2020 release of Phoenix, both of these are automatically handled by the library deployment features of WPI Visual Studio Code extensions (C++/Java) and NI LabVIEW.
Phoenix Diagnostics has become a library that is compiled into the FRC robot application. This is a result of the roboRIO CAN bus changes implemented by the NI for 2020. Tuner now communicates with “Phoenix Diagnostic Server” running in the deployed application via an HTTP API.
If the roboRIO does not have a deployed application, a temporary Diagnostic Server application can be deployed from Tuner. This is particularly useful during hardware-bringup.
LabVIEW¶
NI LabVIEW supports a feature that will automatically deploy the Phoenix API libraries to the roboRIO. After running the installer, 2020 LabVIEW robot projects will automatically install Phoenix into the roboRIO when the program is permanently deployed via “Run As Startup”.
- The steps for first deploy are:
“Build” the FRC Boot-up Deployment
“Run as Startup”
Re-boot the roboRIO (see note below)
Note
After first Run-as-Startup (since imaging the RIO), you may see an error in the Driver Station reporting that the Phoenix libraries are missing. A reboot of the RIO will likely resolve this. We recommend using the “Restart roboRIO” button in the Driver Station.
How to prepare Robot Controller¶
Open Tuner and connect USB between the workstation and the roboRIO.
Select 172.22.11.2 # RoboRIO Over USB and 1250 for the address and port. These are generally selected by default, and typically do not require modification.
Deploy the Temporary Diagnostic Server.
Note
This is unnecessary if a robot application has been deployed already (C++, Java, or LabVIEW).
Verify the robot controller - Tuner¶
After application deployment, Tuner will immediately connect to the roboRIO.
Confirm the bottom status bar is green and healthy, and server version is present.
If there are CAN device present, they will appear. However, it is possible that devices are missing, this will be resolved in the next major section (CAN Bus bring up).
roboRIO Connection (Wi-Fi/Ethernet)¶
The recommended connection method for control/plotter features is over USB or using static IP (Ethernet/Wi-Fi). The mDNS strategy used by the roboRIO can sometimes fail intermittently which can cause hiccups when submitting HTTP requests to the roboRIO.
Testing has shown that using USB (172.22.11.2) or using static IP address has yielded a greater user experience than the roborio-team-frc.local host name has.
Note
Future releases may have improvements to circumvent the limitations of mDNS.
Verify the robot controller - LabVIEW¶
Create a pristine LabVIEW application. Add a CTRE device to Begin.Vi. For example, create a Talon SRX object, even if the device is not physically present.
Tip
Drag drop the following into your Begin.vi
Connect DS and turn on Warnings and Prints by selecting the bottom most option.
Upload the application to the robot controller and check the driver station message log.
If everything is working, the Phoenix Initialization message can be found.
Note
This message will not appear after subsequent “soft” deploy (LabVIEW RAM-only temporary deploys).
If Phoenix API has not been installed into the robot controller, this message will appear.
If you have used Phoenix LifeBoat (which should NOT be used), this message will appear. If this occurs you will need to re-image your roboRIO and then re-follow the instructions in this section exactly, without using LifeBoat.
Verify the robot controller - Web page¶
The Silverlight web interface provided in previous seasons is no longer available. Moving forward, the NI web interface will likely be much simpler.
As a result, Phoenix Tuner may embed a small message reminder indicating that CAN features have been moved to Tuner. This will depend on the version of Phoenix.
Typically, the message will disappear after 5 seconds. This will not interfere with normal web page features (IP Config, etc.).
Warning
The roboRIO Web-page does not provide CAN bus support any more as this has been removed by NI. Use Phoenix Tuner instead.
Warning
The roboRIO Web-page does not render correctly if using Internet Explorer (see below). Recommended browsers are Chrome or Firefox.
Verify the robot controller - HTTP API¶
Tuner leverages the HTTP API provided by Phoenix Diagnostics Server.
So technically you have already confirmed this is working.
But, it is worth noting that this HTTP API can potentially be used by third-party software, or even the robot application itself.
Here is a simple get version command and response.
http://172.22.11.2:1250/?action=getversion
Here is a simple getdevices command and response.
http://172.22.11.2:1250/?action=getdevices