My Yun's wifi seems to be very unstable.
I created a python script to monitor the Yun's wifi connection.
This script can be downloaded
here.
The main script is wifiMonitor.py
There are 4 things that are supposed to be configured (see wifiMonitor.py):
LOGFILE="/tmp/wifiMonitor"
LOGFILESD="/mnt/sda1/arduino/wifiMonitor_"
RESTART_WIFI_WHEN_LOST = True
TO_PING = "192.168.1.1"
The first 2 give the location of where the logs are stored: LOGFILE is the main destination, with now and then a backup to LOGFILESD.
When it sees the wifi coonection is lost, it will either:
- do nothing (just wait and hope it gets restored)
- restart the Yun's wifi
This is configured by the RESTART_WIFI_WHEN_LOST option.
To determine if the Wifi is ok, it will ping a particular site or IP address. This is set by the TO_PING option. In my case I just ping my router.
In short the script will now and then ping to TO_PING site to determine if Wifi is ok and do the appropriate action if not. It logs the ratio of ok/not_ok and the current uptime.