I’m starting a new raspberry pi / e-ink project- it is time to do the normy old person thing and make a lil weather display.
- Python based
- Use a free weather API, no extra hardware
- Fairly simple but nice looking UI
- Color e-ink
Hardware wise, I could use my current E-Ink display as a testing grounds. If everything works well, it will be trivial to purchase the same parts again and get going.
I found this post on Reddit - looks like it is part of the “InkyPi” project. This almost perfectly fits my needs: Python, works with my current display, looks nice.
EDIT: Earlier I had a giant paragraph complaining about the prevalence of “OpenWeatherMap” - a now freemium API that a ton of these projects use, including this one. After inspecting the source code however I discovered the weather plugin supports an alternate API - Open Meteo. Looks like this more or less is what I’m asking for - free free. No need to reinvent the wheel, on to building!
Development Environment Update
Before I get started I’d like to update my development environment a bit. I’ve become quite familiar with VSCode since the last time I worked in Python and would like to swap over from using Notepad++ and it’s FTP plugin. I figure VSCode should have great support for this, so time to check it out.
I didn’t anticipate making too many changes to the code but I wanted to try the GitHub approach of forking the repo and updating the device with git pull. This ended up being incredibly easy, and now I see why so many people elect to use GitHub despite the looming Microsoft enshitification.
I am reminded of something I read recently about GitHub and privacy. You gotta opt out of AI model training - there is a setting somewhere in there. I find a certain irony in restricting AI scraping on open source code, but yeah, I dunno.
Actual software updates
OK, so this ended up being a super easy software project as InkyPi kinda just has everything I want.
Or does it? What could be better?
- It kinda has too much info. I mostly don’t care about the metrics display, but I do like some of it (sunset, for example)
- Not the easiest font to read, and the screen ended up looking a bit washed out compared to my previous e-ink projects
- 7 inch screen may be too small, but moving up to a 13 is a bit pricy for a simple device
- Anti-glare screen would be good, or no glass at all (3d printed frame?)
- Some very user specific data analysis would be funny, like calculating the best time for yard work based on temp, weather conditions, sun angle etc.
The washed out screen problem ended up being a documented quirk - for whatever reason the “Device Saturation” value is set to ‘0.5’. Counterintuitively, setting this to ‘0’ makes the screen look perfectly contrasty. This is set in the web ui - no code needed (unless you want to hard code it)
I went ahead and tackled the font and formatting problem. InkyPi renders full on HTML + CSS in a background Chromium - pretty, but damn slow on a Pi Zero. Thankfully, I only want a refresh every 10 min or so and am perfectly happy with having the thing plugged in. Anecdotally I think there are significantly better ways to do this if efficiency is a concern but I can work with this.
I futzed around a bit with the CSS to make the graph a bit thinner and the actual temp numbers larger. I thought about removing a few details to create even more room, but ultimately didn’t need to change much.
Font time
I really didn’t like the default font - the weight was simply too light for such a small display. I started digging in and adding a new font proper… but then got lazy and simply replaced the existing .ttf with my own. I elected to use “Gontserrat” - a derivative of Montserrat1 with a better capital G. I’ve been experimenting with this font in my next game, and the license looks pretty much “do whatever” - my favorite.
Honestly the edits I’ve made are super simple but in my opinion are significantly more legible. I think the main temp display may clip when we get into triple digits, so I might just remove the freedom unit indicator (realistically if it is triple digit, it better be in fahrenheit).
Inky Pi includes a “developer mode” that purportedly lets you render and display the images locally, letting you make faster edits, but for whatever reason I couldn’t get any embedded fonts to render. Considering that was one of the few changes I wanted to make and the sheer size of the InkyPi codebase I elected to simply guess and check on real hardware.
Hardware
I ordered a new Pi Zero 2 WH (pre-soldered header because laze) and a few micro sd cards as I always seem to be south on those. I’ve elected to not wipe my current photoframe OS and instead start with a brand new SD card, keeping the old install. Perhaps I’ll merge the two at some point? Like what if all the frames in the house could do all the things…? Hmm.
Likewise I temporarily decommissioned the discord photo frame to salvage it’s screen, a 7.3 inch Pimoroni Inky Impression for testing.
Initially I thought I would want a bigger screen, but after testing (and more importantly improving legibility!) I found the 7.3 inch version rather handsome. My wife and I recently updated our 3D printer to a Bambu Labs P1S, so I figured spinning up a 3d printed frame may end up functioning better than our previous “real” frame attempt. We elected to try this model - it came out fantastic and looks great on our desk.
Got it working, now what?
After putting it all together I’m rather happy with the effort. The Open Meteo data seems maybe a bit less accurate, and the forecast icons tend to… exaggerate. Yesterday there was a 10% chance of precipitation briefly - it displayed a rain icon. Yeah no. Perhaps I can take a look at that in the future? I’ll keep an eye on it and we’ll see.
I’d like to get my discord photo frame back online - perhaps we’ll upgrade it to the 13.3 inch model? Portrait orientation might be cute.
-
As a total aside, I just looked up Montserrat after seeing it not get flagged as misspelled - it is a British Caribbean Territory with a history of volcanic activity, but more interestingly to me is also a Catalan word meaning “serrated mountain”. Makes me want to use the font even more. ↩︎