ESP32 Projects
Start a build
Markdown

Inkplate10 Weather Cal for ESP32

An ESP32 display project involving E-paper display, SD card.

ESP32PlatformIOUnrated
Parts and source

Before you start

Check the exact E-paper display, SD card configuration against the upstream wiring or parts list.

Upstream README

Inkplate 10 Weather Calendar

PlatformIO CI Release Server coverage Firmware coverage

The weather forecast and a map of your city, or your own photos, on an Inkplate 10 e-paper display. The display wakes a few times a day, shows a new page, and sleeps. One battery charge lasts one to two years.

The server renders five pages: today, current, hourly, daily and tomorrow. Each one shows the map at the top, or one of your own photos drawn in pencil (Pages).

Today - Dublin
Today: the current weather, a map and a summary
Tomorrow - Stockholm
Tomorrow: the forecast, with an icon and a phrase
Hourly - Reykjavik
Hourly: the next 9 hours
Daily - Lisbon
Daily: the next 5 days, with highs and lows

What you need

Part Cost Notes
Inkplate 10 ~€150 A 9.7" 1200x825 e-paper display with an ESP32, a real-time clock and battery charging. From Soldered Electronics, or in the UK from Pimoroni.
LiPo battery with a JST connector ~€10 2000 mAh lasts one to two years. Some Inkplate 10s come with a 3000 mAh battery.
CR2032 coin cell (optional) ~€1 The server sets the clock at every wake.
A server – Anything that runs Docker, or Python 3.11 or later. A Raspberry Pi Zero 2 W uses little power.
Photo frame, 8"x10" ~€10 The mount shows only the e-paper area, about 5.5"x7.5".
microSD card (optional) ~€5 A settings change then needs no new firmware. Not for an E-Radionica Inkplate 10: see the note below.

1. Set up the server

The server renders the pages and tells the display when to wake next.

  1. Choose a weather provider, and get its API key if it needs one (doc/weather-apis.md). Choose a map provider, and get its keys if it needs them (doc/maps.md).

  2. Make your config, and fill in the providers, their keys and your location:

    cp server/config.example.yaml server/config.yaml
    
  3. Start the server with Docker Compose, from the folder that holds docker-compose.yml:

    docker compose up -d
    
  • The image tag latest follows every change to the main branch. For a server that changes only at a release, use a release's tag, such as 2.1.
  • The compose file keeps the display's log lines across updates, in a volume on /app/data.
  • To run the server with docker run, or from source, and for every setting, see server/README.md.

2. Set up the display

Settings come from Firmware
From a browser the server's Settings page the server's install page
With an SD card config.yaml on the card firmware.factory.bin from a release
Without an SD card src/defaults.cpp, built into the firmware built from source

From a browser, with Chrome, Edge, Opera or Firefox:

  1. Open http://<server>:8080/settings. On the Firmware tab, turn on Offer updates, and set Folder to builds/nocard. Select Save and restart.
  2. On the Install tab, fill in the server address, as the display reaches it, and your Wi-Fi. Select Save and restart.
  3. Connect the display over USB. Select Install firmware, then Install. The browser warns about the certificate, because the server makes its own.
  4. The page writes the firmware and the settings, then checks that the display joins Wi-Fi and reaches the server.

On a computer with no such browser, install-firmware.sh does the same from a terminal: see The install page.

With an SD card:

  1. Put a config.yaml in the root of the card: see 3. Settings on the SD card.

  2. Download firmware.factory.bin from the latest release. It holds the bootloader, the partition table and the firmware.

  3. Connect the display over USB, and flash it:

    pip install esptool
    esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash 0x0 firmware.factory.bin
    

    This also clears the settings stored on the display. The card gives them back at the next start.

  4. Put the card in and start the display.

Built from source, without an SD card: copy src/defaults.example.cpp to src/defaults.cpp, fill in your Wi-Fi and server address, and build and flash the release environment: see CONTRIBUTING.md.

After the first flash, the display updates itself from the server: see Firmware updates.

E-Radionica Inkplate 10 (the older version): it cannot turn off the SD card's power in deep sleep. With a card in, it draws about 2 mA in deep sleep, not 24 µA, and the battery lasts weeks. Set it up without a card. See doc/power-consumption.md.

3. Settings on the SD card

The display reads config.yaml from the root of the card at every start. A key the file leaves out keeps the firmware's value. Without server.url, wifi.ssid and wifi.pass, the display ignores the file. doc/config.yaml explains each key.

server:
  url: http://YOUR_SERVER_HOST:8080/today.png
  retries: 3
wifi:
  ssid: YOUR_WIFI
  pass: YOUR_WIFI_PASSWORD
  connect_timeout_seconds: 10
mqtt_logger:
  enabled: false
  broker: localhost
  port: 1883
  clientId: inkplate10-weather-calendar
  prefix: mqtt/weather-cal
  retries: 3
Key Firmware value What it does
server.url http://YOUR_SERVER_HOST:8080/today.png The first page to fetch. After that, the server names the next one.
server.retries 3 How many more times to try a download or a draw that failed.
server.default_refresh_seconds 3600 How long to sleep when the server has not said.
wifi.ssid – The Wi-Fi network.
wifi.pass – The Wi-Fi password.
wifi.connect_timeout_seconds 10 How long to wait for Wi-Fi before this wake gives up.
mqtt_logger.enabled false Send the display's log lines to an MQTT broker.
mqtt_logger.broker – The broker's host name or address.
mqtt_logger.port 1883 The broker's port.
mqtt_logger.clientId inkplate10-weather-client The name the display gives the broker.
mqtt_logger.prefix mqtt/weather-cal The display logs to <prefix>/inkplate10-weather-cal.
mqtt_logger.retries 3 How many times to try the broker before this wake gives up on it.

mqtt_logger.broker, clientId and prefix come together. If the card gives only some of them, the display keeps its own three, and logs a warning.

How it works

The server does the work, so the display can sleep most of the time.

At each wake, the display:

  1. Connects to Wi-Fi, and to the MQTT broker if logging is on.
  2. Downloads its page. The answer also sets its clock and time zone, and says when to wake next.
  3. Draws the page. Unless the server offers a firmware update, Wi-Fi goes off before the panel refreshes, which is the longest step.
  4. Sleeps until the time the server gave.
  • Power: about 24 µA in deep sleep. A wake takes about 5 seconds: about a minute a day at 11 pages a day.
  • Time: the real-time clock wakes the display. The server sends the seconds to the next refresh, so the display needs no time zone rules of its own.
  • Errors: a message across the top of the last page, for example a flat battery, no Wi-Fi or a failed update. After a server failure the display backs off: 6 minutes, 18, 54, and so on, up to 24 hours. With no Wi-Fi it tries again after 2 minutes, 6, 18, 54, and then each hour.
  • Battery: each page shows the percent. From 10% the icon is empty: charge within about a month. With MQTT on, the server also sends a charge reminder.
  • Logs: with MQTT on, the server keeps the display's log lines, and answers GET /logs with them.
  • Updates: the display takes new firmware from the server, and shows a progress bar while it installs.

More documentation

Topic Doc
Every server setting, Docker, firmware updates, MQTT server/README.md
Weather provider API keys doc/weather-apis.md
Map providers and their keys doc/maps.md
Add a weather provider server/weather/README.md
Install firmware from a browser, the Settings page and the sign-in server/README.md
Show your own photos in place of the map server/README.md
Battery life and measurements doc/power-consumption.md
Build, flash and test the firmware CONTRIBUTING.md
Another e-paper display epd's custom-board guide

The firmware and the server are built on epd. This repository holds what is weather-cal's own: the order of a wake, what it draws over a page, the weather providers and the five pages.

Background

This project started from MagInkCal, which shows a Google calendar on e-paper from a Raspberry Pi Zero. An ESP32 uses far less power, and the project moved from calendar events to the weather. The same author's MagInkDash has a similar design.

License

All code in this repository is under the MIT license.

Weather icons by lutfix from www.flaticon.com.