OpenWRT and Huawei E3372s

Hello everyone!
Can't get this LTE modem working with openwrt. I am trying to use it with NCM protocol, according to logs modem successfully connects to internet but dhcp doesn't get address for some reason.
Here is interface configuration:

config interface 'modem'
	option proto 'ncm'
	option ifname 'wwan0'
	option device '/dev/cdc-wdm0'
	option mode 'auto'
	option pdptype 'IP'
	option apn 'm.tinkoff'
	option ipv6 'auto'

Here is relevant system log:

Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.260331] usb 1-1.3: New USB device found, idVendor=12d1, idProduct=1506, bcdDevice= 1.02
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.271062] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.279542] usb 1-1.3: Product: MOBILE
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.284429] usb 1-1.3: Manufacturer: MOBILE
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.289713] usb 1-1.3: SerialNumber: 123456789ABCDEF
Mon Dec  4 15:42:54 2023 daemon.notice netifd: wan (3863): udhcpc: started, v1.36.1
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.314357] option 1-1.3:1.0: GSM modem (1-port) converter detected
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.322156] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.330732] option 1-1.3:1.1: GSM modem (1-port) converter detected
Mon Dec  4 15:42:54 2023 user.notice pbr: Reloading pbr lan interface routing due to ifup of lan (br-lan)
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.338456] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.413906] huawei_cdc_ncm 1-1.3:1.2: MAC-Address: 00:1e:10:1f:00:00
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.421399] huawei_cdc_ncm 1-1.3:1.2: setting rx_max = 16384
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.434431] huawei_cdc_ncm 1-1.3:1.2: NDP will be placed at end of frame for this device.
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.445125] huawei_cdc_ncm 1-1.3:1.2: cdc-wdm0: USB WDM device
Mon Dec  4 15:42:54 2023 kern.info kernel: [   12.453024] huawei_cdc_ncm 1-1.3:1.2 wwan0: register 'huawei_cdc_ncm' at usb-3f980000.usb-1.3, Huawei CDC NCM device, 00:1e:10:1f:00:00
Mon Dec  4 15:42:55 2023 daemon.notice netifd: Interface 'modem' is setting up now
Mon Dec  4 15:42:57 2023 daemon.notice netifd: modem (4459): sending -> AT
Mon Dec  4 15:42:57 2023 daemon.notice netifd: modem (4459): sending -> ATZ
Mon Dec  4 15:42:58 2023 daemon.notice netifd: modem (4459): sending -> ATQ0
Mon Dec  4 15:42:59 2023 daemon.notice netifd: modem (4459): sending -> ATV1
Mon Dec  4 15:42:59 2023 daemon.notice netifd: modem (4459): sending -> ATE1
Mon Dec  4 15:43:00 2023 daemon.notice netifd: modem (4459): sending -> ATS0=0
Mon Dec  4 15:43:00 2023 daemon.notice netifd: modem (4459): sending -> AT+CGDCONT=1,"IP","m.tinkoff"
Mon Dec  4 16:38:43 2023 daemon.notice netifd: modem (4459): sending -> AT^SYSCFGEX="00",3fffffff,1,2,800C5,,
Mon Dec  4 16:38:44 2023 daemon.notice netifd: modem (4459): sending -> AT^NDISDUP=1,1,"m.tinkoff"
Mon Dec  4 16:38:43 2023 daemon.notice netifd: modem (4459): Starting network modem
Mon Dec  4 16:38:43 2023 daemon.notice netifd: modem (4459): Connecting modem
Mon Dec  4 16:38:44 2023 daemon.notice netifd: modem (4459): sending -> AT^NDISDUP=1,1,"m.tinkoff"
Mon Dec  4 16:38:45 2023 daemon.notice netifd: modem (4459): Setting up wwan0
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Interface 'modem' is now up
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Network device 'wwan0' link is up
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Network alias 'wwan0' link is up
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Interface 'modem_4' is enabled
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Interface 'modem_4' has link connectivity
Mon Dec  4 16:38:45 2023 daemon.notice netifd: Interface 'modem_4' is setting up now
Mon Dec  4 16:38:45 2023 daemon.notice netifd: modem_4 (8216): udhcpc: started, v1.36.1
Mon Dec  4 16:38:45 2023 daemon.notice netifd: modem_4 (8216): udhcpc: broadcasting discover

and then nothing happens, no dhcp response.

This is what tcpdump -i wwan0 shows:

listening on wwan0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
16:48:20.317955 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:23.407982 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:26.487953 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:29.607946 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:32.697953 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:35.777959 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300
16:48:38.857952 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1e:10:1f:00:00 (oui Unknown), length 300

Any ideas why it doesn't work?

Openwrt version: OpenWrt 23.05.0 r23497-6637af95aa / LuCI openwrt-23.05 branch git-23.236.53405-fc638c8
Huawei E3372s firmware version: E3372s-153_Update_21.300.05.00.143_01.10 (stick version)

BTW, when I use proto 3g

config interface 'modem'
option proto '3g'
option ifname 'wwan0'
option device '/dev/ttyUSB0'
option service 'umts_only'
option apn 'm.tinkoff'
option dialnumber '*99#'
option ipv6 'auto'

modem successfully connects but works extremely slow

Mon Dec 4 12:02:58 2023 local2.info chat[5676]: abort on (BUSY)
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: abort on (NO CARRIER)
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: abort on (ERROR)
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: report (CONNECT)
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: timeout set to 30 seconds
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: send (AT&F^M)
Mon Dec 4 12:02:58 2023 local2.info chat[5676]: expect (OK)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: AT&F^M^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: OK
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: -- got it
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: send (ATE1^M)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: expect (OK)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: ^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: ATE1^M^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: OK
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: -- got it
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: send (AT+CGDCONT=1,"IP","m.tinkoff"^M)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: timeout set to 60 seconds
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: expect (OK)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: ^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: AT+CGDCONT=1,"IP","m.tinkoff"^M^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: OK
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: -- got it
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: send (ATD*99#^M)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: expect (CONNECT)
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: ^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: ATD*99#^M^M
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: CONNECT
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: -- got it
Mon Dec 4 12:02:59 2023 local2.info chat[5676]: send ( ^M)
Mon Dec 4 12:02:59 2023 daemon.info pppd[5675]: Serial connection established.
Mon Dec 4 12:02:59 2023 kern.info kernel: [ 22.652837] 3g-modem: renamed from ppp0
Mon Dec 4 12:02:59 2023 daemon.info pppd[5675]: Renamed interface ppp0 to 3g-modem
Mon Dec 4 12:02:59 2023 daemon.info pppd[5675]: Using interface 3g-modem
Mon Dec 4 12:02:59 2023 daemon.notice pppd[5675]: Connect: 3g-modem <--> /dev/ttyUSB0
Mon Dec 4 12:03:31 2023 daemon.warn pppd[5675]: Could not determine remote IP address: defaulting to 10.64.64.64
Mon Dec 4 12:03:31 2023 daemon.notice pppd[5675]: local IP address 100.89.170.217
Mon Dec 4 12:03:31 2023 daemon.notice pppd[5675]: remote IP address 10.64.64.64
Mon Dec 4 12:03:31 2023 daemon.notice pppd[5675]: primary DNS address 10.219.250.1
Mon Dec 4 12:03:31 2023 daemon.notice pppd[5675]: secondary DNS address 10.219.250.2
Mon Dec 4 12:03:31 2023 daemon.notice netifd: Network device '3g-modem' link is up

Please show the output of cat /sys/kernel/debug/usb/devices
and a response to AT^SETPORT?

1 Like

cat /sys/kernel/debug/usb/devices:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  6, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.134 dwc_otg_hcd
S:  Product=DWC OTG Controller
S:  SerialNumber=3f980000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=0424 ProdID=2514 Rev= b.b3
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 3
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=0424 ProdID=2514 Rev= b.b3
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=03 Prnt=03 Port=00 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=ff(vend.) Sub=00 Prot=ff MxPS=64 #Cfgs=  1
P:  Vendor=0424 ProdID=7800 Rev= 3.00
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=lan78xx
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=1ms

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  5 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1506 Rev= 1.02
S:  Manufacturer=MOBILE
S:  Product=MOBILE
S:  SerialNumber=123456789ABCDEF
C:* #Ifs= 3 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=03 Prot=10 Driver=option
E:  Ad=82(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=03 Prot=12 Driver=option
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=03 Prot=16 Driver=huawei_cdc_ncm
E:  Ad=85(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:* If#= 2 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=03 Prot=16 Driver=huawei_cdc_ncm
E:  Ad=85(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

AT^SETPORT?:

AT^SETPORT?
^SETPORT:FF;10,12,16

OK

Please try this minimalistic config:

config interface 'modem'
        option proto 'ncm'
        option device '/dev/ttyUSB1'
        option apn 'm.tinkoff'

If DHCP fails, check with these commands after "connection":

AT^NDISSTATQRY?
AT+CGPADDR
AT+CGCONTRDP
1 Like

Still no DHCP response with minimalistic config :frowning:

AT^NDISSTATQRY?
^NDISSTATQRY: 0,,,"IPV4"

OK
AT+CGPADDR
OK
AT+CGCONTRDP
+CGCONTRDP: 0,5,"m.tinkoff.mnc062.mcc250.gprs","100.77.74.245.255.255.255.252","100.77.74.246","10.219.250.1","10.219.250.2",,

OK

According to output of AT+CGCONTRDP modem itself successfully connects and gets IP address, but for some reason it doesn't propagate to openwrt interface :thinking:

What is in AT+CGDCONT? ?

1 Like
AT+CGDCONT?
+CGDCONT: 0,"IP","","",0,0,0,0
+CGDCONT: 1,"IP","m.tinkoff","",0,0,0,0

OK

Configure context 0 the same way context 1 is configured and see if it helps.

AT+CFUN=4
AT+CGDCONT=0,"IP","m.tinkoff"
AT+CFUN=1,1
1 Like
OK
AT+CFUN=4
OK
AT+CGDCONT=0,"IP","m.tinkoff"
OK
AT+CFUN=1,1
+CME ERROR: UNKNOWN

last command returns error for some reason... anyway, still no dhcp response :frowning:

You can use AT^RESET instead or just re-insert the modem.
Once modem is back after restart, recheck with AT+CGPADDR, etc.

1 Like

Don't know why, but now I started to receive this in logs :thinking:

Mon Dec  4 17:47:59 2023 daemon.notice netifd: modem (11491): sending -> AT
Mon Dec  4 17:48:00 2023 daemon.notice netifd: modem (11491): sending -> ATZ
Mon Dec  4 17:48:01 2023 daemon.notice netifd: modem (11491): sending -> ATQ0
Mon Dec  4 17:48:01 2023 daemon.notice netifd: modem (11491): sending -> ATV1
Mon Dec  4 17:48:02 2023 daemon.notice netifd: modem (11491): sending -> ATE1
Mon Dec  4 17:48:02 2023 daemon.notice netifd: modem (11491): sending -> ATS0=0
Mon Dec  4 17:48:03 2023 daemon.notice netifd: modem (11491): sending -> AT+CGDCONT=1,"IP","m.tinkoff"
Mon Dec  4 17:48:04 2023 daemon.notice netifd: modem (11491): Configuring modem
Mon Dec  4 17:48:04 2023 daemon.notice netifd: modem (11491): Starting network modem
Mon Dec  4 17:48:04 2023 daemon.notice netifd: modem (11491): Connecting modem
Mon Dec  4 17:48:04 2023 daemon.notice netifd: modem (11491): sending -> AT^NDISDUP=1,1,"m.tinkoff"
Mon Dec  4 17:48:05 2023 daemon.notice netifd: modem (11491): Error running AT-command
Mon Dec  4 17:48:05 2023 daemon.notice netifd: modem (11491): Failed to connect
Mon Dec  4 17:48:05 2023 daemon.notice netifd: modem (11750): Stopping network modem
Mon Dec  4 17:50:37 2023 daemon.notice netifd: modem (13530): WARNING: Variable '^simst:4,0' does not exist or is not an array/object
Mon Dec  4 17:50:37 2023 daemon.notice netifd: modem (13530): Unsupported modem

rebooted router several times, but nothing helps...

It looks like the connection script got some improvements recently, so add to the interface configuration:
option profile '0'
and restart the interface or the modem.

1 Like

Looks like this AT command produces error (first "0" here is value of profile, I guess)

AT^NDISDUP=0,1,"m.tinkoff
+CME ERROR: Incorrect parameters

this is why I see this in logs:

Mon Dec  4 18:08:44 2023 daemon.notice netifd: modem (4409): sending -> AT^NDISDUP=0,1,"m.tinkoff"
Mon Dec  4 18:08:45 2023 daemon.notice netifd: modem (4409): Error running AT-command
Mon Dec  4 18:08:45 2023 daemon.notice netifd: modem (4409): Failed to connect
Mon Dec  4 18:08:45 2023 daemon.notice netifd: modem (8343): Stopping network modem

I am going to reinstall openwrt from scratch and will try to configure modem again with minimalistic configuration...

Well, it looks like this command cannot operate on context 0:
^NDISDUP: (1-11),(0-1)

So you will need to remove option profile from the configuration.
I would try the following:

  • delete the NCM interface to avoid conflicts
  • bring the connection up from the terminal (using /dev/ttyUSB1) with AT^NDISDUP=1,1,"m.tinkoff" and observe the output
1 Like

Here is my config - firmware version 21.200.07.00.00:

config interface 'lte'
	option proto 'ncm'
	option pdptype 'IPV4V6'
	option ipv6 'auto'
	option peerdns '0'
	option apn 'internet'
	option username 'lte'
	option password 'lte'
	option delay '5'
	option device '/dev/cdc-wdm0'
	option mode 'preferlte'
	list dns '76.76.2.0'
	list dns '76.76.10.0'
	list dns '2606:1a40::'
	list dns '2606:1a40:1::'
	option metric '90'
	option dns_metric '90'

You can try changing the port, on some firmware revisions /dev/cdc-wdm0 is non-functional, and one of the /dev/ttyUSB* ports needs to be used.

The problem is related to context id, not the ports.
Dynamic Parameters are obtained in context 0:

This clearly proves that there is some unsolicited output on the port, which confuses OpenWrt. Thus I still propose trying on another port that doesn't get unsolicited messages by default.