Set the RAT preference before attaching. This handles cases better,
where a network might be available but not with the preferred RAT.
If RAT is changed to a non-available RAT after attach, QMI does not fail
with missing registration but with failing to establish a PDP session.
Signed-off-by: David Bauer <mail@david-bauer.net>
uqmi -s -d "$device" --network-register > /dev/null 2>&1
+ [ -n "$modes" ] && {
+ uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1
+ sleep 3
+ # Scan network to not rely on registration-timeout after RAT change
+ uqmi -s -d "$device" --network-scan > /dev/null 2>&1
+ }
+
echo "Waiting for network registration"
sleep 5
local registration_timeout=0
return 1
done
- [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1
echo "Starting network $interface"