Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRIO USB Lost Connections

Hello All

 

I am building an app with my local high school and I have noticed an issue with the USB subsystem with the myRIO

We are using a number of USB connected sensors.  The system sees them all and can communicate with them fine.

If we unplug one sensor the system looses connection to all USB devices on the bus.

When we plug the sensor back in, the system can once again see all of the usb devises

 

If I ssh into the shell and execute the ls /dev/ttyUSB* command I can see multiple USB devices

Again if I unplug one device and execute the above command, the system reports back an error

 

I have looked into the mdev settings and things look like they should work there, but I am unable to understand why we loose all connections if only one device is unplugged

 

Thank you for any help any one can give

 

 

Dan

0 Kudos
Message 1 of 10
(8,369 Views)

Dan, 

 

I have a couple questions just so we can have more information.


Does it matter what device is unplugged? Have you tried unplugging different devices? Does the same behavior occue?

Do you see this same behavior on other computers?

Are you plugging your USB device in on the front of your computer or on the back?

What OS are you running? What specific hardware are you using? 

Has this always happened or are you just now noticing it?

Douglas Choisnet
0 Kudos
Message 2 of 10
(8,340 Views)

Hello

 

The sensor devices are connected to the myRIO via USB

The same behaviour occurs no matter what sensor device I unplug from the myRIO

I have tried unplugging different devices, in different orders, even different hubs, same thing

I will try to answer all of your questions

This is a high school project that started out life on a Raspberry Pi

We are in the process of upgrading the hardware to the NI myRIO

We will be using all of the same USB sensors, but we will be adding some Analog sensors in the future

Analogue to Digital is something that is not native to the Pi

The Pi does not have any issue with hotplugging of  the USB sensors

The pi is running Raspian with a Linux kernel version of 3.6.11+

I am in the process of debugging the myRIO port, and I unplugged a sensor from the myRIO when all communications to the USB sensors was lost.

the uname -a command returns the following data

Linus NI-myRIO-1900-XXXXXXXX 3.25.35-rt52-1.0.0f1 #1 SMP PREEMPT RT Wed Jun 12 09:57:26 CDT 2013 armv71 GNU/Linux

 

I added the X's in place of my unit's serial number,let me know if this is needed

 

If you need any more information please let me know

Thank you for your help in this matter

 

 

 

 

Dan 

 

0 Kudos
Message 3 of 10
(8,337 Views)

Dan,

A couple more questions:

 

Do you see this behavior on any computer you plug the USB into?

What sensor devices are you using?

What ports are you plugging the sensors into?

Douglas Choisnet
0 Kudos
Message 4 of 10
(8,320 Views)

Hello

 

I am connecting to sensors from Atlas Scientific (http://atlas-scientific.com)

However this happens even when I plug in a display device from Crystalfontz 

This only happens on the myRIO

I am plugging a DLink hub into the USB port on the myRIO and then plugging in the devices into the hub

As I only have 1 myRIO I am unable to determine if this happens on all myRIOs or not

Can you run a test on your side to see if the same thing happens to you

 

Plug a USB hub into a myRIO

Plug a couple of USB devices into the hub

ssh into the myRIO and execute this command ls /dev/ttyUSB*

I get the following /dev/ttyUSB0    /dev/ttyUSB1 /dev/ttyUSB2   /dev/ttyUSB2

unplug one of the USB devices from the hub and re-execute the command ls /dev/ttyUSB*

I get the following output

ls: /dev/ttyUSB*: No such file or directory

When I plug in a USB device all USB devices will then show up

 

I have added debugging statements in the usb.sh script that is referenced from the mdev.conf file

But I am not knowadgeable enough to pinpoint the problem

 

I have a number of theories but I do not have tje skillset to correct the issue

I am hoping that you will be able to determine what is happining and determine a correction or work around 

 

 

Thank You

 

 

 

 

Dan 

 

0 Kudos
Message 5 of 10
(8,317 Views)

Hey Dan, 

What specific sensors are you using? I think there is a power surge happening when you unplug your sensors which is causing the issue. Once we look into the specifications of the sensors that you are using, we can look into see if it is a power issue. 

Douglas Choisnet
0 Kudos
Message 6 of 10
(8,293 Views)

Hello

 

I have taken away all of the sensors and pared down the system to the bare essentials

I am connecting the myRIO to a D-Link 7 port USB 2.0 hub

This hub then splits out to two USB to serial converters from Atlas-Scientific

Their data is located here, https://www.atlas-scientific.com/product_pages/embedded/debugger.html

These devices do not need any drivers installed onto the myRIO as they work out of the box

When I have both plugged in I ssh into the myRIO and execute the command ls /dev/ttyUSB*

I get back /dev/ttyUSB0 /dev/ttyUSB1

I unplug one of the devices and re-execute the comamand and I get the following error message

ls: /dev/ttyUSB*: No such file or directory

I plug back in the USB serial converter and both USB devices reappear in the /dev/ subdiractory

 

In your last answer you stated that there may be an electrical problem that is causing this issue

So I tried the following test

I plugged a third USB to serial converter into a second powered D-Link hub

I plugged this hub in to a USB isolator device from Phidgets http://www.phidgets.com/products.php?category=28&product_id=3060_0

And I plugged this device into the original powered D-Link USB hub

I executed the ls command on the myRIO device and I was presented with three /dev/ttyUSB entries

Then I unplugged the third USB to serial device, the one that is seperated from the myRIO by the USB isolation device and again checked the ls command. Once again all /dev/ttyUSB devices were gone.

I plugged in the third USB to serial device back into the second USB hub and re-ran the ls command

All three /dev/ttyUSB devices showed up.

 

Do you know what command to execute that would reinitialize the USB devices in the /dev subdirectory

in my Labview app I can shell out and execute the ls /dev/ttyUSB* command

Based on the data from this command I can then go about reading data or try to re-initialize the USB connections

I have tried to do this from the command line on the myRIO but with no luck as of yet.

 

Any help you can offer would be greatly appreciated

 

 

Dan

0 Kudos
Message 7 of 10
(8,276 Views)

Hi dan6077,

 

Earlier in the thread you mentioned using 4 USB devices. In a more recent test, it sounds like you were using 2 USB devices. What steps did you take to move from 4 USB devices to 2 USB devices and get the ls command to return devices? Did restarting the myRIO after removing devices allow them all to show up? The /dev subdirectory should be reinitialized when the myRIO is reset. If you remove one of your USB devices, reset the myRIO, then try the ls command, do the devices show up?

 

 

Also, are you running any code on the myRIO while you are adding, removing, and checking the USB devices?

 

Catherine B.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 10
(8,252 Views)

Hello Catherine B.

 

I performed the following steps with these results

Initial myRio Setup 

USB host port connected to a 7 port USB 2.0 D-Link hub

Three USB to serial boards connected to the D-Link hub

These are simple USB to serial converters which work with no drivers needing installation

 

 1) Created a new project - Motion Sensor Example 

 2) Pushed it to the myRIO and confirmed it was working

     This means we have no communications going on within the myRIO

 3) ssh'd onto the device as the admin

 4) Executed the ls /dev/ttyUSB* command

 5) Confirmed the connection of three USB devices    

 6) Unplugged one of the USB devices3

 7) Executed the ls /dev/ttyUSB* command

 😎 Confirmed loss of connection to all USB devices in /dev/

 9) Executed the reboot command

10) Re-established the ssh connection to the myRIO

11) Executed the ls /dev/ttyUSB* command

12) Confirmed that there were two ttyUSB connections

 

You are correct in stateing that the /dev subdirectory gets reinitialized after a reboot

I have also confirmed that if I plug a USB device into the myRIO the /dev subdirectory gets populated with all the ttyUSB devices connected to the system. 

 

What I am bringing to your attention is that the myRIO loses all connection to the USB bus when a single device is unplugged.

I am trying to determine if this is planned or unplanned behaviour for the myRIO, I only have one unit at the moment so I cannot test on other units

As this is not the behaviour that I have experienced with USB devices in the Linux or Windows world I wanted to ask the community what their experiences were.

 

Thank you for your help in this matter

 

 

Dan

0 Kudos
Message 9 of 10
(8,208 Views)

Hi Dan,


I discussed this issue with some of our R&D engineers. Does this behavior reproduce with USB devices other than you USB to serial devices? For example, if you connect USB flash drives to the USB hub then remove one of the devices, do you lose connection to the USB flash drives?

 

Also, have you tried using this specific USB hub and devices with a LInux or Windows machine to check the behavior? 

Catherine B.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 10
(8,178 Views)