Raspberry Pi Zero WH with fresh copy of latest Raspberry Pi OS Lite. It is running Rhasspy voice assistant, which has a web interface. I have keyboard and HDMI connected, but wanting to run headless, so setup Wi-Fi country, SSID and password, and SSH in the raspi imager. Router assigns a predetermined DHCP address.

RasPi boots correctly and I can use Remmina (remote desktop client on my Ubuntu PC) to establish SSH connection, and use the Rhasspy web interface. It works well – except the SSH session disconnects at random, and the web interface is also unreachable for the duration.

After researching, I have disabled Power management on wlan0 by adding “iwconfig wlan0 power off” near end of /etc/rc.local, rebooted and checked that it is now off:

pi@RasPiZero-Sat-2:~ $ iwconfig

lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:"erykah"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 18:D6:C7:56:D5:64   
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=43/70  Signal level=-67 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:248  Invalid misc:0   Missed beacon:0

pi@RasPiZero-Sat-2:~ $ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 37099  bytes 77394239 (73.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 37099  bytes 77394239 (73.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fe80::8394:f1eb:ae7e:b5df  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:f8:53:31  txqueuelen 1000  (Ethernet)
        RX packets 20104  bytes 16367517 (15.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14443  bytes 2470192 (2.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@RasPiZero-Sat-2:~ $ 

It works well, in that the Wi-Fi disconnects much less frequently. Usually this is after I haven’t used the SSH session or website for a while – but sometimes it disconnects while I am active using it. Remmina and browser are unable to reconnect for a random time … and then it can connect again.

The RasPi Zero continues running, and ifconfig and iwconfig on the console show the same results. What other command can I give to check the current Wi-Fi status ?

When disconnected, remmina reports “Could not start SSH session. No route to host.”

Doing a ping to the RassPi Zero returns:

don@raspi3:~ $ ping 
PING ( 56(84) bytes of data. 
From icmp_seq=1 Destination Host Unreachable 
From icmp_seq=2 Destination Host Unreachable 
From icmp_seq=3 Destination Host Unreachable 
From icmp_seq=4 Destination Host Unreachable 
From icmp_seq=5 Destination Host Unreachable 
From icmp_seq=6 Destination Host Unreachable 
--- ping statistics ---
 7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 218ms pipe 4 
don@raspi3:~ $

Doing a ping from the RasPi Zero returns:

pi@RasPiZero-Sat-2:~ $  ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=4 ttl=64 time=1931 ms
64 bytes from icmp_seq=5 ttl=64 time=893 ms
64 bytes from icmp_seq=6 ttl=64 time=8.12 ms
64 bytes from icmp_seq=7 ttl=64 time=7.60 ms
pi@RasPiZero-Sat-2:~ $ 

… and then the Wi-Fi connection operates both ways again. The loss of icmp packets 1-3 and the massive time for the first two results suggests that the RasPi Zero is waking up the Wi-Fi connection.

Yes, I could setup a never-ending ping from the RasPi Zero – but I would rather fix the cause and prevent the Wi-Fi from going to sleep, than saturating my Wi-Fi with extra packets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.