From: Florian Eckert Date: Wed, 21 Feb 2024 15:41:32 +0000 (+0100) Subject: modemmanager: start a 3gpp network regsistration X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=9d509b743330c3e528e58573e352e0f93302f565;p=openwrt-packages.git 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 --- diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index bdd55817a..97f8dce06 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -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 diff --git a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh index 965972683..67545513d 100644 --- a/net/modemmanager/files/lib/netifd/proto/modemmanager.sh +++ b/net/modemmanager/files/lib/netifd/proto/modemmanager.sh @@ -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