OpenWrt Forum Archive

Topic: usbmode (usb-modeswitch) fails to load config file

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

Using Chaos Calmer on TP-LINK MR3020, trying to get Netgear Aircard AC327U (2077:a003/ 2077:f000) 3G dongle to work.

Installed all requisite (USB support and 3G related) packages.

dmesg says:

```
root@OpenWrt:/# dmesg | grep usb
[    4.500000] usbcore: registered new interface driver usbfs
[    4.500000] usbcore: registered new interface driver hub
[    4.510000] usbcore: registered new device driver usb
[    4.630000] usbcore: registered new interface driver usb-storage
[    5.260000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    5.720000] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
[    5.850000] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[    5.860000] scsi host0: usb-storage 1-1.1:1.0
[    5.940000] usb 1-1.4: new high-speed USB device number 4 using ehci-platform
[    6.070000] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[    6.080000] scsi host1: usb-storage 1-1.4:1.0
[   17.410000] usb 1-1.1: USB disconnect, device number 3
[   17.730000] usb 1-1.1: new high-speed USB device number 5 using ehci-platform
[   17.860000] usb-storage 1-1.1:1.2: USB Mass Storage device detected
[   17.880000] scsi host2: usb-storage 1-1.1:1.2
[   26.550000] usbcore: registered new interface driver usbserial
[   26.550000] usbcore: registered new interface driver usbserial_generic
[   26.560000] usbserial: USB Serial support registered for generic
[   26.920000] usbcore: registered new interface driver option
[   26.920000] usbserial: USB Serial support registered for GSM modem (1-port)
```

```
root@OpenWrt:/# usbmode -l -c /etc/usb_modeswitch.d/2077\:f000
Failed to load config file
```

Checked in the /etc/usb-mode.json file, my 3G device is supported.

How do I get it to switch mode?

See log (output of logread), usbmodeswitch should be called automatically. Does it have line with usbmodeswitch? What is list of your packages (output of opkg list)? The manual https://wiki.openwrt.org/doc/recipes/et … verusb_ncm is not working. I recommend you to use ofmodemsandmen, it should work.

(Last edited by ulmwind on 5 Oct 2017, 22:41)

I extracted the tar ball (downloaded from http://draisberghof.de) and put the files in appropriate dirs directly on my Chaos Calmer.

It then occurred to me that I am missing duplicating what 'gem-rules.tcl' file might be doing. I can't read Makefiles really well.

It's either putting the usb-modeswitch-data tar ball's contents by hand into Chaos Calmer or compiling it. Currently, I am attempting the latter. Because despite bug tickets saying the data part is inside usb-modeswitch package, it isn't! and it's been 4 years since anyone has done anything about it. Would be a bummer to not be able to use my 3G dongle on TP-LINK MR3020 running Chaos Calmer.

Thanks!

Your dmesg shows that the modem has switched mode.
I don't think 2077:a003 is included in the option serial driver so you'll likely have to manually force option to bind

echo 2077 a003  > /sys/bus/usb-serial/drivers/option1/new_id

and you will get 3 ttyUSB devices under /dev.  ttyUSB2 is the modem ppp dialup device, ttyUSB1 is the user interface (AT-cmd) device.

Thank you! that did it though am still not able to connect to internet.

root@OpenWrt:~# gcom info -d /dev/ttyUSB1
##### Wireless WAN Modem Configuration #####
Product text:
====

Manufacturer:   
Model: AC327U
Revision: AC327U
IMEI: 352767046318448
+GCAP: +CGSM,+DS,+ES
OK
AT&F
ATE1
AT+CGDCONT=1,"IP","airtelgprs.com"
ATD*99#ATI
Manufacturer:   
Model: AC327U
Revision: AC327U
IMEI: 352767046318448
+GCAP: +CGSM,+DS,+ES
OK
====
Manufacturer:           TI
IMEI and Serial Number: ATE1
Manufacturer's Revision: 
comgt 09:28:58 -> -- Error Report --
comgt 09:28:58 -> ---->                      ^
comgt 09:28:58 -> Error @982, line 56, String is shorter than second argument. (7)

Fri Oct  6 09:30:26 2017 local2.info chat[21378]: send (AT&F^M)
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: expect (OK)
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: AT&F^M^M
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: OK
Fri Oct  6 09:30:26 2017 local2.info chat[21378]:  -- got it
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: send (ATE1^M)
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: expect (OK)
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: ^M
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: ATE1^M^M
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: OK
Fri Oct  6 09:30:26 2017 local2.info chat[21378]:  -- got it
Fri Oct  6 09:30:26 2017 local2.info chat[21378]: send (AT+CGDCONT=1,"IP","airtelgprs.com"^M)
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: timeout set to 30 seconds
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: expect (OK)
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: ^M
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: AT+CGDCONT=1,"IP","airtelgprs.com"^M^M
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: OK
Fri Oct  6 09:30:27 2017 local2.info chat[21378]:  -- got it
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: send (ATD*99#^M)
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: expect (CONNECT)
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: ^M
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: ATD*99#^M^M
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: ERROR
Fri Oct  6 09:30:27 2017 local2.info chat[21378]:  -- failed
Fri Oct  6 09:30:27 2017 local2.info chat[21378]: Failed (ERROR)
Fri Oct  6 09:30:27 2017 daemon.err pppd[21376]: Connect script failed
Fri Oct  6 09:30:28 2017 daemon.info pppd[21376]: Exit.
Fri Oct  6 09:30:28 2017 daemon.notice netifd: Interface 'Data' is now down
Fri Oct  6 09:30:28 2017 daemon.notice netifd: Interface 'Data' is setting up now
Fri Oct  6 09:30:30 2017 daemon.notice pppd[21399]: pppd 2.4.7 started by root, uid 0

Are you using ttyUSB2 for the dialup?
ttyUSB1 is for AT-cmds after you have a ppp connection on ttyUSB2.

AC327 might start in airplane mode with limited functonality, if so then you have to send AT+CFUN=1 to it in order to get full functionality.

Am using ttyUSB1.

Lars Melin wrote:

Are you using ttyUSB2 for the dialup?

ttyUSB1 is for AT-cmds after you have a ppp connection on ttyUSB2.

AC327 might start in airplane mode with limited functonality, if so then you have to send AT+CFUN=1 to it in order to get full functionality.

Where do I put this command AT+CFUN=1? I mean which file or how?

I just read that you wrote "ttyUSB1 is for AT-cmds after you have a ppp connection on ttyUSB2"

Am using luci to add/configure the 3g interface. what is the right way to configure my connection now?

(Last edited by sindhus on 6 Oct 2017, 12:44)

Lars, would you be so kind as to explain, how ncm stick modem works. Instruction https://wiki.openwrt.org/doc/recipes/et … verusb_ncm is not working, it contains even typos (mode instead of modes in network config, register in name of interface in script). Router tries to send commands to /dev/cdc-wdm0, it doesn't respond. I've tried OfModemsAndMen (https://www.ofmodemsandmen.com/), and it has established connection! In the log there are commands, being sent to /dev/ttyUSB1. But how does it work in manual mode? How network section should be configured, how are devices /dev/cdc-wdm0 and /dev/ttyUSB1 specified?

(Last edited by ulmwind on 6 Oct 2017, 13:20)

hi ulmwind,

how does one know if a modem is using ncm?

thanks for the link ulmwind, I installed rooter on my tp-link and it worked nicely! though just one minor issue. I set up the 3G interface and the router connects to internet but my wifi devices connecting to the router can't access internet (won't go beyond the DNS lookup). What might am I doing wrong?

Figured it out! had attached the 3g interface to LAN by mistake

Also "echo 2077 a003  > /sys/bus/usb-serial/drivers/option1/new_id" and `usbmode -s 2077:f000` aren't persistent. I added them to the "Startup" section but the usbmode command doesn't seem to work upon a reboot. Where should I put this in for it be executed upon a reboot?

(Last edited by sindhus on 7 Oct 2017, 05:55)

Thanks for the info

The discussion might have continued from here.