Resetting Bearer on OpenWRT

Aleksander Morgado aleksander at aleksander.es
Mon Oct 15 09:12:41 UTC 2018


Hey!

> I'm running modemmanager on OpenWRT and am getting this error fairly
> regularly such as when I use AT commands to manually change LTE
> bands(is there a better way to change/lock bands than using AT
> commands?): "Bearer not allowed to connect, not registered in 3GPP
> network"
>

If you're using ModemManager, you can also use mmcli directly, e.g.
"mmcli -m 0 --set-current-bands="eutran-2|eutran-3|eutran-4"
The list of supported bands should be given in the "mmcli -m 0"
output. Changing bands, of course, will trigger a network
unregistration and re-registration, and so the device will get
unregistered in the process.

> Doing "ifup broadband" resolves the issue(at least until it loses the
> bearer again) since resetting the interface triggers
> proto_modemmanager_setup() to flush and reset the bearer but I don't
> see a way to automatically get modemmanager state change notifications
> to OpenWRT so that I can trigger the bearer reload directly from the
> modemmanger state change event. I assume that's because modemmanager
> uses dbus and OpenWRT uses ubus right? I've used a cron job as a
> workaround to monitor the bearer and issue an "ifup broadband" when
> it's lost.
>

One thing you need to consider is that, if I'm not mistaken, the
netifd integration done in OpenWRT does *not* consider automatic
reconnections. So if your modem gets disconnected due to any reason
(e.g. unregistered from the network because you changed bands in use)
then you'll need to manually trigger a reconnection (e.g. with "ifup
broadband" as you were doing). I'm sure this can be changed somehow to
autoreconnect, but didn't spend much time on that after doing the
initial MM integration in OpenWRT.

The script you're using, where you just look for the bearer state in
MM and trigger a manual interface up event in netifd if the bearer is
disconnected, is one way to have the automatic reconnection logic
working, yes :)

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list