Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tools:raspbian [2023/10/04 19:16]
darron [WiFi problems]
tools:raspbian [2023/10/05 13:16] (current)
darron [WiFi problems]
Line 271: Line 271:
 ===WiFi problems=== ===WiFi problems===
  
-At least on one setup the WiFI fails to start during boot. It seems that the interface+==Hotplug== 
 + 
 +At least on one setup the WiFi fails to start during boot. It seems that the interface
 has no name as yet or is renamed to something else then renamed back to wlan0 but after has no name as yet or is renamed to something else then renamed back to wlan0 but after
 wpa_supplicant runs which results in network failure. wpa_supplicant runs which results in network failure.
Line 288: Line 290:
 </code> </code>
  
-To solve this, either replace rc.local (see below) else configure  +To solve this configure /etc/network/interfaces using "allow-hotplug wlan0", but 
-interface using "allow-hotplug" or both.+if this also fails, replace rc.local with the following:
  
 <code> <code>
Line 303: Line 305:
 # bits. # bits.
 # #
-# By default this script does nothing. 
  
 check() { check() {
Line 324: Line 325:
 </code> </code>
  
 +==Keep alive==
 +
 +Pi4 WiFi can both disconnect with wpa_supplicant still running or crash.
 +
 +In the former case we can reconnect but in the latter a reboot is required.
 +
 +<code>
 +#! /bin/bash
 +
 +check() {
 +        LOSS=`ping -c 3 -i 1 192.168.0.1 | awk 'match($0, /[0-9]+%/) { print substr($0, RSTART, RLENGTH) }'`
 +}
 +while test 1; do
 +        sleep 30
 +        check
 +        if test "$LOSS" = "100%"; then
 +                ifdown wlan0 1>/dev/mull 2>/dev/null
 +                ifup   wlan0 1>/dev/null 2>/dev/null
 +                sleep 5
 +                check
 +                if test "$LOSS" = "100%"; then
 +                        reboot
 +                fi
 +        fi
 +done
 +</code>
 +
 +Change the IP address to that of your access point or modem.
 === Upgrade === === Upgrade ===