[openwrt/openwrt] uqmi: added timeout to fix hanging qmi.sh
LEDE Commits
lede-commits at lists.infradead.org
Tue Oct 3 09:51:49 PDT 2023
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/32a696f9e419ebec5b166847a16a5a45d030acbd
commit 32a696f9e419ebec5b166847a16a5a45d030acbd
Author: Uwe Niethammer <uwe at dr-niethammer.de>
AuthorDate: Sun Oct 1 12:26:51 2023 +0200
uqmi: added timeout to fix hanging qmi.sh
Modems which are using qmi do not reply on the 1st sync but they do
on subsequent. So qmi.sh is hanging on the first call. Since 2020 uqmi
supports a timeout parameter. Unfortunately qmi.sh didn't make use of
this parameter. So qmi.sh is now invoking an early dummy access to
unlock the modem
Signed-off-by: Uwe Niethammer <uwe at dr-niethammer.de>
---
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 6c5104bccd..eab7f1ea13 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -83,6 +83,8 @@ proto_qmi_setup() {
echo "Waiting for SIM initialization"
local uninitialized_timeout=0
+ # timeout 3s for first call to avoid hanging uqmi
+ uqmi -d "$device" --get-pin-status -t 3000 > /dev/null 2>&1
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
[ -e "$device" ] || return 1
if [ "$uninitialized_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then
More information about the lede-commits
mailing list