OpenWrt Forum Archive

Topic: [10.03.1-WR1043ND] usb 3G dongle disconnecting

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

PARTIALLY SOLVED! READ MY LATER POST
I'm making some experiments with my USB 3G dongle.
I've already tested it on my Linux PC (a Kubuntu workstation) and everything is fine.
This is what is installed on my box pertaining "usb":

kmod-usb-acm    
kmod-usb-core   
kmod-usb-net    
kmod-usb-net-cdc-ether  
kmod-usb-ohci   
kmod-usb-serial 
kmod-usb-serial-option  
kmod-usb2       
libusb  
libusb-1.0      
usb-modeswitch  
usb-modeswitch-data     
usbutils

I have created a new interface "WAN2" of type "UMTS/GPRS/EV-DO".
The modem device is /dev/ttyACM0 (ls /dev/ttyACM* shows also a ttyACM1).
The service type is UMTS/GPRS and APN, PIN, username and password are the same as used on my Linux PC for tests.
I have assigned this interface to the same firewall-zone as the WAN.
All other settings are the ones by default.
After a reboot this is what is recorder into my syslog:

chat[9884]: abort on (BUSY)
chat[9884]: abort on (NO CARRIER)
chat[9884]: abort on (ERROR)
chat[9884]: report (CONNECT)
chat[9884]: timeout set to 10 seconds
chat[9884]: send (AT&F^M)
chat[9884]: expect (OK)
chat[9884]: AT&F^M^M
chat[9884]: OK
chat[9884]:  -- got it
chat[9884]: send (ATE1^M)
chat[9884]: expect (OK)
chat[9884]: ^M
chat[9884]: ATE1^M^M
chat[9884]: OK
chat[9884]:  -- got it
chat[9884]: send (AT+CGDCONT=1,"IP","internet.apn"^M) 
chat[9884]: timeout set to 30 seconds
chat[9884]: expect (OK)
chat[9884]: ^M
chat[9884]: AT+CGDCONT=1,"IP","internet.apn"^M^M 
chat[9884]: OK
chat[9884]:  -- got it
chat[9884]: send (ATD*99***1#^M)
chat[9884]: expect (CONNECT)
chat[9884]: ^M
chat[9884]: ATD*99***1#^M^M
chat[9884]: CONNECT
chat[9884]:  -- got it
chat[9884]: send ( ^M)
pppd[7104]: Serial connection established.
pppd[7104]: Using interface 3g-WAN2
pppd[7104]: Connect: 3g-WAN2 <--> /dev/ttyACM0
pppd[7104]: Remote message: Icera PPP - Password Verified OK 
pppd[7104]: PAP authentication succeeded
pppd[7104]: LCP terminated by peer (0021: Normal Termination by NCP)
pppd[7104]: Hangup (SIGHUP)
pppd[7104]: Modem hangup
pppd[7104]: Connection terminated.

You can read LCP terminated by peer (0021: Normal Termination by NCP) which is always logged in very same second as the previos event ("PAP authentication succeeded"). The multiwan module is installed but disabled at the moment and (I hope) it should be considered harmless as far as these tests are concerned.
I'm pretty sure I'm missing something, but I am not able to pinpoint the actual issue.
Is there any hint or any idea on how to troubleshoot this problem?
TIA.
(Maybe uselsss to say, the Wiki is ... useless in this case, as there's very little information about USB 3G dongles).

(Last edited by uqbar on 23 Jan 2012, 08:53)

Maybe I have found something new.
In the wiki I see I should get the following messages in the logs:

Connect: 3g-wan <--> /dev/ttyUSB0
Could not determine remote IP address: defaulting to x.x.x.x
local  IP address x.x.x.x
remote IP address  x.x.x.x
primary   DNS address  x.x.x.x
secondary DNS address  x.x.x.x
adding wan (3g-wan) to firewall zone wan

While, after the first line saying I have the network interface, I get the disconnection instead of getting the IP link details.
This leads me to understand that I'm missing something in the PPP, possibly the LCP phase.
Anyone there has some hints?

I've gathered much more details.
I've enabled the debug mode in /lib/network/3g.sh (where the pppd is started).
And this is what I've got during a connection attempt:

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xa02d3101>]
rcvd [LCP ConfReq id=0x1 <mru 1600> <auth pap> <magic 0xe3565da5> <asyncmap 0x0> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x1 <auth pap> <pcomp> <accomp>] 
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xa02d3101>]
rcvd [LCP ConfReq id=0x2 <mru 1600> <magic 0xe3565da5> <asyncmap 0x0>]
sent [LCP ConfAck id=0x2 <mru 1600> <magic 0xe3565da5> <asyncmap 0x0>]
sent [LCP EchoReq id=0x0 magic=0xa02d3101]
sent [IPCP ConfReq id=0x1 <addr 192.168.128.254>]
rcvd [LCP EchoRep id=0x0 magic=0xe3565da5]
sent [LCP EchoReq id=0x1 magic=0xa02d3101]
rcvd [LCP EchoRep id=0x1 magic=0xe3565da5]
rcvd [LCP TermReq id=0x0 "0021: Normal Termination by NCP"]
LCP terminated by peer (0021: Normal Termination by NCP)

Maybe I'm wrong, but:
1. My PPP is sending/suggesting the remote peer what it finds to be its LAN address (192.168.128.254)
2. It's the remote peer to ask for disconnection
3. The link is dropped because of IPCP/LCP going somehow bad.

...

SOLVED!
I can get the conenction working by saying OpenWRT not to define a default route on the 3G interface.
At the moment I have no idea why this triggers the issue, but I think it's related to the fact that in my setup I already have a working WAN, which is PPPOE over eth0.2 (aka WAN) interface.
Also this connection is done with PPPD.
Which is started with this command line:

/usr/sbin/pppd plugin rp-pppoe.so mtu 1492 mru 1492 persist defaultroute replacedefaultroute user username password password ipparam "wanifname pppoe-wan" nodetach nic-eth0.2

(seen in /proc/<ppp pid>/cmdline).
It's also possible that the multiwan package I've installed was interefering. But now I need to better understand how it works.
In the end I'll update both the multiwan wiki page and the usb 3g dongle one.

kmod-usb-acm    
kmod-usb-core   
kmod-usb-net    
kmod-usb-net-cdc-ether  
kmod-usb-ohci   
kmod-usb-serial 
kmod-usb-serial-option  
kmod-usb2       
libusb  
libusb-1.0      
usb-modeswitch  
usb-modeswitch-data     
usbutils

Where is comgt and chat package ?

Those packages are not related to usb and were pulled in by don-t-remember-which-other-packages.

This is my current situation.

First of all it seems you need to reboot the box once you have connected everything (especially the 3g USB dongle) and after every change to the wan or multiwan configuration.
Failing to do so can lead to a non working box.
This is just annoying as once the configuration is in place you'd not need reboots any more.

In Network-->Interfaces I can see both WANs (xDSL pppoe, 3g ppp) as up and running as well as the traffic going through both interfaces.
I have opened 2 web pages: http://whatismyip.org/ and http://www.ripe.net/.
If I refresh both I often can see two different IPs. This should mean that I am balancing the load. Good!

In Status-->Overview I am experiencing a major glitch.
I can see only one WAN instead of two while on the CLI I can see two default routes, one for each interface (pppoe-wan and 3g-wan).
The choice seems to be at random or it could be that only the first one to come up is shown. This is just an annoyance, though.

I've simulated a pppoe disconnection by disconnecting the DSL cable from the modem.
From the Status-->Overview I've seen that interface going from OK to Failing to KO.
But once the cable has been reconnected the interface was still labelled as KO.
The Network-->Interfaces was showing the pppoe was actually back, but the multiwan daemon was failing to recognize this situation.
A restart of the multiwan by CLI brought the situation back to normal.

Now:
- supposing the DNSs are ping-able is a hard assumption in general;
- ICMP pings over a 3G network could not work [a few 3G operator only allow UDP:53 and TCP<1024];
- if you want to use DNSs for link checks, then you'd better use them as DNSs (nslookup, dig or even netcat), not as ICMP tagets;
- there could be some bug in the "link recovery" procedure.

Finally, it's not clear to me how to configure a "main link with backup", which is the final objective I'm heading to.
Anyone had this working?

(Last edited by uqbar on 23 Jan 2012, 08:53)

The discussion might have continued from here.