USB 3G modems "re-plug" to USB if there's 7 or more of them

Ask questions about Arch Linux ARM. Please search before making a new topic.

USB 3G modems "re-plug" to USB if there's 7 or more of them

Postby mark838 » Sat Jan 19, 2019 1:11 pm

I am using a powered 10-USB hub to connect 3G usb modems to a single raspberry PI B+ (ARMv6h) usb port. All packages are fully upgraded. The hub has enough power for all devices, so that is not a problem. I have tested the setup with all 10 modems on different x86_64 machine running debian, and it worked, so the hub should be OK.

Each plugged modem creates 3 terminals in /dev/, for instance ttyUSB0, ttyUSB1, ttyUSB2. One of those 3 is for data (ppp connection). I use wvdial to establish ppp connection for the data port, leaving remaining 2 tty's unused.

This works flawlessly for the first 6 modems. After i insert the 7th modem, and start ppp connection, after some random time of up to 3 minutes, one of the previous modems disconnect, as if i physically removed it from USB port and than inserted it again. Even it's 3 tty terminals dissapear from /dev/, and reappear again under different numbers, as if i physicaly unplugged the modem and plugged it back. Dmesg shows that usb device simply disconnected and connected again, even when it is plugged into the hub the whole time. During the short time that all 7 modems work, my ssh connection over eth0 to the PI becomes laggy and slow. I used the top command to see that the CPU is not heavily used during that time.

I thought this happens because of some hardware limitation : using 7 modems over single usb port may be too much for device such as raspberry PI.

However, when i tried Raspbian instead of Arch, the same exact problem occurs, only as soon as i insert 4th modem, instead 7th with Arch. So on Arch i can use maximum of 6 modems. On Raspbian 3.

This led me to belive that problem is caused by software, rather than hardware. Further : when i insert the 7th modem into the second PI's USB port (usb hub with 6 modems still plugged into the first USB port), even the 7th. modem works flawlessly. When i insert it into the hub, again the same problem.

Any ideas on why is this happening ?
mark838
 
Posts: 2
Joined: Thu Jan 17, 2019 11:50 am

Re: USB 3G modems "re-plug" to USB if there's 7 or more of t

Postby lategoodbye » Sun Jan 20, 2019 12:56 am

The BCM2835 of the Raspberry only supports 8 USB endpoints. So it's impossible to use more than 6 USB devices, because 1 endpoint is required for the host and another one for the Ethernet interface. This is a hardware limitation.

I don't know why the Raspbian kernel only supports 3 modems. All i can say is that there are two different USB driver implementations. Upstream kernel (possibly Arch Linux in your case) uses the dwc2 and Raspbian uses the dwc-otg driver.
lategoodbye
 
Posts: 116
Joined: Sat Dec 29, 2018 1:24 am

Re: USB 3G modems "re-plug" to USB if there's 7 or more of t

Postby mark838 » Sun Jan 20, 2019 9:33 am

I was confused by the fact that i can actually use 7 devices plugged into the hub (even 8), but only for a short time. And that i can use 7 devices for any time, if the 7th device is plugged to another PI port.
This article says they did manage to use 10-port hub on PI :
http://www.yoctopuce.com/EN/article/how ... ou-connect

But threads on PI forums confirm what you said, that it's hardware limitation.
Also, driver dwc_otg appears to have parameter dev_endpoints :
https://www.cl.cam.ac.uk/~atm26/ephemer ... eters.html
$this->bbcode_second_pass_quote('', 'T')he number of endpoints in addition to EP0 available for device mode operations.

Values: 1 to 15 (default 6 IN and OUT)

Note: The FPGA configuration supports a maximum of 6 IN and OUT endpoints in addition to EP0.

For which it is clearly stated to have maximum value of 6 on the PI.

Thank you for you answer
mark838
 
Posts: 2
Joined: Thu Jan 17, 2019 11:50 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 10 guests