The Quectel RG255C modem used in the Teltonika RUT976 does not support
the 'Get Serving System' QMI command, returning "Invalid QMI command".
Without this change, the script would fail even though the connection
could be established successfully.
This patch skips the registration state check if the command is not
supported and relies on subsequent checks instead.
Signed-off-by: Til Kaiser <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20933
Signed-off-by: Hauke Mehrtens <[email protected]>
echo "Waiting for network registration"
sleep 5
local registration_timeout=0
+ local serving_system=""
local registration_state=""
while true; do
- registration_state=$(uqmi -s -d "$device" -t 1000 --get-serving-system 2>/dev/null | jsonfilter -e "@.registration" 2>/dev/null)
+ serving_system="$(uqmi -s -d "$device" -t 1000 --get-serving-system 2>/dev/null)"
+ registration_state=$(echo "$serving_system" | jsonfilter -e "@.registration" 2>/dev/null)
+ [ "$serving_system" = "\"Invalid QMI command\"" ] && break
[ "$registration_state" = "registered" ] && break
if [ "$registration_state" = "searching" ] || [ "$registration_state" = "not_registered" ]; then