EM160R-GL on linux in ECM mode does not give an IP address when request an address via DHCP, this problem is not present in QMI and MBIM modes, but I want ECM mode.
I think I found the solution to the problem in ECM mode, but those AT settings do not work on the EM160R-GL modem.
- Anyone who has worked with RM500U-CN? - #58 by jfrog
- Anyone who has worked with RM500U-CN? - #22 by jfrog
- ECM Dial-up - Waveshare Wiki
- RG500U - IPPT and RGMII - #2 by radiomean
Maybe these AT commands are the solution, but they give me ERROR:
AT+QCFG="ethernet"
ERROR
AT+QCFG="ethernet",0
ERROR
AT+QCFG="nat",0
ERROR
AT+QNETDEVCTL?
ERROR
AT+QNETDEVSTATUS
ERROR
AT+QNETDEVCTL=1,1,1
ERROR
AT+QNETDEVCTL=1,3,1
ERROR
AT+QNETDEVCTL=2,3,1
ERROR
AT+QNETDEVCTL=3,1,0
ERROR
AT+QNETDEVSTATUS
ERROR
AT+QMAP
ERROR
AT+QMAP?
ERROR
AT+QMAP=?
ERROR
AT+QMAP="LANIP"
ERROR
Troubleshooting
With an âxâ I hide IMEI, IP and MAC addresses.
Linux Commands:
Modify TTL and Hop Limit for egress traffic in nftables:
root@OpenWrt:~# nft list ruleset
...
chain mangle_postrouting {
type filter hook postrouting priority mangle; policy accept;
oifname { "usb0", "ppp0", "eth1", "wwan0" } ip ttl set 65
oifname { "usb0", "ppp0", "eth1", "wwan0" } ip6 hoplimit set 65
}
...
root@OpenWrt:~# udhcpc -n -q -f -i usb0
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: broadcasting discover
udhcpc: no lease, failing
root@OpenWrt:~# ip a
8: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
link/ether 1a:37:x:x:x:x brd ff:ff:ff:ff:ff:ff
inet6 fe80::1837:x:x:x/64 scope link
valid_lft forever preferred_lft forever
root@OpenWrt:~# ip route
192.168.1.0/24 dev br-lan scope link src 192.168.1.1
root@OpenWrt:~# ifconfig usb0
usb0 Link encap:Ethernet HWaddr 1A:37:x:x:x:x
inet6 addr: fe80::1837:x:x:x/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:91 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:760 (760.0 B) TX bytes:29474 (28.7 KiB)
root@OpenWrt:~# lsusb && lsusb -t
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.150 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 2c7c:0620 Quectel EM160R-GL
Bus 002 Device 001: ID 1d6b:0003 Linux 5.15.150 xhci-hcd xHCI Host Controller
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=, Driver=option, 5000M
|__ Port 1: Dev 2, If 1, Class=, Driver=option, 5000M
|__ Port 1: Dev 2, If 2, Class=, Driver=option, 5000M
|__ Port 1: Dev 2, If 3, Class=, Driver=option, 5000M
|__ Port 1: Dev 2, If 4, Class=, Driver=cdc_ether, 5000M
|__ Port 1: Dev 2, If 5, Class=, Driver=cdc_ether, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/2p, 480M
root@OpenWrt:~# cat /sys/kernel/debug/usb/devices
...
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1
P: Vendor=2c7c ProdID=0620 Rev= 4.09
S: Manufacturer=Quectel
S: Product=EM160R-GL
S: SerialNumber=xxxxxxxx
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E: Ad=88(I) Atr=03(Int.) MxPS= 16 Ivl=32ms
I: If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
root@OpenWrt:~# ls /dev/ttyUS*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
root@OpenWrt:~# picocom /dev/ttyUSB2
picocom v3.1
...
Terminal ready
AT Commands:
AT+QGMR
EM160RGLAUR02A12M4GA
OK
AT+QCFG="usbnet"
+QCFG: "usbnet",1
OK
AT+QNWPREFCFG="mode_pref"
+QNWPREFCFG: "mode_pref",AUTO
OK
AT+QNWPREFCFG="lte_band"
+QNWPREFCFG: "lte_band",1:2:3:4:5:7:8:12:13:14:17:18:19:20:25:26:28:29:30:32:38:39:40:41:42:43:46:48:66
OK
AT+QMBNCFG=?
+QMBNCFG: "List"
+QMBNCFG: "Select"[,<MBN name>]
+QMBNCFG: "Deactivate"
+QMBNCFG: "AutoSel"[,(0,1)]
+QMBNCFG: "Delete","<MBN name>"
+QMBNCFG: "Add","<filename>"
OK
OK
AT+QMBNCFG="List"
+QMBNCFG: "List",0,1,1,"ROW_Commercial",0x08010809,202009241
+QMBNCFG: "List",1,0,0,"TIM_Italy_Commercial",0x08012B00,202004261
+QMBNCFG: "List",2,0,0,"Commercial-DT-VOLTE",0x08011F1F,202112061
+QMBNCFG: "List",3,0,0,"Commercial-TMO",0x0801050F,202205061
+QMBNCFG: "List",4,0,0,"Telstra_Australia_Commercial",0x08010F00,202206021
+QMBNCFG: "List",5,0,0,"ROW_Generic_3GPP_PTCRB_GCF",0x0801FE02,201910231
+QMBNCFG: "List",6,0,0,"Wind_Italy_Commercial",0x0801F300,202203031
+QMBNCFG: "List",7,0,0,"Germany-VoLTE-Vodafone",0x08010449,202004261
+QMBNCFG: "List",8,0,0,"Swiss-Comm",0x08010411,202004261
+QMBNCFG: "List",9,0,0,"Commercial-EE",0x0801220B,202004261
+QMBNCFG: "List",10,0,0,"CDMAless-Verizon",0x08010126,202007151
+QMBNCFG: "List",11,0,0,"hVoLTE-Verizon",0x0801010E,202006091
+QMBNCFG: "List",12,0,0,"Commercial-Sprint",0x08010204,202205061
+QMBNCFG: "List",13,0,0,"FirstNet",0x08015300,202009231
+QMBNCFG: "List",14,0,0,"VoLTE-ATT",0x08010335,202001101
+QMBNCFG: "List",15,0,0,"VoLTE-CU",0x08011561,202003131
+QMBNCFG: "List",16,0,0,"VoLTE_OPNMKT_CT",0x080113E0,202004261
+QMBNCFG: "List",17,0,0,"Volte_OpenMkt-Commercial-CMCC",0x08012010,201907031
+QMBNCFG: "List",18,0,0,"Rakuten_Japan_Commercial",0x08015500,202107021
+QMBNCFG: "List",19,0,0,"Commercial-KDDI",0x08010709,202006181
+QMBNCFG: "List",20,0,0,"Commercial-DCM",0x08010D0D,202004261
+QMBNCFG: "List",21,0,0,"Commercial-SBM",0x08011C0B,201907031
OK
AT+QMBNCFG="AutoSel"
+QMBNCFG: "AutoSel",1
OK
AT+CGDCONT=1,"IPV4V6","internet.ideasclaro"
OK
AT+CGDCONT=?
+CGDCONT: (1-42),"IP",,,(0-3),(0-4),(0-1),(0-1)
+CGDCONT: (1-42),"PPP",,,(0-3),(0-4),(0-1),(0-1)
+CGDCONT: (1-42),"IPV6",,,(0-3),(0-4),(0-1),(0-1)
+CGDCONT: (1-42),"IPV4V6",,,(0-3),(0-4),(0-1),(0-1)
OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","internet.ideasclaro","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","ims","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1
OK
AT+CGPADDR
+CGPADDR: 1,"10.68.x.x,40.3.70.0.16.25.218.81.0.0.0.26.73.95.164.1"
+CGPADDR: 2,""
+CGPADDR: 3,""
OK
AT+CGCONTRDP
+CGCONTRDP: 1,5,internet.ideasclaro,10.68.x.x,40.3.70.0.16.25.218.81.0.0.0.26.73.95.164.1, 254.128.0.0.0.0.0.0.0.0.0.26.73.95.164.64,216.230.147.90 40.0.0.152.0.0.0.4.0.0.0.0.0.0.0.4,216.230.139.8 40.3.243.64.19.0.0.0.0.0.0.0.0.0.0.12
OK
AT+CGCONTRDP=1
+CGCONTRDP: 1,5,internet.ideasclaro,10.68.x.x,40.3.70.0.16.25.218.81.0.0.0.26.73.95.164.1, 254.128.0.0.0.0.0.0.0.0.0.26.73.95.164.64,216.230.147.90 40.0.0.152.0.0.0.4.0.0.0.0.0.0.0.4,216.230.139.8 40.3.243.64.19.0.0.0.0.0.0.0.0.0.0.12
OK
AT+COPS?
+COPS: 0,0,"CLARO HND LTE Claro",7
OK
AT+QNWINFO
+QNWINFO: "FDD LTE","708001","LTE BAND 4",2250
OK
AT+QENG="serving cell"
OK
AT+QCAINFO
OK
AT+CREG?
+CREG: 0,1
OK
AT+CGACT?
+CGACT: 1,1
+CGACT: 2,0
+CGACT: 3,0
OK
AT+CGACT=?
+CGACT: (0,1)
OK
AT+QIACT=1
OK
AT+QIACT?
+QIACT: 1,1,1,"10.68.x.x"
OK
AT+CPIN?
+CPIN: READY
AT+QPING=1,"www.baidu.com"
OK
AT+QPING=1,"8.8.8.8"
OK
Temporary solution
Install ModemManager, but I donât want to have this application when in ECM mode it is simple and more than enough.
The only problem I have found in ECM mode is that IPv6 addresses are not delegated, it only works in IPv4 protocol and this problem is not present in QMI and MBIM modes.
These are the settings that change when I use ModemManager in ECM mode:
root@OpenWrt:~# ip a
8: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether ca:89:x:x:x:x brd ff:ff:ff:ff:ff:ff
...
10: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 3
link/ppp
inet 10.187.x.x peer 10.64.64.64/32 scope global ppp0
valid_lft forever preferred_lft forever
inet6 fe80::89d:x:x:x/128 scope link
valid_lft forever preferred_lft forever
root@OpenWrt:~# ip route
default via 10.64.64.64 dev ppp0
10.64.64.64 dev ppp0 scope link src 10.187.x.x
192.168.1.0/24 dev br-lan scope link src 192.168.1.1
root@OpenWrt:~# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.187.x.x P-t-P:10.64.64.64 Mask:255.255.255.255
inet6 addr: fe80::89d:x:x:x/128 Scope:Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:1364 errors:0 dropped:0 overruns:0 frame:0
TX packets:2646 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:65668 (64.1 KiB) TX bytes:688363 (672.2 KiB)
root@OpenWrt:~# mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [Quectel] EM160R-GL
root@OpenWrt:~# mmcli -m 0
--------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/0
| device id: 372ac7fb1ce4dc1accb3798a55714e00f55e8d20
--------------------------------
Hardware | manufacturer: Quectel
| model: EM160R-GL
| firmware revision: EM160RGLAUR02A12M4GA
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: xxxxxxx
--------------------------------
System | device: /sys/devices/platform/1e1c0000.xhci/usb2/2-1
| physdev: /sys/devices/platform/1e1c0000.xhci/usb2/2-1
| drivers: option1, cdc_ether
| plugin: quectel
| primary port: ttyUSB2
| ports: ttyUSB2 (at), ttyUSB3 (at), usb0 (net)
--------------------------------
Status | unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)
| state: connected
| power state: on
| access tech: lte
| signal quality: 100% (recent)
--------------------------------
Modes | supported: allowed: 2g, 3g, 4g; preferred: none
| current: allowed: 2g, 3g, 4g; preferred: none
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: xxxxxxx
| operator id: 708001
| operator name: CLARO HND LTE Claro
| registration: home
| packet service state: attached
--------------------------------
3GPP EPS | ue mode of operation: csps-2
--------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0
--------------------------------
Bearer | paths: /org/freedesktop/ModemManager1/Bearer/1
Can you give me a firmware version that works with the above AT commands and does not give ERROR or some other way to make the EM160R-GL modem respond when requesting an address via DHCP in ECM mode so I donât have to use ModemManager.
I hope you can help me, thank you.
@herbert.pan-Q @Bean.Wang-Q @Great.Zheng-Q @Kerr.Yang-Q @Puck-Q @vincent.ding-Q @Stephen.Li-Q @silvia @AnnaLiu @jfrog