This application is a project for building a weather data display using Raspberry Pi, Waveshare e-Paper Display and RuuviTag sensors. The goal of the project is to have an e-Ink display showing:
- Current weather observations (temperature, windspeed, humidity etc.)
- 48h weather forecast
- Weather data from RuuviTag sensors
- Sunrise and sunset times
- Different twilight times: astronomical, nautical and civil dusk and dawn
- "Feels like" temperature
See a demo video on YouTube.
The current hardware:
- Raspberry Pi 3 Model B+ computer
- Waveshare 10.3" e-Paper HAT e-Ink display (also works with the similar 7.8" display)
- RuuviTag sensors
Note: This device/software is heavily customized to be used with the FMI (Finnish Meteorological Institute) Open API data which - in turn - is heavily targeted for people living in Finland. Other APIs might require extensive changes.
The image below shows the display with fake data. It was a design decision to keep the information density quite high so that one display could show as much relevant information as possible.
The development can be done on the host machine and the app can be deployed remotely using the provided scripts.
For detailed instructions on how to setup RaspberryPi and install all dependencies, please see Full Instructions. If you have Raspberry Pi up and running, skip to section Install base dependencies.
The script scripts/deploy.sh is a small helper which copies all the files over SSH to Raspberry Pi, activates venv and starts the application remotely. The script scripts/compile.sh allows compiling the shared C libraries on Raspberry Pi. The script scripts/convert.sh allows converting SVG icons to PNG format to be used by the application.
Note: Scripts won't work unless dependencies are installed.
The application shows real time weather observations and near term forecast data from the open API by FMI. The API offers accurate data updated regularly based on the given location.
RuuviTag sensors measure temperature, barometric pressure and humidity every few seconds and broadcast it using Bluetooth 5. This data is read by Raspberry Pi and further showed on the display.
The application shows sunrise and sunset times and the phase of the Moon. These are calculated using PyEphem library.
This repository contains a custom set of weather icons to be used with the application. The icon set also contains icons for showing the moon phase, RuuviTag battery charge level.
The data from FMI API includes WaWa and WeatherSymbol3 codes which can be used to show a weather icon or a description to the user. There are a lot of free weather icons or icon fonts available in the Internet but it is hard to find one which covers all the codes FMI uses. For this reason I have created a set of weather icons for this need.
The weather icon set contains a unique icon for almost all weather codes. The icons were drawn programmatically in svg. Because the PILLOW library doesn't support SVG format, the icons have to be converted to PNG images using the provided script before usage.
The icons contain night variants for some icons. The night varian is used when the observation/forecast time is determined to happen after sunset but before sunrise - commonly know as "during the night".
The prototype worked well using Waveshare 3.7" HAT display. The natural next step was to go bigger. The Waveshare 7.8" E-Ink display has a resolution of 1872 x 1404 pixels - almost 20x as much pixels as the 3.7" display has. The larger display refreshes faster (0.45 s vs 3.0 s) and supports 4-bit gray scales as opposed to 2-bit on 3.7". The larger physical size and resolution allows showing bigger digits and icons and add more information - such as rainfall and cloud amount.
The 7.8" display comes only with C code for controlling it using the BCM 2835 GPIO driver. For that reason the original 3.7" implementation has been modified to work with a library written in C for operating the display. The included shared library eInk-weather-display/lib/epd37.so handles operating the display and is called using ctypes from Python.
Support for the 7.8" eInk has been added. The shared library eInk-weather-display/lib/epd78.so manages image bit depth operations and drawing the data on 7.8" eInk display.
Running tests:
cd eInk-weather-display
python -m unittest
See the eInk-weather-display/fonts/README.md for information about fonts used in this project and their licenses.
See the files in eInk-weather-display/lib directory for their respective license info.
The licenses of C library files can be found in the files in directory clib