wlan0 - carrier lost issue

 

I faced a wifi issue on Raspberry Pi 3 and Pi Zero when out of a sudden the wifi died. Log states: carrier lost.

Thanks to user "bls" who posted a workaround here:

https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=234058&p=1432916#p1432916

wpaping: Put this script in /usr/local/bin

#!/bin/bash
#
# Loop forever doing wpa_cli SCAN commands
#

sleeptime=120  # number of seconds to sleep. 2 minutes (120 seconds) is a good value

while [ 1 ];
do
    wpa_cli -i wlan0 scan
    sleep $sleeptime
done

wpaping.service: Put this service definition file in /lib/systemd/system

[Unit]
Description=WPA Supplicant pinger
Requires=network-online.target

[Service]
ExecStart=/usr/local/bin/wpaping
User=root
StandardInput=null
StandardOutput=null
StandardError=null
Restart=on-failure

[Install]
WantedBy=multi-user.target

Issue the following 3 commands:

systemctl daemon-reload; systemctl enable wpaping.service; systemctl start wpaping.service