The Hardware
The Waveshare e-paper has an option that comes with a Raspberry Pi-compatible hat, and this makes it very easy to get up and going with. Stick it on a Pi with headers, and load up the right software, and you're off.
As such, the actual build here is not very complex, consisting of:
That's it! If you don't have access to a laser cutter, wood or 3D printed parts would do just as well.
The Raspberry Pi mounts onto the base piece, the e-paper mounts onto the front frame using tape (or if you're more reasonable than I, something a little stronger), and the standoffs hold everything in place. Being a Raspberry Pi, the whole thing can be powered from a single micro USB cable.
Hardware Notes
- You can use M3 standoffs if you like, just be prepared to drill out the holes on the Raspberry Pi to be a little bigger (there's plenty of room on the PCB to do this, just be careful).
- None of the standoffs I had were long enough to space the two levels out correctly, so I just threaded two of them together.
- A Raspberry Pi Zero W might seem like the perfect small form factor for this, but in my tests, it did not have enough power overhead to update the screen and immediately undervolted whenever I tried. It might work better on a smaller e-paper screen.
- The refresh rate on these screens is long. Really long. I measured it at 15 to 20 seconds in some cases (it's in the video at 10:55 if you want to see it).
The Software
I am a fan of relatively "dumb" software on devices like this, just to keep maintenance easier, and so the actual software the Raspberry Pi runs is nothing more than a script that can display images fetched from a URL. This runs using cron, pointed at an app hosted in Google Cloud Run, pulling and updating the image every 30 minutes.
The server itself is a small Flask app that pulls weather information from OpenWeather, mostly as they had a nice convenient single-call API. It renders the image for the display using Pillow, and then outputs that directly into an image for the aforementioned script to display.
The server code is a bit of a mess - please read through it suitably prepared - but it does use palletised mode in Pillow to ensure it's sending images the display can render. When the display says it's three colour - red/white/black - it means it. There's no shades of grey or red, just those three colours, so there's no chance of antialiasing. The palletised mode ensures that it renders text and curves with appropriately hard edges; the fonts don't look great as a result, but I'll get around to investing more in the fonts in future.