OpenWrt support for Zyxel LTE5398-M904

I looked into this a little bit and there are my findings:

  • ifup executes ubus call network.interface down and then ubus call network.interface up. in my case down takes ~2 secs and up takes ~5 secs
  • network.interface down calls proto_modemmanager_teardown() which among other things executes mmcli --modem="${device}" --disable
  • network.interface up calls proto_modemmanager_setup()

So if the connection drops the entire modem is disabled and then enabled which takes quite a bit of time. The script seems to have changed slightly in the snapshot I'm using, but as a proof of concept you could try this:

IFUP=$(ifstatus "${CFG}" | jsonfilter -e "@.up")

[ "${IFUP}" = "true" ] && {
        logger -t "modemmanager" "interface ${CFG} (network device ${INTERFACE}) ${STATE}"
        mmcli --modem="${MODEM_PATH}" -b "${BEARER_PATH}" -c &&  exit 0
        proto_init_update $INTERFACE 0
        proto_send_update $CFG
}

exit 0

Now this is super dirty, not recommended, and doesn't take care of things like IP address change but shows that MM can reconnect quickly if it doesn't disable the modem first.

1 Like