wifi hotspot improvements

This commit is contained in:
PaulVua
2026-01-15 16:45:47 +01:00
parent 8291475e36
commit 91a4e7c841
3 changed files with 137 additions and 19 deletions

View File

@@ -64,9 +64,18 @@ SSH_TUNNEL_PORT=$(sqlite3 /var/www/nebuleair_pro_4g/sqlite/sensors.db "SELECT va
sleep 20
# IMPORTANT: Always enable WiFi radio at boot (in case it was disabled by power save)
echo "Ensuring WiFi radio is enabled..."
nmcli radio wifi on
sleep 2
WIFI_RADIO_STATE=$(nmcli radio wifi)
echo "WiFi radio state: $WIFI_RADIO_STATE"
if [ "$WIFI_RADIO_STATE" == "disabled" ]; then
echo "WiFi radio is disabled, enabling it..."
nmcli radio wifi on
# Wait longer for NetworkManager to scan and reconnect to known networks
echo "Waiting 15 seconds for WiFi to reconnect to known networks..."
sleep 15
else
echo "WiFi radio is already enabled"
fi
# Get the connection state of wlan0
STATE=$(nmcli -g GENERAL.STATE device show wlan0)