Personal Weather Station & RaspberryPi – Part 3

||||| 0 Like |||||

What it does

This script will find the most recent raw file that PYWWS has produced in its data path, look for the last line and then look for the wind speed value (value 9- or counting from 0 as list arrays do – it is the 8th). Once it has found the value it will go through a check to see if it is mild, windy or gale-force. 1 light = What Wind? 3 lights = rustling the leaves 6 lights = inside out umbrellas 12 lights = inside out houses

The Code

I then add this to the Cron file so It can run as root (This is required for the GPIO ports)

This will run it every 5 minutes of every day. If you only wanted to update the lights after 10 minutes, you could use:

If there are any errors, a cron log file is created and updated with the error details to help you debug the code.

Get the code

If you want my code, you can download it straight to your Raspberry Pi

The code is now also on GitHib Gist:


Leave a Reply

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

Advertisment ad adsense adlogger