Thursday, July 24, 2014

wifi monitor to troubleshoot Yun wifi

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

There are 4 things that are supposed to be configured (see

TO_PING = ""

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.


  1. hi
    please can you guide in detail on how to install this on arduino yun

  2. That depends on where you can start. The first thing to do is to download the script and put it on your arduino Yun somewhere. I assume you know how to do this? If not, maybe this can help:

    Next you need to make sure the script starts when your Yun starts:

  3. Hi Nico, I wonder according to your script what is the fastest recovery time for the wifi to be back up and running again?

    Thanks bro :)

    1. I'm planning to make my yun to send data to local database every three seconds, and i wonder how many seconds we need to restart the yun wifi once it get disconnected.