View Full Version : Explanantion needed on how to get USB data from the roboRIO
backspace119
05-01-2015, 20:42
My team has an idea for position tracking which requires the use of a USB port. Last year this obviously wasn't possible (without A LOT of workarounds and ordering parts from overseas). This year we were excited to see the roboRIO sporting 2 host USB ports. I'm the lead programmer and have been tasked with programming this system.
How would I go about getting data off of the USB? I found the kUSB value in the Port class that is used to construct a SerialPort object but I haven't had any luck getting data from the port through this method. (although I haven't really had much time to play with it yet)
Any help would be much appreciated and I thank you for the time you spent reading this.
Joe Ross
05-01-2015, 20:49
Does the device show up in the roboRIO webdashboard? If so, what is it's address? It should be INSTR::ASLR3 to work with the kUSB setting.
backspace119
05-01-2015, 20:51
Does the device show up in the roboRIO webdashboard? If so, what is it's address? It should be INSTR::ASLR3 to work with the kUSB setting.
To be totally honest I got the device hooked up 30 minutes before I left and only deployed one set of code to it. I failed to check the address of the device as I was hoping the code would be able to access it, instead the code must've crashed on startup as I got "no robot code" and red comms light when I deployed it.
Would it change anything if this device registered as a generic HID device?
Joe Ross
05-01-2015, 20:57
Would it change anything if this device registered as a generic HID device?
Yes. The serial port class only works if the device is a serial port, ie linux recognizes it as a TTY or ACM device.
While it should be possible to use a generic HID device through linux interfaces, WPILib doesn't provide a library for it.
backspace119
05-01-2015, 20:59
Yes. The serial port class only works if the device is a serial port, ie linux recognizes it as a TTY or ACM device.
While it should be possible to use a generic HID device through linux interfaces, WPILib doesn't provide a library for it.
So I'd be writing my own code to handle making use of input then?
Is it worth the trouble to do this? Or should I just try and find another way?
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.