RPi3 Auto reconnect to wifi when lost connect
Create script file
Use touch /home/pi/wifi-reconnect.sh
to create shell script file, with following content:
Or you can also use sudo wget https://raw.github.com/carry0987/Raspberry-Pi-Repo/master/Auto-WiFi-Reconnect/wifi-reconnect.sh
to download the script
Make new file executable
sudo chmod +x /home/pi/wifi-reconnect.sh
Install cron
sudo apt-get install cron
Edit crontab
Use sudo vim /etc/crontab
to edit crontab
By putting following content at end of file:
* * * * * root /home/pi/wifi-reconnect.sh
Test it by disconnecting from WiFi:
sudo ifconfig wlan0 down
Script should reestablish connection within 1 minute.
Check log file
Last updated