Skip to content
/ weather Public

Scripts used to display a weather forecast of an area on a e-ink display from Percheron Electronics, using the Gratis driver.

Notifications You must be signed in to change notification settings

dahlo/weather

Repository files navigation

Weather forecase on E-ink display

I have an e-ink display from Percheron Electronics. It seems to be similar to the PaPiRus, but I have not tried to use their software to run my display. These scripts will fetch a weather forecast from met.no Locationforecast API, create a plot of the data in a suitable size for the e-ink display and show the image on the display.

Usage

There are two scripts used; an R script to generate the forecast image, and a Python script to display the image on the e-ink display.

  1. Generate the forecast image by giving the longitude and latitude to where you want to forecast:
Rscript generate_image.r 59.857958 17.637296
  1. Display the image on the e-ink display:
python display_image.py current_weather.png

Crontab

Add the following to your crontab to update the forecast automatically:

0 * * * * cd /path/to/weather ;  Rscript generate_image.r 59.857958 17.637296 ; python display_image.py current_weather.png

The script print_ip.py is a utility to print out the assigned IPs of the computer on the e-ink display. Add this to the crontab to print it at boot time:

@reboot    cd /path/to/weather ; sleep 10 ; python print_ip.py ; sleep 5 ; python display_image.py current_weather.png

First time setup

Setup the display and drivers

The installation script from the manufacturer did not work on my newly installed Raspberry Pi OS (2023-03-14) so I had to fiddle with it a bit before I got it up and running. Have a look at the notes I made while installing for guidance if you have to do the same.

Find coordinates for forcast

Use a map service, like Google maps and find where you want to forecast the weather. If you click on a blank area on the map you will get a small box at the bottom of the map that displays the longitude and latitude of the point where you have clicked (e.g. 59.857958, 17.637296).

Install dependencies

A part from installing the drivers for the display, the python script only requires Pillow.

pip install Pillow

and the R script only needs httr and jsonlite.

install.packages(c("httr", "jsonlite"))

About

Scripts used to display a weather forecast of an area on a e-ink display from Percheron Electronics, using the Gratis driver.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published