Phoenix Diagnostic Serve Questions

So, my team has been building a live “self test” function for our robot for automated diagnostics during a match. One of the ways in which we planned to do this was to run the “get devices” command over the phoenix diagnostic server, however, to fully implement tis we need an example of the JSON file the command returns. Also, are there any differences between the replies of the RoboRio can 2.0 devices and CAN FD devices. Any help would be greatly appreciated…

Thanks in advance!

1 Like

This looks like what you asked for:
FRC: Prepare NI roboRIO — Phoenix documentation.
It isn’t exactly a file but an HTTP response.
I am curious where you saw the get devices command documented without this example.

Thank you! Would you happen to know which one of those values would represent the devices base ID or some other value that is obtainable in code and cannot be repeated, even between different can busses;

That’s really easy to test. Make the call, change the CAN ID of a device, make the call again, compare the outputs. The value that changes is the CAN ID, and the rest should be static regardless of bus or whatever environment. My guess is DynID being the one you’re looking for.

I don’t know for sure the answer without research since I don’t use this stuff much. I think the FRC docs describe the CAN devices standards for FRC. I believe the unique CAN address on a bus is the manufacturer, model, and CAN id. And you have which bus it is. But bear in mind that in some circumstances duplicate CAN addresses are allowed and may or may not work right such as when identical new Talons are put on the bus and you need to configure them. That may or may not work - you may have to do one at a time. (Confusing!)

Note that I do not have a DynID (see my info below). Maybe I’m a little behind updates (but I can’t be too far behind) or it’s just for CANivore which I don’t have here at home (it’s locked in the school for the summer). Most likely my info is the up-to-date version and the CTRE document is many years behind; I think they changed their format and my example is right.

If you are putting this information in a program and have never done this before, I have a (crude) Java program to retrieve similar data and parse JSON from GRIP from years ago. If you are starting at zero that could be helpful (or not) and I’ll put it here if you want.

Also, CTRE (can’t remember who maybe Ozrien?) posted a program here in CD that you can run in robotInit to find all the devices on the CAN bus. That might be better for whatever you are trying to accomplish.

Also, the Phoenix server doesn’t start if you have no CTRE motor controllers in use. In that case add a Talon to your program or start the temporary server with the Tuner.

http://roborio-4237-frc.local:1250/?action=getdevices

{
“BusUtilPerc”: -1.0,
“DeviceArray”: [
{
“BootloaderRev”: “2.6”,
“CANbus”: “rio”,
“CANivoreDevName”: “”,
“CurrentVers”: “22.0”,
“HardwareRev”: “1.4”,
“ID”: 0,
“ManDate”: “Nov 3, 2014”,
“Model”: “Talon SRX”,
“Name”: “Leader”,
“SerialNo”: “00000000000000000000000000000000”,
“SoftStatus”: “Running Application.”,
“SupportsConfigs”: true,
“Vendor”: “Cross The Road Electronics”
},
{
“BootloaderRev”: “2.6”,
“CANbus”: “rio”,
“CANivoreDevName”: “”,
“CurrentVers”: “22.0”,
“HardwareRev”: “1.4”,
“ID”: 1,
“ManDate”: “Nov 3, 2014”,
“Model”: “Talon SRX”,
“Name”: “Follower”,
“SerialNo”: “00000000000000000000000000000000”,
“SoftStatus”: “Running Application.”,
“SupportsConfigs”: true,
“Vendor”: “Cross The Road Electronics”
},
{
“BootloaderRev”: “3.1”,
“CANbus”: “rio”,
“CANivoreDevName”: “”,
“CurrentVers”: “1.40”,
“HardwareRev”: “Smart Module 1.1, Baseboard 1.3”,
“ID”: 0,
“ManDate”: “July 14, 2015”,
“Model”: “PDP”,
“Name”: “PDP (Device ID 0)”,
“SerialNo”: “00000000000000000000000000000003”,
“SoftStatus”: “Running Application.”,
“SupportsConfigs”: false,
“Vendor”: “Cross The Road Electronics”
}
],
“GeneralReturn”: {
“Action”: “getdevices”,
“CANbus”: “”,
“Error”: 0,
“ErrorMessage”: “CTRE_DI_OKAY”,
“ID”: 0,
“Model”: “”
}
}

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