Create an LED screen dashboard using a raspberry pi zero to display weather, air traffic, etc.
See it in action! https://youtu.be/gYM97AqxEqI
git clone https://github.com/brianjgreen/pi-zero-dashboard.git
cd pi-zero-dashboard/
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
Create a file for your weather api key and another file with your locations you want to find weather forecasts.
Create a test file with the name weather_api.key
with your api key generated from: https://www.worldweatheronline.com/weather-api/
Sign up for the free option with the 100/day limit.
Create a JSON file with your locations in this format:
{
"Boston": "02110",
"NewYorkCity": "10010"
}
The key (e.g. "Boston") is the name printed. The value (e.g. "02110") is the postal, zipcode, or city name using the required 'q' parameter format of the API described here: https://www.worldweatheronline.com/weather-api/api/docs/local-city-town-weather-api.aspx#qparameter
get_weather_data.py
requests the weather forecast from the API and generates a JSON file for each location
python get_weather_data.py
print_weather_data.py
reads the generated JSON files and prints the weather forecasts
python print_weather_data.py
Use these example crontabs to make occasional requests for weather forecast data and to automatically start the display of the weather forecasts to a small OLED display.
@reboot /bin/bash -c 'sleep 60 && cd /home/pi/pi-zero-dashboard && source .venv/bin/activate && python oled_weather_display.py' &
0 */8 * * * /bin/bash -c 'cd /home/pi/pi-zero-dashboard && source .venv/bin/activate && python get_weather_data.py' &