OpenWrt Forum Archive

Topic: USB 3G modems not detected on power-on on Ralink RT5350 board

The content of this topic has been archived on 23 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello everyone,

I am experiencing a problem similar to the one described at https://dev.openwrt.org/ticket/6853 . I have a board based on the Ralink RT5350 chip, 32MB of RAM, 8MB of Flash and I am trying to use various 3G/4G modems with it. The kernel is 3.8.13, the firmware is based on https://github.com/kaechele/openwrt .

Some of the 3G modems are only detected if they are inserted _after_ the board is powered up. If they are already in the USB port at the time the board gets power, the system acts as if there is nothing inserted. A soft reboot doesn't fix it. Removing the 3G modem and re-inserting it makes it show up.

The modems that exhibit this behavior are:

Pantech UML295
Franklin U770
Novatel MC930D
Netgear 340U and 341U

The same problem also appears when using the standard Ralink firmware (using Ralink's 3.6.0 SDK, not OpenWRT) but only with the Netgear 340U and the 341U. The other 3 (Pantech UML295, Franklin U770 and Novatel MC930D) are detected fine.

I suspect it is some sort of timing issue. The Ralink firmware appears to put the USB port into power-saving mode (by setting UDEV_RST and UHST_RST to 1 in the RSTCTRL register, then turning off the associated clock by setting UPHY0_CLK_EN to 0) at boot time. The OpenWRT firmware appears to do something similar (the exact patch is this one: https://dev.openwrt.org/browser/trunk/t … ?rev=36260 ) but it appears to do so at a later time (when the USB port is enabled).

Has anyone else seen this before (on this particular chip or a similar one)? On this particular board there is no GPIO to turn off the power to the USB port, so if the power fails and the board + modem reboots, it will not be detected until someone physically unplugs the modem and plugs it back in.

Any suggestions would be greatly appreciated!

Thank you,
Razvan

go throw all gpios and find which respond for USB power. Sometimes they all is reserved, then you need edit your dst file to make more free gpios.

(Last edited by neryba on 11 Dec 2013, 21:44)

Already tried that, there is no GPIO attached to the USB power. I've also talked to the manufacturer and they claim they didn't install a GPIO line to control the USB power (but can modify the board for us for a fee, obviously smile ).

If your manufacture not planed Power for USB, so how we can help you? Only way find place where you can tak 5V and connect it to USB power pin. or that resister respond for this pin, but then you need to show good quality pictures from your board

I'm hoping for a software solution that would at least make _some_ of the modems work (that is bring it to the same situation as the Ralink firmware that works with all the modems I mentioned except the Netgear 340U and 341U). There must be something that the Ralink firmware does and the OpenWRT firmware doesn't that makes modems like the Pantech UML295 not appear (fail to handshake) on the OpenWRT version.

The USB power cut would be a last resort - it would not get to the bottom of the issue but instead simply simulate a re-insert of the modem. I would rather get it solved in software (if at all possible).

BTW, I forgot to mention, all the modems I've indicated work fine when connected through a simple (unpowered) USB hub. It's only when they are directly connected to the board that they fail to be detected.

Do you see information about this device in  "cat /sys/kernel/debug/usb/devices"
Did you try usbreset package? or echo 1 > /sys/bus/usb/devices/usb1/bConfigurationValue

I have tried "cat /sys/kernel/debug/usb/devices", nothing shows up in there (that is the output is exactly the same as the one that I get when nothing is plugged in).

I haven't tried the usbreset package or the "echo 1 > /sys/bus/usb/devices/usb1/bConfigurationValue", will give those a try tonight. However, a soft reboot doesn't change the situation (the board reboots but still doesn't detect the modem). If the modem is inserted after applying power, it is detected on the first boot and all subsequent reboots.

I have just tried it. Usbreset installs but complains when run:

Unable to find usbfs, is it mounted?

Also, writing 1 to bConfigurationValue under usb1 makes it redetect its internal USB hub but does not make the modem appear:

echo 1 > /sys/bus/usb/devices/usb1/bConfigurationValue       
[  322.670000] hub 1-0:1.0: USB hub found                                       
[  322.680000] hub 1-0:1.0: 1 port detected 

cat /sys/kernel/debug/usb/devices                            
                                                                                
T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12   MxCh= 1              
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0                                  
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1                    
P:  Vendor=1d6b ProdID=0001 Rev= 3.08                                           
S:  Manufacturer=Linux 3.8.13 ohci_hcd                                          
S:  Product=Generic Platform OHCI Controller                                    
S:  SerialNumber=101c1000.ohci                                                  
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                                          
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub               
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms                                   
                                                                                
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1              
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0                                  
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1                    
P:  Vendor=1d6b ProdID=0002 Rev= 3.08                                           
S:  Manufacturer=Linux 3.8.13 ehci_hcd                                          
S:  Product=EHCI Host Controller                                                
S:  SerialNumber=101c0000.ehci                                                  
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA                                          
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub               
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms                                   

I have only tried it with one of the problem modems (Sierra 340U), will try the rest of them as well and report.

Thank you,
Razvan

I experienced exactly the same issue on my TP-Link MR4320 and TP-Link WDR4300 routers using Openwrt Trunk r39183. My ZTE 3G GSM modem was not recognized until I hotplugged it into the already running router. After warm and cold starts the modem was not recognized until unplugging and re-plugging (hotplugging) it.

I manipulated "/sbin/hotplug-call" by inserted "sleep 1" before the line containing "); done".

From this on my MR3420 recognizes the GSM modem also on warm and cold starts without hotplugging it.

I have got no idea why this workaround works. Obviousely there is some timing issue. I have not yet tried on the WDR4300 but I will do so soon. On the MR3400 it definitely works.

Please, give feedback if this also works for you.

Adding a 1 second delay also worked on the TP-Link WDR4300. Could this be related to "OpenWrt hotplug script fix" described in http://wiki.openwrt.org/doc/howto/mwan3 ?

Regards
Alex

Razvan , I am trying to get the 340 working on openwrt . The modem gets detected when plugged into USB . However I don't see any ttyUSB devices like I did on my 313U could you provide any insight ?

cititechs wrote:

Razvan , I am trying to get the 340 working on openwrt . The modem gets detected when plugged into USB . However I don't see any ttyUSB devices like I did on my 313U could you provide any insight ?

You need the GobiSerial / GobiNet drivers - see https://www.codeaurora.org/ or the QMI WWAN drivers. It's not going to show you a ttyUSB0 or similar port, it's not a simple PPP modem.

alex77 wrote:

I experienced exactly the same issue on my TP-Link MR4320 and TP-Link WDR4300 routers using Openwrt Trunk r39183. My ZTE 3G GSM modem was not recognized until I hotplugged it into the already running router. After warm and cold starts the modem was not recognized until unplugging and re-plugging (hotplugging) it.

I manipulated "/sbin/hotplug-call" by inserted "sleep 1" before the line containing "); done".

From this on my MR3420 recognizes the GSM modem also on warm and cold starts without hotplugging it.

I have got no idea why this workaround works. Obviousely there is some timing issue. I have not yet tried on the WDR4300 but I will do so soon. On the MR3400 it definitely works.

Please, give feedback if this also works for you.

I haven't had a chance to try this yet, but in your case did anything appear in /sys/kernel/debug/usb/devices when the modem was not detected? I mean was it seeing the device but not assigning a driver or was it behaving as if there was nothing plugged in ("cat /sys/kernel/debug/usb/devices" would show nothing).  We did try it both with Linux 2.6.21 and 3.x (3.8 and 3.10) and the result was the same, but I guess it's worth a try.

I had the same problem on wrd4300 with openwrt 12.09, r36088. I added a line like "sleep 1" as alex77 wrote and it helped me!

drazvan wrote:
alex77 wrote:

I experienced exactly the same issue on my TP-Link MR4320 and TP-Link WDR4300 routers using Openwrt Trunk r39183. My ZTE 3G GSM modem was not recognized until I hotplugged it into the already running router. After warm and cold starts the modem was not recognized until unplugging and re-plugging (hotplugging) it.

I manipulated "/sbin/hotplug-call" by inserted "sleep 1" before the line containing "); done".

From this on my MR3420 recognizes the GSM modem also on warm and cold starts without hotplugging it.

I have got no idea why this workaround works. Obviousely there is some timing issue. I have not yet tried on the WDR4300 but I will do so soon. On the MR3400 it definitely works.

Please, give feedback if this also works for you.

I haven't had a chance to try this yet, but in your case did anything appear in /sys/kernel/debug/usb/devices when the modem was not detected? I mean was it seeing the device but not assigning a driver or was it behaving as if there was nothing plugged in ("cat /sys/kernel/debug/usb/devices" would show nothing).  We did try it both with Linux 2.6.21 and 3.x (3.8 and 3.10) and the result was the same, but I guess it's worth a try.

In my case the modem was detected as a mass storage. Only after unplugging and hotplugging it again it was detected as a modem device.

I've hade problems with Barrier Breaker RC3 and pretty much any usb-modem on TP-link TLWR1043 v2.1. On cold boot no modem would show up, a manual reset of the usb bus would fix things. I tried usbmode, that would make the modem to turn up but no connection was possible, an unending loop with "option_instat_callback: error -2" at the end.

The "sleep 1" in /sbin/hotplug-call fixed the problem. Thanks a bunch!

Sorry for not respondig for so long. As I gave up using 3G as internet connection in order to go back to facilitating ADSL. So I did no further experiments on the issue. Nevertheless I am happy if some of you could resolve the issue in your environments.

Regards
Alexander

I suspect my problem is the usb-modem takes a little time to init and the "usbmode -s" is not done yet when devices are assigned. I don't have good enough understading of the boot process I'm afraid. How this locks the modem into an non-working state I have no idea, although a manual reset of the usb-bus works later so something else is not done yet at boot I guess. Manually disconnect the usb-port and reconnect it did also work for me.

Hi to everyone,

I installed BB rc3 on my tl-1043-nd V1 and having the only chance to access internet through a 3g modem (vacation) I installed the needed packages but:

-To allow the mode switching I had to add the file /etc/modules.d/60-usbserial with the instruction: usbserial vendor=0x12d1 product=0x1506 (my modem is a huawei E3131) as described by someone on another post

-I experienced the same issues described by Widmark on post 17 and I think I solved the problem with following commands in rc.local:
    ifdown 3g
    /etc/init.d/usbmode restart
    sleep  5
    ifup 3g
where 3g is the name I have given to the 3g interface. I would very much like to try the solution Widmark has adopted, but I'm not so sure about where to set the sleep command in /sbin/hotplug-call, can anyone help me?

-The 3g connection becomes VERY VERY slow randomly and the only way to restore normal speed (without rebooting) is to reconnect to the isp (through LUCI or command line). But sometimes the benefits of this action doesn't last more then a couple of minutes and I have to reconnect again so that it becomes impossible to work on internet. Does anyone have this same problem? Btw I had this same issue I'm describing here with BB rc2 and the latest version of AA.

Many thanks for the help

(Last edited by skyarrow92 on 4 Sep 2014, 11:48)

I know this topic is quiet old, but i face the exact same problem as described in the first post from user drazvan.
Nothing gets detected or shown in dmesg,lsusb or cat /sys/kernel/debug/usb/devices.
Only replugging after boot solves the issue.

In my case it's a HooToo HT-TM02 with a Ralink chip. Modem is a ZTE MF823.

Any progress on your side drazvan.

I'm using LEDE 17.01 at the moment but same problem with Chaos Chalmer.

I've opened a ticket at LEDE Bugs:

ID 661

Any suggestions for me.

THX

The discussion might have continued from here.