miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

I must replug usb device to be visible

Fri Feb 14, 2014 3:13 pm

Hello,

my scenario: My usb grabber is plugged in powered usb hub. I shutdown raspi (and unplug all power cables). Then after few hours I start raspberry (my usb device is still plugged in) but when I use lsusb I don't see my usb device. I must physically unplug usb device then plug it in and then it is recognized by raspi lsusb ok. I think (but I don't know why?) this usb device must be "powered off" with manual unplugging otherwise it is not recognized.
How can I do it in command line? I must prevent necessity of manual unplugging.

Many thanks!

P.S. I can reboot raspi as many times as I want but it cannot be recognized until I unplug and replug usb device manually. My raspi is powered via microusb and ush hub has its own power.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2393
Joined: Thu Jul 11, 2013 2:37 pm

Re: I must replug usb device to be visible

Fri Feb 14, 2014 3:25 pm

Your hub is probably still powering the device with the Pi unplugged.

In this state, the hub will "suspend" all its ports. This is a low-power USB state that devices should all support, but many don't. Some can only be recovered from suspend by cycling the power.
Rockets are loud.
https://astro-pi.org

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: I must replug usb device to be visible

Fri Feb 14, 2014 3:59 pm

thanks, so there is no command to do it from raspberry?
or probably some setting (or command) to tell raspberry to "remember" setting for this usb port?

one thing is interesting - when I power off both devices (raspi, hub) and then after few minutes power it on again everything works ok. But when I leave both devices without power for long hours and then turn it on this issue happens. So it looks like raspi "forget" setting after long hours but remembers it for few minutes without power.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: I must replug usb device to be visible

Fri Feb 14, 2014 4:11 pm

Hi,
miamia wrote:So it looks like raspi "forget" setting after long hours but remembers it for few minutes without power.
No, no, wrong assumption.

When you have a hub involved, detection is a kind of "indirect". It could be that with different hub the behavior would be different (I haven't systematically tested this, but it could be that they handle suspend state differently...).


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: I must replug usb device to be visible

Fri Feb 14, 2014 4:14 pm

oh, thank you for clarification. I am not a guru
So my question is - Is there any solution for this in my case? I mean solution without need of unplugging usb device from hub and then replugging.

thank you very much

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: I must replug usb device to be visible

Fri Feb 14, 2014 4:30 pm

Hi,
miamia wrote:So my question is - Is there any solution for this in my case?
I'm not sure what is the reason for this behavior. I'd agree that "unable to leave suspend mode" is most likely, but I'm not 100%.

If the real cause is this "suspend issue" then there is nothing much that you could do with existing setup. The USB device goes into a mode where the only way for exit is to recycle its power. Therefore, there is no RasPi command or anything that would solve this.
The solution could be to have an USB hub which would not put the device in suspend mode, but (as mentioned) I haven't tested them to have a feeling if there is a chance to (easily) find a hub which would fit here.

If this is important issue for you, than you could monitor what is going on with USB protocol sniffer. This is a tool/method to check the communication and to get precise answer what is going on.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: I must replug usb device to be visible

Fri Feb 14, 2014 7:15 pm

Thank you Ivan.
I know what you replied but I am not sure if it is power issue especially because of this:
one thing is interesting - when I power off both devices (raspi, hub, remove all power cables and power adapters, so everything is without even residual power) and then after few minutes power it on again everything works ok.

But when I leave both devices without power for about 10 minutes and then turn it on this issue happens.
I think this is strange :(
Thanks for your help.

I am halting raspi with sudo halt. Could this be my problem? (maybe raspi sends some weird halt signal to usb device??)

paulie
Posts: 275
Joined: Thu Jan 19, 2012 6:51 pm

Re: I must replug usb device to be visible

Sat Feb 15, 2014 12:15 am

If cycling the power to your USB hub makes your device visible, you might consider doing this with a relay triggered from a gpio pin.
Not an ideal solution, but I'm sure someone will think of something better.
If, however, you are feeding power from your USB port on your Pi to the hub too, cycling power won't help as the hub will still be powered.
It has been my custom to use Xeyes

miamia
Posts: 119
Joined: Sun Feb 02, 2014 12:16 pm

Re: I must replug usb device to be visible

Sat Feb 15, 2014 9:23 am

I found out this:
I plugged usb device to raspi's first usb port and usb hub with his own power to raspi's second usb port.
When I do sudo sh -c "echo 1 > /sys/devices/platform/bcm2708_usb/bussuspend" and then recycle power (I mean unplug raspi microusb from power and hub's power supply too) then reboot my raspi everything works again (raspi finds my usb device correctly).

But this step of unplugging both powers is essential. (I tried simply reboot raspi without unplugging power but this didn't help).


EDIT: Consideration: Maybe if I would power supply raspi via both microusb and gpio (so it would not be necessary to use powered usb hub) I could completely power-cycle raspi via command line (if this is available) and then it should find my device after reboot. What do you think?

RasPass
Posts: 16
Joined: Sat Dec 08, 2012 12:44 am

Re: I must replug usb device to be visible

Fri Jul 24, 2015 8:26 pm

Terribly sorry to resurrect an old thread, but I'm having the same problem: USB hub and devices connected to it are no longer visible in lsusb or dmesg after RPi reboot.

Only solution after reboot is to power-cycle USB hub and unplug/plug it into RPi.

Any followup from OP or possible solutions emerged since then?
Any way to do this from the commandline? Closest thing I found is hub-control, but if it's not visible to begin with, then no cigar.

It seems that physically unplugging/plugging USB can't be the only way to do this.

Return to “Troubleshooting”