This is a somewhat over-engineered setup to return a bitmap image for use either a 2.0" or 2.7" PaPiRus e-link display attached to a Raspberry Pi. It fetches two sets of temperature and humidity readings from URLs given in config.json
, generates a PNG buffer with node-canvas, then generates a bitmap from there with jimp.
The file display.py
is run with URL=<URL of running papirus-image-generator> ./display.py
on the Pi that has the PaPiRus display attached and will fetch the bitmap file from above and display it. Set up a repeating cron job to run it every minute:
* * * * * URL=http://pi:3000 /home/pi/papirus-image-generator/display.py
Contains two endpoints that papirus-image-generator
expects to return the following format:
{
"temperature": 20.2,
"humidity": 45.1
}
size
— Defaults to2.7
if not specified, can be given as2.0
for the smaller-size display.invert
— Defaults to black on white if not specified, can be set totrue
to show white on black.
The font Pixellium used in this project is licensed as Creative Commons (by-nd) Attribution No Derivatives.