fearless
Posts: 20
Joined: Tue Apr 16, 2013 2:24 pm

YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 3:04 am

I'm trying to communicate with a Rainforest Automation RAVEn USB dongle (it's a ZigBee interface to smart [sic] power meters). I'm using a Sabrent HB-USB30 powered 4-port USB hub between the RAVEn and the RPi.

I'm running Wheezy [Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013] with recent updates applied.

What I observe: when I boot the system with just the hub plugged into the RPi, the boot sequence looks okay:

Code: Select all

$ dmesg
...
[    2.362134] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.371104] Indeed it is in host mode hprt0 = 00001101
[    2.582401] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.592136] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.602157] hub 1-1:1.0: USB hub found
[    2.608817] hub 1-1:1.0: 3 ports detected
[    2.892341] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.022731] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.031744] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.061686] smsc95xx v1.0.4
[    3.137691] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ae:3b:00
[    3.232527] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    3.363867] usb 1-1.2: New USB device found, idVendor=2109, idProduct=2812
[    3.379455] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.402177] usb 1-1.2: Product: USB 2.0 HUB
[    3.402177]       
[    3.429609] hub 1-1.2:1.0: USB hub found
[    3.442429] hub 1-1.2:1.0: 4 ports detected
...
When I plug the RAVEn into the Sabrent hub, the light on the RAVEn starts to flash (I think that's proper behavior), but dmesg reports error -71:

Code: Select all

$ dmesg
...
[ 1924.326572] usb 1-1.2.4: new full-speed USB device number 5 using dwc_otg
[ 1924.416590] usb 1-1.2.4: device descriptor read/64, error -71
[ 1924.616517] usb 1-1.2.4: device descriptor read/64, error -71
[ 1924.816516] usb 1-1.2.4: new full-speed USB device number 6 using dwc_otg
[ 1924.906496] usb 1-1.2.4: device descriptor read/64, error -71
[ 1925.106575] usb 1-1.2.4: device descriptor read/64, error -71
[ 1925.306467] usb 1-1.2.4: new full-speed USB device number 7 using dwc_otg
[ 1925.726254] usb 1-1.2.4: device not accepting address 7, error -71
[ 1925.816505] usb 1-1.2.4: new full-speed USB device number 8 using dwc_otg
[ 1926.236253] usb 1-1.2.4: device not accepting address 8, error -71
[ 1926.236583] hub 1-1.2:1.0: unable to enumerate USB device on port 4
...and the device doesn't show up under /dev/ttyUSB0 as it ought to.

My understanding was an error -71 said that the device wasn't getting enough power. But this is a powered up, and AFAIK it is powered.

So:
  • is this a known problem?
  • is there a known fix or workaround?
  • Are any powered hubs known to cause trouble (conversely, are there any that are known to work)?
  • Is there any additional info I can provide that will help Saint Gordon and his apostles point me in the right direction?

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 9:49 am

To be clear, your device also does not work if plugged into the Pi directly? (unless it draws too much power and you can't boot)

Take a look at this:
http://www.spinics.net/lists/usb/msg02644.html

usbcore is built into the kernel so you have to pass the parameter via /boot/cmdline.txt

Can you try booting with either usbcore.old_scheme_first=Y or usbcore.use_both_schemes=Y in cmdline.txt?

Edit:
Is there any additional info I can provide that will help Saint Gordon and his apostles point me in the right direction?
I lol'd

fearless
Posts: 20
Joined: Tue Apr 16, 2013 2:24 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 3:20 pm

For what it's worth, I *can* boot with the RAVEn plugged directly into the RPi, and it *does* show up under /dev/ttyUSB0:

Code: Select all

[    3.202471] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
[    3.329626] usb 1-1.3: New USB device found, idVendor=0403, idProduct=8a28
[    3.341533] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.351126] usb 1-1.3: Product: RFA-Z106-RA-PC RAVEn v2.3.21
[    3.367970] usb 1-1.3: Manufacturer: Rainforest
[    4.192128] udevd[154]: starting version 175
[    5.383647] Registered led device: led0
[    5.408490] usbcore: registered new interface driver usbserial
[    5.543198] usbcore: registered new interface driver usbserial_generic
[    5.684280] USB Serial support registered for generic
[    5.691636] usbserial: USB Serial Driver core
[    6.086610] usbcore: registered new interface driver ftdi_sio
[    6.336993] USB Serial support registered for FTDI USB Serial Device
[    6.410716] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[    6.515504] usb 1-1.3: Detected FT232RL
[    6.521661] usb 1-1.3: Number of endpoints 2
[    6.642131] usb 1-1.3: Endpoint 1 MaxPacketSize 64
[    6.649086] usb 1-1.3: Endpoint 2 MaxPacketSize 64
[    6.749617] usb 1-1.3: Setting MaxPacketSize 64
[    6.791580] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
But although I think I'm sending it the right sequence, I'm unable to get it to respond:

Code: Select all

import serial

SERIAL = '/dev/ttyUSB0'
BAUD = 9600
CMD = "<Command><Name>get_connection_status</Name></Command>\n"

serial = serial.Serial(SERIAL, BAUD)
serial.write(CMD)
print "$$$", serial.readline()
The above hangs in the call to readline(), leading me to hypothesize that the RAVEn needed more power, which is why I was trying to run it off a powered hub.

However, I will try booting with usbcore.old_scheme_first=Y or usbcore.use_both_schemes=Y in cmdline.txt as you suggested and report back.

fearless
Posts: 20
Joined: Tue Apr 16, 2013 2:24 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 3:47 pm

Adding usbcore.old_scheme_first=Y to /boot/cmdline.txt:

Code: Select all

# file: /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait usbcore.old_scheme_first=Y
... I don't get error -71, but it doesn't mount /dev/ttyUSB0:

Code: Select all

[    2.397033] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.406189] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.416879] hub 1-1:1.0: USB hub found
[    2.422838] hub 1-1:1.0: 3 ports detected
[    2.704683] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.735322] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.744444] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.759013] smsc95xx v1.0.4
[    2.829269] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ae:3b:00
[    2.944870] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    2.976543] usb 1-1.2: New USB device found, idVendor=2109, idProduct=2812
[    2.992769] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.004110] usb 1-1.2: Product: USB 2.0 HUB
[    3.004110]       
[    3.019773] hub 1-1.2:1.0: USB hub found
[    3.034973] hub 1-1.2:1.0: 4 ports detected
--- edit ---
I realize the USB device wasn't automatically detected -- the Sabrent hub has a button you push to enable a device. When I pushed it, here's what popped up on dmesg:

Code: Select all

[ 1150.941840] usb 1-1.2.4: new full-speed USB device number 9 using dwc_otg
[ 1151.361567] usb 1-1.2.4: device not accepting address 9, error -71
[ 1151.451749] usb 1-1.2.4: new full-speed USB device number 10 using dwc_otg
[ 1151.871595] usb 1-1.2.4: device not accepting address 10, error -71
[ 1151.961823] usb 1-1.2.4: new full-speed USB device number 11 using dwc_otg
[ 1152.051878] usb 1-1.2.4: device descriptor read/64, error -71
[ 1152.251871] usb 1-1.2.4: device descriptor read/64, error -71
[ 1152.451912] usb 1-1.2.4: new full-speed USB device number 12 using dwc_otg
[ 1152.541894] usb 1-1.2.4: device descriptor read/64, error -71
[ 1152.741913] usb 1-1.2.4: device descriptor read/64, error -71
[ 1152.851977] hub 1-1.2:1.0: unable to enumerate USB device on port 4
I replicated the experiment with usbcore.use_both_schemes=Y and got the same results.
Last edited by fearless on Fri May 03, 2013 4:18 pm, edited 1 time in total.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 3:55 pm

The usbcore schemes can make the difference if a device isn't enumerated properly. Since yours is enumerated when connected directly to the Pi, it should also enumerate when connected to a hub.
It doesn't hurt to try it out, and it's very interesting information, but probably not the answer to your problems.

fearless
Posts: 20
Joined: Tue Apr 16, 2013 2:24 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Fri May 03, 2013 4:29 pm

@obcd:

You're right. To summarize:
  • (1) When the RAVEn USB device is plugged into the RPi directly, it is enumerated correctly and attached to /dev/ttyUSB0. But I don't seem to be able to communicate with it.
    (2) When plugged in via the Sabrent powered hub, I see a series of "error -71" messages and the device is not enumerated. This happens whether or not I'm using usbcore.old_scheme_first=Y or usbcore.use_both_schemes=Y or the default.
It may be that I should dig deeper into (1) and find out why I'm not getting any responses from the device, but I don't know what I should be looking for.

JakeWisniewski
Posts: 48
Joined: Fri Feb 08, 2013 4:58 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Mon May 13, 2013 3:13 pm

I have experienced a similar problem with a usb touchscreen monitor. Changing the cmdline.txt file fixed the problem by adding dwc_otg.speed=1

What this actually does is change usb from 2.0 to 1.1. Although this did solve my problem, it ended up causing issues with my other input devices (mouse/keyboard) because they were not compatible in usb 1.1 mode.

Best bet would be make sure you can ssh into the pi and then try changing the cmdline.txt file only having the hub connected and see if you are still receiving the error -71

If you have a device connected that does not support usb 1.1. The pi will take a very long time to boot due to it trying to configure the devices and reporting that there is likely a "bad usb cable"

Code: Select all

dwc_otg.lpm_enable=0 dwc_otg.speed=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

camillo75
Posts: 5
Joined: Wed Jun 26, 2013 5:00 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Wed Jun 26, 2013 5:07 pm

Hi all,
same behaviour here with latest Raspbian.

I have a USB mouse.
Using it directly connected to RPi is fine.

When I try to use it through a USB powered hub I got this error:
[ 133.662905] usb 1-1.2.1: device descriptor read/64, error -71
[ 133.872933] usb 1-1.2.1: device descriptor read/64, error -71
[ 134.063095] usb 1-1.2.1: new low-speed USB device number 8 using dwc_otg
[ 134.482689] usb 1-1.2.1: device not accepting address 8, error -71
[ 134.562902] usb 1-1.2.1: new low-speed USB device number 9 using dwc_otg
[ 134.982716] usb 1-1.2.1: device not accepting address 9, error -71
[ 134.982954] hub 1-1.2:1.0: unable to enumerate USB device on port 1

Mouse USB port blinks a few times and then switches off.

I think it is an issue linked to this:
USB 3.0 hub fails to pass through USB 2.0 devices (ID 2109:3431)
https://github.com/raspberrypi/firmware/issues/64

Trying the "dwc_otg.speed=1" in "cmdline.txt" seems to make raspberry pi boot forever.

Any ideas would be appreciated.

Thank you!

Best regards,
Camillo

caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

Re: YAUSBP (Yet Another USB Problem) using powered hub

Wed Jun 26, 2013 8:20 pm

fearless, you write:
My understanding was an error -71 said that the device wasn't getting enough power. But this is a powered up, and AFAIK it is powered.
I am confused by your "AFAIK" - if it is a powered hub you should be pretty sure that it is powered, since that means that you attached a power supply to it. If you did not, it is not powered and the most likely reason for your problem is that too little power is available.

Alux
Posts: 1
Joined: Thu Jan 09, 2014 10:59 am

Re: YAUSBP (Yet Another USB Problem) using powered hub

Thu Jan 09, 2014 11:09 am

After scouring the web looking for a solution to this unsuccessfully for my Pi I found a workaround.

While I was considering buying a Beagle board I wondered what would happen if i connected my powered 7 port hub to a unpowered 4 port hub then connecting that to my Pi and it worked. The 4 port hub is just one of those cheap plastic ones so I don't have a model number for it.

My guess is that linux in general doesn't like USB3. The 7 port hub i have is USB3 while the 4 port one its connected to is USB2.

fearless
Posts: 20
Joined: Tue Apr 16, 2013 2:24 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Tue Aug 26, 2014 10:06 pm

Just a (late) update: The error seems to have vanished.

After mothballing this project for months, I built a new Rasbpian (2014-06-20-wheezy-raspbian.zip), plugged my Rainforest Automation RAVEn directly into the RPi (version B) USB port (NOT using the powered hub, and everything is working without error.

jeepzzz
Posts: 1
Joined: Mon Dec 19, 2016 9:00 pm

Re: YAUSBP (Yet Another USB Problem) using powered hub

Mon Dec 19, 2016 9:15 pm

Hello everybody,
Same problem here, lots of pain to understand. Problem solved hence to this thread, so I open it again to help research.

I was using raspberry B+ to manage a canon pixma mp180 on my network, among other tasks. this is the only usb peripheral connected on the rpi. Everything was fine out of the box with 2014-09-09 raspbian wheezy.
A few year later, I need latest testing dist for another application on the rpi.

I decided to do a clean install with latest jessie lite (2016-11-25 image). Headless install, no problem. Update jessie to testing, no problem.
But my printer was not in lsusb anymore. Typical dmesg output  :
[ 927.559421] usb 1-1.5: new high-speed USB device number 11 using dwc_otg
[ 927.639427] usb 1-1.5: device descriptor read/64, error -71
[ 927.829427] usb 1-1.5: device descriptor read/64, error -71
[ 927.939668] usb 1-1-port5: unable to enumerate USB device

I tried usbcore.old_scheme_first=Y or usbcore.use_both_schemes=Y in cmdline.txt, same problem.

Adding dwc_otg.speed=1 in the cmdline.txt file fixed the problem.

Thanks guys.

Return to “Troubleshooting”