Restrict modem (EC21) one of 3G or 4G - ModemManager 1.10.0 (Debian Buster)

Aleksander Morgado aleksander at aleksander.es
Tue Aug 18 07:43:51 UTC 2020


Hey,

See comments below.

On Tue, Aug 18, 2020 at 8:16 AM Brendan Simon (eTRIX)
<brendan.simon at etrix.com.au> wrote:
>
> I'm using a Quectel EC21 modem on a Debian Buster Linux system (using modemmanager 1.10.0).
>

Please note, MM 1.10.0 is a very very old release, no longer
supported, and it's not even the last one inthe 1.10.x series...

> I want to force it to one of 3G or 4G to stop it changing/swapping between the two.
>
> I've tried using the `mmcli -m 0 --set-allowed-modes=3g
> `.  mmcli seems happy with that.
>
> # mmcli -m 0
>   --------------------------------
>   Modes    |            supported: allowed: 3g; preferred: none
>            |                       allowed: 4g; preferred: none
>            |                       allowed: 3g, 4g; preferred: 3g
>            |                       allowed: 3g, 4g; preferred: 4g
>            |              current: allowed: 3g; preferred: none
>   --------------------------------
>
>
> and the modem connects using 3G (umts).
>
>   --------------------------------
>   Status   |                 lock: sim-pin2
>            |       unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
>            |                state: connected
>            |          power state: on
>            |          access tech: umts
>            |       signal quality: 57% (recent)
>   --------------------------------
>
>
> However, some time later it swaps over to 4G (lte)
>
>   --------------------------------
>   Status   |                 lock: sim-pin2
>            |       unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
>            |                state: connected
>            |          power state: on
>            |          access tech: lte    <<< 4G !!!
>            |       signal quality: 63% (recent)
>   --------------------------------
>
>
> Have I got the right expectations of the `--set-allowable-modes` feature?
>
> Is there something else I need to do?
>

This may be a known issue with QMI modems where the internal network
registration attempt is done with "QMI NAS Register In Network"; this
command not only registers in network, it also makes the access tech
preference fallback to "any", and MM doesn't consider that in its API.

There is a recent patch to avoid this, by avoiding the use of "NAS
Register in Network" and use "NAS Set System Selection Preference"
instead: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/commit/c70b3557184fdf1472ff0cb36e9fd937cc7f9024

That patch is not yet in any release, though, not even in 1.14.0. I'll
backport it to the 1.14.x branch so that it gets into 1.14.2.

You can confirm that this issue is happening to you by running this
command once the tech went back to the one you didn't want:
$ qmicli -d /dev/cdc-wdm0 -p --nas-get-system-selection-preference

> Does this feature work with MM 1.10.0 ?
> I did see some forum discussions about it not working and also patches, but I can't quite figure out whether that was pre or post v1.10.0.
>
> There is a backport of MM 1.14.0 which I could try.  Is a later version likely to help?
>

As said above, not for that specific patch I pointed.

> The MM changelog/news file doesn't seem to suggest there is an issue or fix.
>
> I did find this in the git commits, but not sure if it is relevant or not.
>
> policy: Use SetCurrentModes instead of SetAllowedModes
>

Not relevant, no; totally unrelated.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list