Skip to content

A small program to display weather data on a 2.13 inch epaper screen, with some monitoring

Notifications You must be signed in to change notification settings

nerstak/epaper-weather

Repository files navigation

ePaper-Weather

Description

IMG20230505162319-01

A program to display weather and other useless information you could get by looking at the window

Technologies used

Software:

  • Python3
  • Waveshare e-paper lib

Additional and optional infrastructure:

  • InfluxDB
  • Grafana

Hardware (you are not required to use the exact same one, but you'll need to adapt the program):

Minimal hardware requirements:

  • Microcontroller with:
    • GPIO
    • Ability to connect to Internet
  • Whatever e-paper screen (may require some adaptations)

Features

  • Display current weather (temperature, humidity, rain)
  • Display 24hours forecast
  • Display sunrise and sunset time
  • Display temperature and humidity from sensor (optional)
  • Log data into InfluxDB (optional)

Usage

Installation

InfluxDB

Optionally, install an InfluxDB (1.8 for 32bits RaspberryPi).

You will need to create a Database (no credential used here).

Grafana

Optionally, install Grafana.

Follow this guide from Installation part. Add a Datasource, select InfluxDB and put http://localhost:8086.

OpenWeather

Go to OpenWeather, create an account and create a key for the Professional Collection Free Tier. This tier does not require a credit card.

ePaper Weather

Download the lib folder from waveshare repository, and put it at the root of the project

config.yaml

Copy the file config.example.yaml and name the new file config.yaml. Inside, you will need to configure the following elements:

  • API_KEY: The OpenWeather key you created just before. This your personal key, it won't leave you device
  • unit: metric or imperial
  • coordinates: Coordinates of the place you want to track the weather of. Use this website for help: LatLong.net
  • refresh_period_min: How often to refresh the data or the screen in minutes (data being lower than screen will have no effect)
  • city: Name of the location of the place you are tracking the weather of. OpenWeather API does not always give a relevant city name
  • metrics: If you wish to monitor data. Set record_metrics to false or true. Set database_url and database_name to the one setup during InfluxDB installation.

Run pip install -Ur requirements.txt, sudo apt-get install libgpiod2

Service (auto-run)

Copy the file systemd/epaper-weather.example.service and name the new file systemd/epaper-weather.service. Inside, you will need to configure the following elements:

  • User: Put your own user
  • PATH_TO_PROJECT: Path of your project location
sudo cp systemd/epaper-weather.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable epaper-weather
sudo systemctl start epaper-weather

Related projects

Some projects that helped me overcome some issues:

  • inkyWeather: a similar project with Inky pHAT. I borrowed some graphical parts to speed up the development process
  • E-paper Weather Display: a similar project with a bigger screen

About

A small program to display weather data on a 2.13 inch epaper screen, with some monitoring

Topics

Resources

Stars

Watchers

Forks

Languages