Needed to increase LTE/NCM modem delay after upgrade to 19.07.3

Just adding my own experience here for the benefit of anyone hitting the same problem. After upgrading my Netgear WNDR3800 from OpenWrt 17.x to 19.07.3 I noticed that my 3G/4G/LTE modem Huawei E3276 would more often fail to come up on the wwan interface after reboot:

root@router:~# ifstatus wwan
{
        "up": false,
        "pending": false,
        "available": false,
        "autostart": true,
        "dynamic": false,
        "proto": "ncm",
        "data": {

        },
        "errors": [
                {
                        "subsystem": "interface",
                        "code": "NO_DEVICE"
                }
        ]
}

The behaviour was random and on the next reboot the modem might come up.
This is what was printed in the system log when failing:

Sun Jul 19 12:08:33 2020 daemon.notice netifd: Interface 'wwan' is setting up now
Sun Jul 19 12:08:45 2020 daemon.notice netifd: wwan (1733): WARNING: Variable 'error' does not exist or is not an array/object
Sun Jul 19 12:08:45 2020 daemon.notice netifd: wwan (1733): Unsupported modem
Sun Jul 19 12:08:46 2020 daemon.notice netifd: wwan (2188): Stopping network wwan
Sun Jul 19 12:08:46 2020 daemon.notice netifd: wwan (2188): sending ->
Sun Jul 19 12:08:50 2020 daemon.notice netifd: Interface 'wwan' is now down

and this is most probably because of /lib/netifd/proto/ncm.sh getting an empty $manufacturer because of a too short $delay:

        [ -n "$delay" ] && sleep "$delay"
        manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | ...`
        [ $? -ne 0 ] && {
                ...
        }
        json_load "$(cat /etc/gcom/ncm.json)"
        json_select "$manufacturer"
        [ $? -ne 0 ] && {
                echo "Unsupported modem"
                ...
        }

I experimented with different delays in /etc/config/network and I seem to get consistent successful reboots with a delay of 40 seconds for my hardware combination:

config interface 'wwan'
        option proto 'ncm'
        option ifname 'wwan0'
        option device '/dev/cdc-wdm0'
        ...
        option delay '40'

and this is what the system log looks like when successfully bringing up the wwan interface:

Sun Jul 19 12:08:33 2020 daemon.notice netifd: Interface 'wwan' is setting up now
Sun Jul 19 12:08:46 2020 daemon.notice netifd: wwan (1738): sending -> AT
Sun Jul 19 12:08:47 2020 daemon.notice netifd: wwan (1738): sending -> ATZ
Sun Jul 19 12:08:47 2020 daemon.notice netifd: wwan (1738): sending -> ATQ0
Sun Jul 19 12:08:48 2020 daemon.notice netifd: wwan (1738): sending -> ATV1
Sun Jul 19 12:08:48 2020 daemon.notice netifd: wwan (1738): sending -> ATE1
Sun Jul 19 12:08:49 2020 daemon.notice netifd: wwan (1738): sending -> ATS0=0
Sun Jul 19 12:08:50 2020 daemon.notice netifd: wwan (1738): sending -> AT+CGDCONT=1,"IP","---hiddenapn---"
Sun Jul 19 12:08:50 2020 daemon.notice netifd: wwan (1738): Configuring modem
Sun Jul 19 12:08:50 2020 daemon.notice netifd: wwan (1738): Setting mode
Sun Jul 19 12:08:51 2020 daemon.notice netifd: wwan (1738): sending -> AT^SYSCFGEX="02",3fffffff,2,4,7fffffffffffffff,,
Sun Jul 19 12:08:52 2020 daemon.notice netifd: wwan (1738): Starting network wwan
Sun Jul 19 12:08:52 2020 daemon.notice netifd: wwan (1738): Connecting modem
Sun Jul 19 12:08:52 2020 daemon.notice netifd: wwan (1738): sending -> AT^NDISDUP=1,1,"---hiddenapn---"
Sun Jul 19 12:08:53 2020 daemon.notice netifd: wwan (1738): Setting up wwan0
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Interface 'wwan' is now up
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Network device 'wwan0' link is up
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Network alias 'wwan0' link is up
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Interface 'wwan_4' is enabled
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Interface 'wwan_4' has link connectivity
Sun Jul 19 12:08:53 2020 daemon.notice netifd: Interface 'wwan_4' is setting up now
Sun Jul 19 12:08:53 2020 user.notice firewall: Reloading firewall due to ifup of wwan (wwan0)

Previously I had the delay set to 5 seconds and at least weren't at that time aware of this problem so I encourage anyone seeing the NO_DEVICE / Unsupported modem error to experiment with longer delays in the interface settings.

(It seems at least one more person is having the same problem here)

I examined a bit further what happens when the modem fails with NO_DEVICE and it seems this is just caused by transient "error" response from the gcom call in ncm.sh. I have created a patch and pull request to deal with this situation and submitted to the project:


For me this is now bringing up my NCM modem every time, and quicker.
1 Like

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