Small application written in Python 2 which displays basic forecast from API on e-Paper screen
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fonts
icons
lib
.gitignore
README.md
main.py
weather.py

README.md

Raspberry Pi Weather for Waveshare 1.54" e-Paper Screen

Small application written in Python 2 which displays basic forecast from API on e-Paper screen, including:

  • weather type icon (sun, cloudy, rain, snow, etc)
  • temperature (Celcius unit)
  • wind direction icon
  • wind speed (km/h unit)
  • pressure (hPa unit)
  • time of forecast

Installation

  1. Follow this two great tutorials about installing required packages on Raspberry Pi:

  2. Install git (optional)

sudo apt-get install git
  1. Clone this repository
git clone https://github.com/Dartui/raspberry-weather.git
  1. Change latitude and longitude in main.py
class Main:
    def __init__(self):
        self.weather = Weather(latitude, longitude)
        
        ...
  1. Run script
cd raspberry-weather
python main.py

Automatic screen updates

To automate screen updates you should add cron job to run script every hour (because of API limitations). crontab record should looks like this:

0 * * * * python /home/pi/raspberry-weather/main.py 2>&1

You can also run script on Raspberry PI startup. Because of delayed time update (about 10-15 seconds from boot) crontab record should looks like this:

@reboot sleep 20 && python /home/pi/raspberry-weather/main.py 2>&1

Forecast API

Forecast is getting from https://api.met.no/ free API. It is updated every hour.

Todo

  • add photos
  • possibility of changing current location (from CLI parameters?)
  • text position (left/right) based on text length
  • more weather type icons
  • switch between sun and moon icon based on sunrise and sunset
  • add different unit handling
  • code refactorization