Close
0%
0%

E-Ink dashboard with React serverless backend

E-Ink dashboard that displays weather, RSS, crypto/stock feeds.

Similar projects worth following
I built an E-Ink dashboard to display weather, air quality, Garmin health stats, NYT headlines, and crypto prices. This project was inspired by lmarzen's project, but instead of doing everything on the ESP32 in C++, I chose a web-based approach for (arguably) easier UI development and more flexibility.

How it works

The ESP32 end of things is rather simple. Every 30 minutes the device hits a Lambda endpoint that returns an 800x480 .bmp image, which is rendered on the e-ink screen before the ESP32 returns to deep sleep.

The Lambda function starts a headless Chromium browser that visits the web dashboard, which is built with React. The ESP32 passes basic request data to the endpoint (OW API key, lon, lat, etc.) and the web dashboard makes various API calls to gather data before rendering it for the headless browser. Once the page has rendered, the browser takes a screenshot, which the lambda encodes and returns as a 1-bit BMP.

This project was inspired by this excellent, well-documented project by lmarzen: https://hackaday.io/project/189708-esp32-e-paper-weather-display

Most of the work for this project was software rather than hardware. When I first followed lmarzen's project, I wanted to add a few extra data fields and move some elements around. I managed to add 1 field before I gave up. UI design in C++ was entirely too cumbersome for me, so instead I decided to add in 4 or 5 unrelated technologies to the stack to 'simplify' things. By making the UI a web dashboard, I could lean on all the hard work that browser devs have done for the last few decades and just mess around with CSS instead of C++, or so I thought.

I used serverless everything for this because the ESP32 is only on for 20-30 seconds out of every 30 minutes.

Technical Approach

For the hardware, I followed lmarzen's build linked above and reused much of his code for the ESP32. I added code to use the WifiManager library so that I could change settings for the display without having to reflash the device.

Dashboard design

Figma and AWS Amplify

For the UI, I used Figma for design and AWS Amplify to convert these designs into React code. This method allowed me to visually design the dashboard and then automatically generate the React code needed. Amplify advertises it as pixel-perfect transition. It's not, but it's pretty good once you get it working.

Web dashboard

Once I had the React code, I added some API calls to gather data and threw it into a free Vercel project. The dashboard runs on a free Vercel server and is scraped by a Lambda function to display on the E-Ink screen.

Using Figma made it really fast and easy to draw out different UI designs and React made integrating external APIs and libraries like Chart.js for a temperature chart much simpler than coding in C++.

Lambda

The screenshot lambda uses node.js because I need a headless browser to visit and render the dashboard. Puppeteer and Chromium fit this role.

The other lambda functions (Garmin API, RSS feeds) are in Python because I prefer it to javascript, and this project is already a strange amalgamation of tech.

Challenges and Learning

This was basically my first time using an ESP32, React, Figma, Lambda, and Amplify. The learning curve was quite steep, especially with AWS services and Figma. The connections and syntax needed to make Figma/AWS Amplify/React work together are not very well documented and again, I had no idea what I was doing, so my code was quite clunky and inelegant.

I also feel that the overall project lacks the elegance that the original e-paper weather display project has. Instead of a neatly packaged ESP32 C++ project, this project uses Figma, AWS Lambda (python and Node), AWS Amplify, and the React app is actually hosted on Vercel instead of AWS because Vercel has faster cold start times.

But it works. And with the workflow I've set up, I can create an entirely new UI in Figma and see it on the e-ink display within minutes. So at least there's that.

Next Steps

  • Publish code to github
  • Make web dashboard publicly available (bring your own screenshot service)

Done

  • 3D printing a frame or stand for the display.

TODO, maybe

  • Add dithering to handle grayscale
  • Add a rotary encoder with detents to easily switch between UIs
  • Run screenshot on a cronjob and save .bmp to S3 for faster ESP32 loading/shutdown

eink stand v2 v12.f3d

fusion360 file for the stand

fusion - 823.42 kB - 12/06/2023 at 15:36

Download

Frame v2 v8.f3d

fusion360 file for the frame

fusion - 1.01 MB - 12/06/2023 at 15:36

Download

eink stand.stl

file 1/2 for the stand

Standard Tesselated Geometry - 787.97 kB - 12/06/2023 at 15:25

Download

eink stand lid.stl

file 2/2 for the stand

Standard Tesselated Geometry - 61.51 kB - 12/06/2023 at 15:25

Download

eink frame - front.stl

file 1/4 for the frame

Standard Tesselated Geometry - 1.23 MB - 12/06/2023 at 15:26

Download

View all 8 files

  • 1 × FireBeetle 2 ESP32-E
  • 1 × Waveshare 800x480, 7.5inch E-Ink display, Black/White try to get rev2.2; rev2.3 might have issues with heavy dithering with the ESP32's low voltage
  • 1 × BME280 - Pressure, Temperature, and Humidity Sensor
  • 1 × 10000mAh LiPo Battery doesn't need to be this big; this'll probably last months before I need to recharge it

  • 3D printed frames

    dwuhls12/06/2023 at 15:36 0 comments

    I designed a couple of frames and stands for the weather station. This was my first time 3D printing and it was really fun to learn and iterate, although the wonder wore off somewhere around the 5th prototype.

    I've uploaded STLs and the fusion360 files for both the frame and the stand design. Both designs have ventilation for the BME sensor and slots to hold the ESP32, BME sensor, eink HAT, and a 10000mah battery.

    Strangely, the most satisfying part of the design for me was creating the slots for the individual components and then seeing the components slot in perfectly. The bespoke fit for each part was just *chef's kiss*


  • 3D design and solar power

    dwuhls11/21/2023 at 13:46 0 comments

    Started designing the frame/stand for the display yesterday. I haven't used CAD software in years so I'm following a series of youtube tutorials (https://www.youtube.com/playlist?list=PLrZ2zKOtC_-C4rWfapgngoe9o2-ng8ZBr) to get myself back up to speed.

    I'm hoping to make two minimalist designs, one standard frame for wall mounting and one vertical stand for a desk.

    ---

    I also saw a neat 5v/1a solar power manager yesterday that I may try to integrate so that the display can run indefinitely without being plugged in.

View all 2 project logs

Enjoy this project?

Share

Discussions

aizerin wrote 08/26/2024 at 08:03 point

Would you be so kind as to share the source code for the image processing? I'm doing something very similar, but I'm struggling with the fonts. It just doesn't look as nice as yours.

  Are you sure? yes | no

ap0l0 wrote 04/28/2024 at 16:36 point

love your work! How do you manage the wifi settings without reflashing the device?

  Are you sure? yes | no

Dan Maloney wrote 11/20/2023 at 19:36 point

Beautiful work, just love the crispness of the e-ink display. I need to build something like this too -- thanks for the inspiration!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates