Fix forget_wifi scan: delai 5s + rescan explicite avant scan WiFi
Apres disconnect wlan0, l'interface a besoin de temps pour etre prete a scanner. Ajout sleep 5 + nmcli wifi rescan + sleep 3 avant le scan. Log du contenu CSV pour debug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,13 +31,16 @@ else
|
||||
echo "Failed to delete connection '$ACTIVE_WIFI'"
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
sleep 5
|
||||
|
||||
# Scan WiFi networks BEFORE starting hotspot (scan impossible once hotspot is active)
|
||||
OUTPUT_FILE="/var/www/nebuleair_pro_4g/wifi_list.csv"
|
||||
echo "Scanning WiFi networks..."
|
||||
nmcli -f SSID,SIGNAL,SECURITY device wifi list | awk 'BEGIN { OFS=","; print "SSID,SIGNAL,SECURITY" } NR>1 { print $1,$2,$3 }' > "$OUTPUT_FILE"
|
||||
echo "Scanning WiFi networks (waiting for wlan0 to be ready)..."
|
||||
nmcli device wifi rescan ifname wlan0 2>/dev/null
|
||||
sleep 3
|
||||
nmcli -f SSID,SIGNAL,SECURITY device wifi list ifname wlan0 | awk 'BEGIN { OFS=","; print "SSID,SIGNAL,SECURITY" } NR>1 { print $1,$2,$3 }' > "$OUTPUT_FILE"
|
||||
echo "WiFi scan saved to $OUTPUT_FILE"
|
||||
cat "$OUTPUT_FILE"
|
||||
|
||||
# Start hotspot
|
||||
echo "Starting hotspot with SSID: $DEVICE_NAME"
|
||||
|
||||
Reference in New Issue
Block a user