Skip to content

Commit

Permalink
Reattach modem to packet service (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
KraPete authored Dec 4, 2024
1 parent 5c5f5ba commit 028a0e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wb-utils (4.25.2) stable; urgency=medium

* Reattach modem to packet service if it was detached

-- Petr Krasnoshchekov <[email protected]> Fri, 29 Nov 2024 19:01:54 +0500

wb-utils (4.25.1) stable; urgency=medium

* install_update: trigger FR from factoryreset.original.fit only if single-rootfs is not supported here
Expand Down
11 changes: 11 additions & 0 deletions utils/bin/wb-gsm-mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash

reattach_modem_if_needed() {
if mmcli -m wbc -K | grep -qE "modem\.generic\.state.*(enabled|registered)" && \
mmcli -m wbc -K | grep -q "modem\.3gpp\.packet-service-state.*detached";
then
mmcli -m wbc --3gpp-set-packet-service-state=detached
sleep 10
mmcli -m wbc --3gpp-set-packet-service-state=attached
fi
}

watchdog() {
sleep $(($WATCHDOG_USEC / 6000000))
while true; do
Expand All @@ -10,6 +20,7 @@ watchdog() {
echo "ModemManager is running, but modem is not found"
else
systemd-notify WATCHDOG=1
reattach_modem_if_needed
fi
else
systemd-notify WATCHDOG=1
Expand Down

0 comments on commit 028a0e5

Please sign in to comment.