Daily forecast | Hourly forecast | Info screen |
---|---|---|
PiWeatherRock is an internet-connected weather station. Its purpose is to display local weather conditions. It was created with the goal of having a simple way to check the weather before taking our dogs out for a walk. The end result is a modern version of a weather rock.
Right now all data is pulled from Dark Sky. A future iteration will also incorporate data from sensors connected to a battery powered Arduino.
The first thing you need to do to run this application is go to https://darksky.net/dev and get an API key. You can make up to 1,000 API calls per day without paying or even providing payment info. After getting a key, copy config.py.sample
to config.py
and fill in values for your setup. In addition to your API key you will also need your latitude and longitude. https://gps-coordinates.org/ seems to work well for this as do some cell phone apps.
Once you have your config file in place, you will need to install dependencies:
sudo apt install git vim python3-pip libsdl1.2-dev \
libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev \
libjpeg-dev libportmidi-dev libtimedate-perl
pip3 install -U -r requirements.txt
Now you should be able to run python3 weather.py
to start the program. While its running there are some keyboard shortcuts to see additional information:
- w: Displays the main weather screen
- i: Displays an info screen which contains some additional info information
- q: Quits the program
Dark Sky supports four sets of units for forecasts: ca
, si
, uk2
, and us
. The screenshots at the top of this page are with the units set to us
in the config file. Below are screenshots of the other three:
Units | Daily forecast | Hourly forecast |
---|---|---|
CA | ||
SI | ||
UK2 |
- The bulk of this project originated with the code written by Jim Kemp and published at http://www.instructables.com/id/Raspberry-Pi-Internet-Weather-Station/.
- Jim Kemp's version pulled from weather.com via pywapi but that doesn't seem seem to work any longer. This project now pulls from Weather Underground.
- Some ideas were also taken from https://github.com/sarnold/pitft-weather-display.
Almost all the icons have been replaced with ones from github.com/manifestinteractive/weather-underground-icons.
Some additional icons come from erikflowers.github.io/weather-icons. These have been converted to png files via the icons/alt_icons/generate-dark-sky-pngs.sh
script in this repository. To use the script you will need to first run pip3 install cairosvg
.
Pulled GPIOmock.py from github.com/grantwinney/52-Weeks-of-Pi to enable testing in an x86 virtual machine.