Fatal error running AT+CGDCONT? after setting up APN

While following the guide Use cdc_ether driver based dongles for WAN connection to configure the Quectel EC200A-EL 4G modem included in the Mercusys MB130-4G V1 router, I hit a wall while setting up the APN.

I'm getting the following error when I run AT+CGDCONT? using picocom:

FATAL: read zero bytes from portterm_exitfunc: reset failed for dev UNKNOWN: Not a tty

This error only started to show after I set up the APN, as follows:

AT+CGDCONT=1,"IPV4V6","umts"

Before running the above AT command, AT+CGDCONT? worked and the output was:

+CGDCONT: 2,"IPV4V6","3gnet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,0,0
+CGDCONT: 8,"IPV4V6","IMS","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,1,1

I run picocom as picocom /dev/ttyUSB1

My setup:

ubus call system board
{
	"kernel": "6.12.50",
	"hostname": "OpenWrt",
	"system": "MediaTek MT7628AN ver:1 eco:2",
	"model": "MERCUSYS MB130-4G v1",
	"board_name": "mercusys,mb130-4g-v1",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "SNAPSHOT",
		"firmware_url": "https://downloads.openwrt.org/",
		"revision": "r31340-ea79b5875a",
		"target": "ramips/mt76x8",
		"description": "OpenWrt SNAPSHOT r31340-ea79b5875a",
		"builddate": "1759695017"
	}
}

root@OpenWrt:~# 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=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 6.12
S:  Manufacturer=Linux 6.12.50 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=101c0000.ehci
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#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=6005 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
S:  SerialNumber=0000
C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=89(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Any ideas why I'm seeing this error?

Could be a firmware issue. Try taking the modem offline with at+cfun=4 before setting the APN and bring it back with at+cfun=1 afterwards.
Please show the result of AT+QNETDEVCTL?

1 Like

Perfect! It worked as instructed. Thanks for the advice.

at+cfun=4
OK
AT+CGDCONT=1,"IPV4V6","umts"
OK
AT+CFUN=1
OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","umts","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,0,0
+CGDCONT: 2,"IPV4V6","3gnet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,0,0
+CGDCONT: 8,"IPV4V6","IMS","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0,1,1

OK

Any point to suggest an edit to the wiki page in question to add the extra set of taking the modem offline before setting up the APN? Or his this probably some Idiosyncrasy of my setup?

The result of the at command:

AT+QNETDEVCTL?
+QNETDEVCTL: 0,0,0,0

I suppose this is something related to this modem model, its firmware or even previous configuration left in NVRAM.

With all zeros the modem will not connect to the network on its own. How is the corresponding interface configured in OpenWrt?

So far I've only followed the steps up to the APN setup. As is, I only see an Ethernet Adapter: “usb0” device available to setup a new network interface, but I still need to finish the configuration steps on the wiki page guide.

See [Solved] Openwrt and EC200A-EU with NCM proto - #2 by AndrewZ

1 Like

Thanks for the tip. Your solution on the other post also worked for this router. Now:

AT+QNETDEVCTL?
+QNETDEVCTL: 3,1,0,1

Now it's time to put the router to the tests. I already notice that there seems to be a bug as the signal strength led's don’t light up. I'm also not too excited about not being able to make changes to the APN through LuCI and being limited to AT commands to do so (I tend to use a few mobile operators depending on their offerings). Might try to explore the QMI interface in contrast to ECM in the future.

I don't think your modem has this capability.

When I run AT+QCFG=? and in one of the lines I get the result +QCFG: "usbnet",(1,3)does it mean it only supports 1 (ECM) and 3 (RNDIS) and nothing else like QMI or MBIM?

That's right!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.