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):
RESTART_WIFI_WHEN_LOST = True
TO_PING = "192.168.1.1"
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.