There's an old saying I just made up, it goes "a man has a problem. Give him a solution, now he has two problems", and that's how I felt when I came across the LilyGo T5, a beautiful e-ink display with an ESP32 microprocessor and an 18650 battery holder.
I needed to find something to make with it.
I realized that one thing that's missing from my life right now is more time pressure. I have a job, which got me most of the way there, but I'm bad at remembering the time of each of the twenty meetings I have every day. I really needed something that would allow me to see my daily calendar at a glance, and I realized that a 4.7" e-ink screen was the perfect thing for that use case, so I quickly started working on making this a reality.
The result was...
The Timeframe is a beautiful, battery-powered, high-resolution e-ink device that sits on my desk and reminds me of the inexorable grind that saps my creativity and drains me of the will to live.
It comes in a sleek, minimal white exterior, reminds you that you're selling a third of what precious little time you have on this Earth to the highest bidder, and lasts months on a single charge.
Unfortunately, my C++ skills are abysmal to nonexistent, so it was very doubtful that I could even make something like this. I'm just saying this to build up some suspense, because it's obvious from the photos that I did build it in the end, and it is glorious.
Let's see whether I managed to actually make this, which I did, and how!
How I maybe made this
When the screen arrived, my first step was to figure out how to draw things on the screen. That meant I had to do some research.
I looked into various alternatives:
- There is a custom MicroPython version that looks official. This would have been a fantastic solution to my problem, as I'm much more familiar with Python than C++. Unfortunately, when I tried it, this would fail to draw anything around 80% of the time. I never managed to find out why, so this didn't work.
- There's an e-ink library called epdiy, and it includes a very helpful and full-featured example for the LilyGo T5 that uses PlatformIO. Unfortunately, when I tried it, it had some vertical ghosting lines on the screen, which made the image look bad. The official demo that came with the display worked fine, so I knew it wasn't a problem with the display. It's a shame that this doesn't work on my display, because this library is great. I opened an issue with the developer, who confirmed that there's no issue with his T5, so maybe it's something with my display? I never found out.
- The official repository contains a working example that uses PlatformIO. It uses a customized version of epdiy that is, unfortunately, fairly old, and doesn't support all the nice things that epdiy does nowadays, but it works! It's landscape-only, and in one orientation, whereas the latest epdiy has four, but I decided to try drawing some things and seeing what happens.
Armed with a library that could, at least, change the color of some of the pixels in some ways, I then had to figure out how to actually show a calendar, or some sort of agenda there.
A man, a plan
The main alternatives I could see were two:
One option was to fetch some details from Google Calendar in some way, either fetching an ICS file directly and parsing it on-device, or writing a small proxy that would run on my server and would pre-process the file in some way. Afterwards, I would have to come up with some sort of UI (with my dismal design skills), and draw it on the device, either by drawing lines and text manually, or by using some sort of pre-drawn images and showing those for parts of the elements.
This alternative was very lightweight (it doesn't require much of a server, as most of the processing and drawing happens on the device), but it would take a lot (A LOT) of C++ code that I wasn't confident I'd be able to write, and design I wasn't confident I'd be able...Read more »