ZTE MF286D modem disconnects every ~6 hours

I've recently installed openwrt 23.05.0 on a ZTE MF286D router. The modem is upgraded to the latest B012 nordic firmware.

I noticed the modem disconnects every ~6 hours and does not reconnect automatically.

I did some logging and with the uqmi tool I see the states changing. Here's just before the disconnect:

--get-data-status
"connected"
--get-current-settings
{
	"pdp-type": "ipv4",
	"ip-family": "ipv4",
	"mtu": 1500,
	"ipv4": {
		"ip": "100.100.80.35",
		"dns1": "195.130.130.141",
		"dns2": "195.130.131.141",
		"gateway": "100.100.80.36",
		"subnet": "255.255.255.248"
	},
	"ipv6": {
		
	},
	"domain-names": {
		
	}
}
--get-capabilities
{
	"max_tx_channel_rate": 50000000,
	"max_rx_channel_rate": 100000000,
	"data_service": "non_simultaneous_cs_ps",
	"sim": "supported",
	"networks": [
		"gsm",
		"umts",
		"lte",
		"unknown"
	]
}
--get-signal-info
{
	"type": "lte",
	"rssi": -79,
	"rsrq": -9,
	"rsrp": -107,
	"snr": 10.000000
}
--get-serving-system
{
	"registration": "registered",
	"plmn_mcc": 206,
	"plmn_mnc": 20,
	"plmn_description": "T�\u0013",
	"roaming": false
}

And then afterwards:

--get-data-status
"disconnected"
--get-current-settings
"Out of call"
--get-capabilities
{
	"max_tx_channel_rate": 50000000,
	"max_rx_channel_rate": 100000000,
	"data_service": "non_simultaneous_cs_ps",
	"sim": "supported",
	"networks": [
		"gsm",
		"umts",
		"lte",
		"unknown"
	]
}
--get-signal-info
{
	"type": "lte",
	"rssi": -77,
	"rsrq": -12,
	"rsrp": -107,
	"snr": 8.400000
}
--get-serving-system
{
	"registration": "registered",
	"plmn_mcc": 206,
	"plmn_mnc": 20,
	"plmn_description": "T�\u0013",
	"roaming": false
}

I just have a simple config in /etc/config/network for it:

config interface 'lte'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option pdptype 'ipv4'
        option apn 'telenetwap.be'
        option pincode '0000'
        option auth 'none'

Anyone else already encountered this? Can I gather any logs from the modem in any way?

I've seen threads here, where people say their ISPs disconnect them after X amount of time.

what's the output of

AT+CGDCONT?

AT Command Cheat Sheet:

Ustawienie APN:
AT+CGDCONT=1,"IP","internet","",0,0
AT+CGACT=1,1

Informacja o APN:
AT+CGDCONT?

Informacja o zalokowanych pci/earfcn
AT+ZCAINFO?

Informacja o primary cell:
AT+ZCELLINFO?

Lokowanie pci/earfcn:
AT+ZLOCKCELL=?
AT+ZLOCKCELL:earfcn_tag,pci_tag
AT+ZLOCKCELL? zwraca obecne lokowanie lub error gdy nie ma lokowania
AT+ZLOCKCELL=6350,307 ustawia podstawowe pasmo B20 i pci 307
a potem restart AT+CFUN=1,1

Zdjęcie lokowania pci/earfcn:
AT+ZLOCKCELL=0
a potem restart AT+CFUN=1,1

Informacja o zalokowanych bandach:
AT+ZNLOCKBAND?
+ZNLOCKBAND: 80005,2000000680380

Agregacja uplinku:
AT+ZULCA? stan
AT+ZULCA=1
AT+ZULCA=0

Lokowanie bandów:
AT+ZNLOCKBAND=1,0,1,0 - Band 1
AT+ZNLOCKBAND=1,0,4,0 - Band 3
AT+ZNLOCKBAND=1,0,40,0 - Band 7
AT+ZNLOCKBAND=1,0,80000,0 - Band 20
AT+ZNLOCKBAND=1,0,41,0 - Band B1 +B7
AT+ZNLOCKBAND=1,0,45,0 - Band B1 + B3 + B7
AT+ZNLOCKBAND=1,0,80040,0 Band 7 + 20
AT+ZNLOCKBAND=1,0,80005,0 Band 20 + 1 +3
AT+ZNLOCKBAND=1,0,2,0 - Band 2
AT+ZNLOCKBAND=1,0,10,0 - Band 5
AT+ZNLOCKBAND=1,0,80000000,0 - Band 32
AT+ZNLOCKBAND=1,0,20080800C5,0 - All
AT+ZNLOCKBAND=1,0,20880800D7,0 - All including b2,b3,b32

Restart modemu i przywrócenie pełnej funkcjonalności:
AT+CFUN=1,1

Stan modemu:
AT+CFUN?

From https://eko.one.pl/forum/viewtopic.php?pid=264279#p264279

Here it is:

~# sms_tool -D -d /dev/ttyUSB1 at "AT+CGDCONT?"
AT+CGDCONT?
+CGDCONT: 1,"IP","telenetwap.be","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","hos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 4,"IPV4V6","sos","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,1

OK

That's unfortunate. Is there any way I can trace or see any messages to confirm that that is indeed the case?

And also, right now I just have watchcat running to reboot the device when connectivity is lost for a while. Is there any more friendly AT command I can send to just reconnect?

no idea, sorry.

perhaps @andyboeh would know ... ?

Hm, mine gets disconnected regularly but the state in OpenWrt doesn't match. The following script is triggered by cron every minute to fix it:

#!/bin/sh

. /usr/share/libubox/jshn.sh

json_load "$(devstatus wwan0)"
json_get_var status up

datastatus="$(uqmi -d /dev/cdc-wdm0 --get-data-status -t 500)"

if [ "$status" = "1" ] && [ "$datastatus" = '"disconnected"' ]; then
  echo "Interface up but datastatus is disconnected - forcing reconnect"
  logger -t wwan "Interface up but datastatus is disconnected - forcing reconnect"
  ifup wwan
else
  echo "All OK"
fi

4 Likes

So I'm using a slightly modified version of @andyboeh 's script, but still it feels strange to have to trigger this manually. Is there no way to configure the modem to reconnect automatically?

Use it in a bridge mode with OEM firmware and it will reconnect automatically.

2 Likes

I have a similar issue with a ZyXEL LTE5398-M904, with exactly the same symptoms, and this script worked like a charm; many thanks!

Has anybody tried to use watchcat for this scenario?

I use watchcat with various modems. If ifup works for you to re-establish dropped connections - then this program can probably do the job on its own. If complete modem reset is needed, then watchcat should be used in a script mode and use usbreset to actually reset the modem.

1 Like

I'm actually using watchcat for this purpose. 2 watchcat configs, 1 to run the script if it can't ping for a minute, and another one to reboot if it can't ping for 15 minutes.

config watchcat
	option period '1m'
	option mode 'run_script'
	option pinghosts '8.8.8.8'
	option addressfamily 'any'
	option pingperiod '15s'
	option pingsize 'standard'
	option script '/mnt/usb/scripts/reconnect_lte.sh'

config watchcat
	option mode 'ping_reboot'
	option period '15m'
	option pinghosts '8.8.8.8'
	option addressfamily 'any'
	option pingperiod '1m'
	option pingsize 'standard'
	option forcedelay '1m'
1 Like

Well if the OEM firmware can do it, so can openwrt.

1 Like