2025-02-27

More with E-paper

My previous code allowed a number of settings to be stacked up to suit all sorts of needs - a clock, day of week, sunrise/sunset, and even bin collection details.

I have started a new version now, at https://github.com/revk/ESP32-EPD

This is around the idea of a stack of widgets, each placed on the frame buffer.

This would seem a simple approach - and each widget can be positioned and aligned as needed. The idea is to have at least the same functionality as before, but allow me to work on more and more widget types over time.

So the basic widgets are:-

  • image
  • text (choice of two font styles)
  • digits (i.e. 7 seg so cleaner in-situ updates on e-paper, intended for a clock)
  • QR code

But even then it is not simple - I have some content substitutions to allow display of $DATE, $TIME, $DAY, $IP, and so on. This makes a simple clock very easy to do.

Text

Whilst most of the above are simple, I have done a few extra bits - allowed multiple line text. Added some characters to 7 segment font to allow display of hexadecimal and the like, etc.

Images

Images were, however, a major change. previously I had full frame (for this 480x800) 1 bit per pixel (48000 bytes) file. Easy to make with some scripts. I also had some similar (smaller) icon files for the bin collections, but they need to know the image size to work.

I wanted more, and I wanted easier.

For a start, for E-paper, there are some more things I need from images.

  • Would be nice if image file said size so I did not have to know in advance and users would not have to make images a specific size
  • Would be nice to allow transparency, so one image on another can work without solid rectangular borders.
  • Would be nice to allow not just black/white, but black/white/red for 3 colour E-paper.

None of these work for the simple 1 bit per pixel images.

So, for that reason, I have moved totally to PNG files (as per previous blog post). I have yet to code the black/white/red, but I can now.

Masks

One change I realised I needed was a plot mode - does text plot black background and white text, or just white text, or maybe just black text, etc. So I now have invert and mask operations on all widgets. 

Seasons

The system still has a season letter E=Easter, M=FullMoon, X=Xmas, etc. And allows that season code letter in the image url, so that works.

Bins

Bins (i.e. which bins to put out next and when) are the remaining widget to re-do. PNGs for the icons will make it way easier.  No need for fixed size icons and pre-converted images.

I plan to define a simpler and clearer JSON format and implement (and document) that first, but that will be soon.

More widgets

There are a load of obvious ones to add...

  • Sunrise/set are easy as $SUNRISE/$SUNSET, I'll do that now.
  • Weather from an external weather URL, to show icon
  • Weather to show min/max temp, maybe a $MINTEMP/$MAXTEMP or something. Adding ℃ to my font may be a challenge.
  • Might be fun to add some sort of delivery tracking estimated time some how - but this means knowing tracking, and so on. Something too think about - a sign in the hall showing we expect a parcel would be really useful.
  • I did previously have an SNMP uptime thing, I could add that back.
  • Well, what else?
The nice thing is adding widgets is pretty simple with this structure, just more widget types in the config and the code to back them.

No comments:

Post a Comment

Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.

More with E-paper

My previous code allowed a number of settings to be stacked up to suit all sorts of needs - a clock, day of week, sunrise/sunset, and even b...