modemmanager: start a 3gpp network regsistration

If a 'plmn' is set in the configuration, a registration attempt should be
established before the simple-connect command. If the plmn is set during
the simple-connect, a network change may occur during the connection setup.

To prevent this, the registration is started before the simple-connect with
a separate mmcli command. So that we can be sure that the modem is already
registered in the correct network before the simple-connect command.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2024-02-21 16:41:32 +01:00
parent d839e194c5
commit 9d509b7433
2 changed files with 12 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager
PKG_SOURCE_VERSION:=1.22.0
PKG_RELEASE:=10
PKG_RELEASE:=11
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git

View File

@ -466,6 +466,17 @@ proto_modemmanager_setup() {
return 1
}
[ -z "${plmn}" ] || {
echo "starting network registraion with plmn '${plmn}'..."
mmcli --modem="${device}" \
--timeout 120 \
--3gpp-register-in-operator="${plmn}" || {
proto_notify_error "${interface}" MM_3GPP_OPERATOR_REGISTRATION_FAILED
proto_block_restart "${interface}"
return 1
}
}
if [ -z "${allowedmode}" ]; then
modemmanager_set_allowed_mode "$device" "$interface" "any"
else