[Solved] Raspberry Pi Wifi Disconnect Problems

Here Sometimes due to signal strength and some other issues the raspberry pi WiFi disconnects and will not reconnect automatically. Here is a script to check status of the WiFi and keep it connected.

Tip :- You can disconnect and connect wifi using   sudo ifdown wlan0 and 'sudo ifup wlan0` respectively 

Change directory to /usr/local/bin  and create file

Paste this to file

Now set permissions

Add crontab to execute it every 2 mins

Paste content below to bottom

Check whether its running by turning WiFi off and wait of 2 mins , it will be turned back on

Here is another code if you need similar using rc.local

Errors fixed by : Siddhu Arevindh

Author  : Kevin Reed


6 thoughts on “[Solved] Raspberry Pi Wifi Disconnect Problems

  1. I had to make some alterations to this to get it to work. Putting sudo in front of each instance of ifconfig, ifup and ifdown seemed to solve it. Otherwise I would get an error that each of these commands was “not found” in the output log (I directed crontab to write them to a log file instead of set up email notifications). This was even after changing permissions. After making these changes, things worked great!

Leave a Reply

Your email address will not be published. Required fields are marked *