Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
tlg
Posts: 4
Joined: 11 Jan 2014, 08:00

E173u-1 OpenWrt MR3020 Very slow to connect

Post by tlg » 11 Jan 2014, 08:48

I have a TP Link MR3020 with OpenWrt Attitude Adjustment 12.09 stable release installed.

I have two Huawei USB modems - an E220 and an E173 which internally is labelled E173u-1, and which was supplied by Metfone in Cambodia, along with a SIM card.

When I use the E220 modem, the connection to the Metfone service happens within a couple of minutes of powering up the device, and everything works as expected. So obviously all the basic requirements are in place.

But when I use the E173 modem, it takes at least five minutes for the connection to be set up after powering up the device.
After that it operates as expected.

So I am trying to understand what is going on and whether there is a way to speed up the connection time for the E173.
I am not entirely sure that this is even a modeswitch issue, so I am seeking advice.
The basic issue seems to be that the ttyUSBx ports don't appear for a long period of time.

Below are some diagnostics I have done.
I have done a lot of searching around this topic but not found anything that seems to throw enough light on what is happening.

Any help and suggestions greatly appreciated.

-----------------------
I have installed the following OpenWrt packages to support USB modem operation:

# opkg install comgt
# opkg install kmod-usb-serial
# opkg install kmod-usb-serial-option
# opkg install kmod-usb-serial-wwan
# opkg install usb-modeswitch
# opkg install usb-modeswitch-data

-----------------------
When the MR3020 device is booted up with the E173 installed, and while waiting for the connection, the command "ls /dev" shows that there are no ttyUSBx ports. Once the connection is made it will typically show just ttyUSB0.

If I power up the MR3020 without the modem, then plug it in once the MR3020 is booted, ttyUSB0-4 appear quite quickly.

------------------------
Checking for the usb device shows the expected output as below:

# cat /proc/bus/usb/devices

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=12d1 ProdID=14a8 Rev= 0.00
S: Manufacturer=Technology
S: Product=Mobile Connect
C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=2ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usbserial_generic
E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

------------------------
The "/etc/usb_modeswitch.d/12d1:14b5" file is used by modeswitch and contains 12d1:14a8 as a target, so this all seems fine.


# cat /etc/usb_modeswitch.d/12d1:14b5
# Huawei E173 (Viettel 3G)

TargetVendor= 0x12d1
TargetProduct= 0x14a8


MessageContent="55534243123456780000000000000011062000000100000000000000000000"

-------------------------
Checking the logs gives the output below which shows ttyUSB ports, even though they are not shown present with the "ls /dev" command.

# logread
....
Jan 10 14:23:07 OpenWrt user.notice usb-modeswitch: 1-0:1.0: Manufacturer=Linux_3.3.8_ehci_hcd Product=Generic_Platform_EHCI_Controller Serial=ehci-platform
Jan 10 14:23:07 OpenWrt user.notice usb-modeswitch: 1-1:1.0: Manufacturer=Technology Product=Mobile_Connect Serial=?
Jan 10 14:23:07 OpenWrt user.notice usb-modeswitch: 1-1:1.0: Selecting /etc/usb_modeswitch.d/12d1:14b5 for mode switching
Jan 10 14:23:07 OpenWrt user.notice ifup: Enabling Router Solicitations on lan (br-lan)
Jan 10 14:23:07 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14b5 on 001/002
Jan 10 14:23:08 OpenWrt kern.info kernel: [ 16.070000] usb 1-1: USB disconnect, device number 2
Jan 10 14:23:11 OpenWrt user.notice ifup: Enabling Router Solicitations on loopback (lo)
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.190000] usb 1-1: new high-speed USB device number 3 using ehci-platform
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.360000] usbserial_generic 1-1:1.0: generic converter detected
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.370000] usb 1-1: generic converter now attached to ttyUSB0
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.370000] usbserial_generic 1-1:1.1: generic converter detected
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.380000] usb 1-1: generic converter now attached to ttyUSB1
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.390000] usbserial_generic 1-1:1.2: generic converter detected
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.390000] usb 1-1: generic converter now attached to ttyUSB2
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.400000] usbserial_generic 1-1:1.3: generic converter detected
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.400000] usb 1-1: generic converter now attached to ttyUSB3
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.410000] usbserial_generic 1-1:1.4: generic converter detected
Jan 10 14:23:12 OpenWrt kern.info kernel: [ 20.410000] usb 1-1: generic converter now attached to ttyUSB4
.....


----------------------------------
Even after the connection is successfully made, there are lots of log entries about switching failed

Jan 11 06:19:46 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Manufacturer=Technology Product=Mobile_Connect Serial=?
Jan 11 06:19:46 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Selecting /etc/usb_modeswitch.d/12d1:14a8-test for mode switching
Jan 11 06:19:46 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14a8 on 001/003
Jan 11 06:20:16 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Switching seemingly failed
Jan 11 06:20:17 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14a8 on 001/003
Jan 11 06:20:47 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Switching seemingly failed
Jan 11 06:20:48 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14a8 on 001/003
Jan 11 06:21:19 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Switching seemingly failed
Jan 11 06:21:20 OpenWrt syslog.notice usb_modeswitch: switching device 12d1:14a8 on 001/003
Jan 11 06:21:50 OpenWrt user.notice usb-modeswitch: 1-1:1.4: Switching seemingly failed

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by LOM » 11 Jan 2014, 14:32

It looks like your E173 draws more current than the router can supply on the usb bus so the modem resets itself. MR-3020 has weak usb power so you'll have to use a separately powered usb hub for most 3G dongles.
It is sometimes enough to just turn off wifi or substitute the original 5V 1A power adaptor with a 5V 2A.

tlg
Posts: 4
Joined: 11 Jan 2014, 08:00

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by tlg » 11 Jan 2014, 18:05

Thanks for the reply. That gives me a few options to try out.

What is it in the diagnostics that indicates that the modem is resetting itself?

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by LOM » 11 Jan 2014, 20:44

tlg wrote:
What is it in the diagnostics that indicates that the modem is resetting itself?
Experience from my own TP-Link MR routers and the fact that your E220 works while the E173 takes up to 5 minutes to connect.
You should btw remove your own created config file /etc/usb_modeswitch.d/12d1:14a8-test, 12d1:14b5 is the id which should be switched and have the config file. 12d1:14a8 is the id fter switching and that id it can not be further switched.

tlg
Posts: 4
Joined: 11 Jan 2014, 08:00

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by tlg » 12 Jan 2014, 01:56

Thanks for the reminder to remove my test file, I have done so.

I am working in rural Cambodia at present and so a bit limited with options. I can't get a powered hub to try at present, unfortunately.
I have only a few days left to try to get the set up working well before we have to leave, so I am really keen to try any ideas.
The unit is to provide some limited Internet access for a small community school.

I have switched off wifi and I have a USB cable with two USB connectors so that I can connect it to two USB ports on my laptop, which I think would be similar to using a 2A power supply.
With these changes, the behaviour remains unchanged.

The LED indicator on the modem does not give any indication of resetting - it just flashes regularly indicating that it has network access.
I appreciate that this reflects the GSM side of things and there may be some more subtle effect happening on the USB side of the device, but there is no sign that the whole modem is resetting.

The other thing that is noticeable is that the delay in starting is quite repeatable - it is always just five minutes.
I would have expected that if there was a power based resetting problem that the behaviour would have been somewhat random.

Are there any other diagnostics that I can run that might shed more light on what is happening?

Thanks again for your help, and any suggestions are welcome.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by LOM » 12 Jan 2014, 07:18

tlg wrote: The other thing that is noticeable is that the delay in starting is quite repeatable - it is always just five minutes.
I would have expected that if there was a power based resetting problem that the behaviour would have been somewhat random.
Yes it would probably not be a fixed time if it was a power reset, you can usually see those in dmesg.
The dongle will get a usb device number for the initial usb id, this device number will disappear when the dongle gets modeswitched, the dongle will then reappear with its new usb id and the device number will be incremented.
This should only happens once, if you see many of these disappearances/reappearances then you have a usb power problem.

Five minutes is a very long time for establishing a connection, that should normally not take more than 30-60 secs after plugging the dongle. OpenWRT has had problem with 3G dongles in the past and I see that you are using a quite old build/kernel and for some reason using the usb-serial.ko driver instead of the much better option.ko driver.

Do take a look at:
http://ofmodemsandmen.com/

which is a fork from OpenWRT, niched for 3G. They have more features and less problems in their fork than OpenWRT has.

tlg
Posts: 4
Joined: 11 Jan 2014, 08:00

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by tlg » 12 Jan 2014, 07:49

Many thanks for that information. I will see if we can try out the alternate firmware you have suggested.

The E220 modem works just as you describe, connecting in about a minute after powering up the device. This is what has led me to thinking that it is something specific to the E173.

The OpenWrt version I have been using is the last stable release called Attitude Adjustment 12.09 (which dates from April 2013).
I loaded up the standard firmware image from the OpenWrt downloads page and added the 3G support packages from the standard repo.

But I am wondering whether I have somehow got old drivers or whether the new option.ko driver you mentioned has been developed since
the AA release.

DirkAurich
Posts: 12
Joined: 02 Jan 2024, 07:24

Re: E173u-1 OpenWrt MR3020 Very slow to connect

Post by DirkAurich » 27 Apr 2024, 09:40

I've shared this with all my friends. It's too good not to. bar pitti nyc

Post Reply