USB modem - Huawei E3372h-153/E3372s-153 (in StickMode; non-HiLink)
Firmware versions beginning with 21.xxx.xx.xx.xx NOT 22.xxx.xx.xx.xx
Router running OpenWRT; I use:
- GL.iNet AR750S firmware v3.022
- OpenWrt 18.06.1 r7258-5eb055306f / LuCI openwrt-18.06 branch (git-18.196.56128-9112198)
- usbutils
- usb-modeswitch
- kmod-usb-net-huawei-cdc-ncm
- kmod-usb-net-cdc-ncm
- kmod-usb-net-cdc-ether
- comgt-ncm
- kmod-usb-serial
- kmod-usb-serial-option
- kmod-usb-serial-wwan
- luci-proto-ncm
- luci-proto-3g
Confirm the modem is recognised. Note that 12d1:1506 is the USB ID after mode switching has taken place, and indicates that the net interfaces are driven by the Linux huawei_cdc_ncm driver.
root@GL-AR750S:~# lsusb
Bus 001 Device 019: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Confirm there are two interfaces:
root@GL-AR750S:~# dmesg | grep tty
[ 1160.409071] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1160.423206] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
Check the current mode by sending AT commands (the GL-iNet firmware has a nice UI for sending AT commands manually. I had to send the commands to port /dev/ttyUSB0). The list of all modes is:
^SETPORT:3: 3G DIAG
^SETPORT:10: 4G MODEM
^SETPORT:1: 3G MODEM
^SETPORT:12: 4G PCUI
^SETPORT:13: 4G DIAG
^SETPORT:5: 3G GPS
^SETPORT:14: 4G GPS
^SETPORT:A: BLUE TOOTH
^SETPORT:16: NCM
^SETPORT:A1: CDROM
^SETPORT:A2: SD
For this guide, we need at least 1, 12 and 16 (note, 12 is always required, or you will brick the modem)
AT^SETPORT?
^SETPORT:“A1,A2;12,1,16,A1,A2
OK
Add the following entry to /etc/config/network; substituting the APN and dialnumber for that of your mobile provider (and adding username/password if required)
config interface 'modem_1_1'
option mode 'preferlte'
option apn 'three.co.uk'
option dialnum '*99#'
option proto 'ncm'
option ifname 'wwan0'
option device '/dev/ttyUSB0'
option ipv6 'auto'
option metric '40'
option delegate '0'
option disabled '0'
Note, for 3G only, the following works:
config interface 'modem_1_1'
option ifname '3g-modem'
option service 'umts'
option apn 'three.co.uk'
option proto '3g'
option device '/dev/ttyUSB1'
option dialnumber '*99#'
option metric '40'
option disabled '0'
After adding one of these entries; do:
root@GL-AR750S:~# uci commit /etc/config/network
root@GL-AR750S:~# service network restart
With NCM, logs should show something like. You'll know it's up if there are no errors and a DHCP lease is obtained
Fri May 31 07:47:54 2019 daemon.notice netifd: Interface 'modem_1_1_4' is disabled
Fri May 31 07:47:54 2019 daemon.notice netifd: modem_1_1 (5878): Stopping network modem_1_1
Fri May 31 07:47:55 2019 daemon.notice netifd: modem_1_1 (5878): sending -> AT^NDISDUP=1,0
Fri May 31 07:47:55 2019 daemon.warn odhcpd[1856]: DHCPV6 SOLICIT IA_NA from 00010001221705213c15c2c0fd64 on br-lan: ok fd56:3f5a:232e:10::2fb/128
Fri May 31 07:47:55 2019 daemon.notice netifd: modem_1_1 (5878): Command failed: Permission denied
Fri May 31 07:47:55 2019 daemon.notice netifd: Interface 'modem_1_1' is now down
Fri May 31 07:47:55 2019 daemon.notice netifd: Interface 'modem_1_1' is setting up now
Fri May 31 07:47:56 2019 daemon.warn odhcpd[1856]: DHCPV6 REQUEST IA_NA from 00010001221705213c15c2c0fd64 on br-lan: ok fd56:3f5a:232e:10::2fb/128
Fri May 31 07:47:59 2019 daemon.notice netifd: modem_1_1 (6032): sending -> AT
Fri May 31 07:47:59 2019 daemon.notice netifd: modem_1_1 (6032): sending -> ATZ
Fri May 31 07:48:00 2019 daemon.notice netifd: modem_1_1 (6032): sending -> ATQ0
Fri May 31 07:48:01 2019 daemon.notice netifd: modem_1_1 (6032): sending -> ATV1
Fri May 31 07:48:01 2019 daemon.notice netifd: modem_1_1 (6032): sending -> ATE1
Fri May 31 07:48:02 2019 daemon.notice netifd: modem_1_1 (6032): sending -> ATS0=0
Fri May 31 07:48:03 2019 daemon.notice netifd: modem_1_1 (6032): sending -> AT+CGDCONT=1,"IP","three.co.uk"
Fri May 31 07:48:03 2019 daemon.notice netifd: modem_1_1 (6032): Configuring modem
Fri May 31 07:48:03 2019 daemon.notice netifd: modem_1_1 (6032): Setting mode
Fri May 31 07:48:04 2019 daemon.notice netifd: modem_1_1 (6032): sending -> AT^SYSCFGEX="030201",3fffffff,2,4,7fffffffffffffff,,
Fri May 31 07:48:05 2019 daemon.notice netifd: modem_1_1 (6032): Starting network modem_1_1
Fri May 31 07:48:05 2019 daemon.notice netifd: modem_1_1 (6032): Connecting modem
Fri May 31 07:48:06 2019 daemon.notice netifd: modem_1_1 (6032): sending -> AT^NDISDUP=1,1,"three.co.uk"
Fri May 31 07:48:06 2019 daemon.notice netifd: modem_1_1 (6032): Setting up wwan0
Fri May 31 07:48:07 2019 daemon.notice netifd: Interface 'modem_1_1_4' is enabled
Fri May 31 07:48:07 2019 daemon.notice netifd: Interface 'modem_1_1' is now up
Fri May 31 07:48:07 2019 daemon.notice netifd: Network device 'wwan0' link is up
Fri May 31 07:48:07 2019 daemon.notice netifd: Network alias 'wwan0' link is up
Fri May 31 07:48:07 2019 daemon.notice netifd: Interface 'modem_1_1_4' has link connectivity
Fri May 31 07:48:07 2019 daemon.notice netifd: Interface 'modem_1_1_4' is setting up now
Fri May 31 07:48:07 2019 daemon.notice netifd: modem_1_1_4 (6862): udhcpc: started, v1.28.3
Fri May 31 07:48:08 2019 daemon.notice netifd: modem_1_1_4 (6862): udhcpc: sending discover
Fri May 31 07:48:08 2019 daemon.notice netifd: modem_1_1_4 (6862): udhcpc: sending select for 100.93.141.179
Fri May 31 07:48:08 2019 daemon.notice netifd: modem_1_1_4 (6862): udhcpc: lease of 100.93.141.179 obtained, lease time 518400
Fri May 31 07:48:09 2019 daemon.notice netifd: Interface 'modem_1_1_4' is now up
Fri May 31 07:48:19 2019 user.notice firewall: Reloading firewall due to ifup of modem_1_1 (wwan0)
With 3g, you'll see similar; again, look for an IP address being assigned:
Fri May 31 08:21:37 2019 daemon.notice netifd: Interface 'modem_1_1' is setting up now
Fri May 31 08:21:40 2019 daemon.notice netifd: modem_1_1 (22639): cat: can't open '/tmp/modem.1-1/signal': No such file or directory
Fri May 31 08:21:40 2019 daemon.notice pppd[22823]: pppd 2.4.7 started by root, uid 0
Fri May 31 08:21:41 2019 local2.info chat[22935]: abort on (BUSY)
Fri May 31 08:21:41 2019 local2.info chat[22935]: abort on (NO CARRIER)
Fri May 31 08:21:41 2019 local2.info chat[22935]: abort on (ERROR)
Fri May 31 08:21:41 2019 local2.info chat[22935]: report (CONNECT)
Fri May 31 08:21:41 2019 local2.info chat[22935]: timeout set to 10 seconds
Fri May 31 08:21:41 2019 local2.info chat[22935]: send (AT+CGDCONT=1,"IP","three.co.uk"^M)
Fri May 31 08:21:42 2019 local2.info chat[22935]: timeout set to 30 seconds
Fri May 31 08:21:42 2019 local2.info chat[22935]: expect (OK)
Fri May 31 08:21:42 2019 local2.info chat[22935]: ^M
Fri May 31 08:21:42 2019 local2.info chat[22935]: OK
Fri May 31 08:21:42 2019 local2.info chat[22935]: -- got it
Fri May 31 08:21:42 2019 local2.info chat[22935]: send (ATD*99#^M)
Fri May 31 08:21:42 2019 local2.info chat[22935]: expect (CONNECT)
Fri May 31 08:21:42 2019 local2.info chat[22935]: ^M
Fri May 31 08:21:42 2019 local2.info chat[22935]: ^M
Fri May 31 08:21:42 2019 local2.info chat[22935]: CONNECT
Fri May 31 08:21:42 2019 local2.info chat[22935]: -- got it
Fri May 31 08:21:42 2019 local2.info chat[22935]: send ( ^M)
Fri May 31 08:21:42 2019 daemon.info pppd[22823]: Serial connection established.
Fri May 31 08:21:42 2019 kern.info kernel: [67662.097799] 3g-modem_1_1: renamed from ppp0
Fri May 31 08:21:42 2019 daemon.info pppd[22823]: Using interface 3g-modem_1_1
Fri May 31 08:21:42 2019 daemon.notice pppd[22823]: Connect: 3g-modem_1_1 <--> /dev/ttyUSB1
Fri May 31 08:21:43 2019 daemon.warn pppd[22823]: Could not determine remote IP address: defaulting to 10.64.64.64
Fri May 31 08:21:43 2019 daemon.notice pppd[22823]: local IP address 10.51.143.194
Fri May 31 08:21:43 2019 daemon.notice pppd[22823]: remote IP address 10.64.64.64
Fri May 31 08:21:43 2019 daemon.notice pppd[22823]: primary DNS address 172.30.139.16
Fri May 31 08:21:43 2019 daemon.notice pppd[22823]: secondary DNS address 172.31.139.16
Fri May 31 08:21:43 2019 daemon.notice netifd: Network device '3g-modem_1_1' link is up
Fri May 31 08:21:43 2019 daemon.notice netifd: Interface 'modem_1_1' is now up
With ROOter firmware it is not even necessary to take care about modules, etc.
For me the standard modem composition is FF;10,12,16
^SETPORT availability depends on the modem firmware version
Additional configuration steps are required on the modem in order to enable IPv6, subject to fw version limitations; modified fw with unlocked commands is recommended.
dialnumber,username/password are not required for NCM