Hi everyone,
I wanted to share my updated fork of the epdiy library that now works with ESP-IDF 5.5.1 and the M5Stack PaperS3 on ESPHome. The original library had several compilation errors with the latest ESP-IDF version, which I’ve fixed.
What Was Fixed
ESP-IDF 5.5.1 introduced breaking changes that prevented the epdiy library from compiling:
gpio_hal_iomux_func_selremoval - Replaced with inline function usingPIN_FUNC_SELECT__DECLARE_RCC_ATOMIC_ENVmacro removal - Added compatibility shim for the removed RCC atomic environment macro- GDMA API deprecations - The old API still works but shows warnings (harmless)
All fixes maintain backward compatibility with ESP-IDF 4.x and 5.0-5.4.
Tested and Working
- ESP-IDF: 5.5.1 (also works with 4.x and 5.0-5.4)
- ESPHome: 2024.11.0+
- Hardware: M5Stack PaperS3 (ESP32-S3 with 4.7" e-paper display)
- Home Assistant: Full integration via ESPHome text entities
Repository
Quick Start Example
Here’s a minimal ESPHome configuration to get started:
esphome:
name: m5papers3
libraries:
- epidy=https://github.com/Frogy76/epdiy
external_components:
- source: github://patrick3399/esphome_components
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
version: latest # ESP-IDF 5.5.1 works!
psram:
mode: octal
speed: 80MHz
display:
- platform: ed047tc1
id: epaper_display
# M5Stack PaperS3 pin configuration
pwr_pin: GPIO45
bst_en_pin: GPIO46
xstl_pin: GPIO13
xle_pin: GPIO15
spv_pin: GPIO17
ckv_pin: GPIO18
pclk_pin: GPIO16
d0_pin: GPIO6
d1_pin: GPIO14
d2_pin: GPIO7
d3_pin: GPIO12
d4_pin: GPIO9
d5_pin: GPIO11
d6_pin: GPIO8
d7_pin: GPIO10
rotation: 90
update_interval: never
lambda: |-
it.print(240, 50, id(my_font), TextAlign::CENTER, id(line1).state.c_str());
it.print(240, 150, id(my_font), TextAlign::CENTER, id(line2).state.c_str());
font:
- file: "gfonts://Roboto"
id: my_font
size: 48
text:
- platform: template
name: "Display Line 1"
id: line1
optimistic: true
max_length: 30
on_value:
- component.update: epaper_display
- platform: template
name: "Display Line 2"
id: line2
optimistic: true
max_length: 30
on_value:
- component.update: epaper_display
Control from Home Assistant
Once the device is added to Home Assistant, you can update the display using services:
Via UI:
- Go to Developer Tools → Services
- Select
text.set_value - Choose entity:
text.display_line_1 - Enter your text
Via Automation:
service: text.set_value
target:
entity_id: text.display_line_1
data:
value: "Temperature: {{ states('sensor.living_room_temperature') }}°C"
Example Dashboard Card:
type: entities
entities:
- entity: text.display_line_1
- entity: text.display_line_2
title: E-Paper Display Control
Full Example
A complete working example with 12 text lines, touchscreen, battery monitoring, and RTC is available in the repository: papers3.yaml
Use Cases
- Information Display: Weather, calendar, to-do lists
- Sensor Dashboard: Room temperatures, energy usage
- Notifications: Doorbell alerts, delivery notifications
- Status Board: Home Assistant automation status
The e-paper display is perfect for low-power, always-visible information that doesn’t need frequent updates.
Tips
- Set
update_interval: neverand trigger updates manually viacomponent.update - Use a
system_initializedflag to prevent updates during boot - The display has excellent readability in bright light (no backlight)
- Battery life is excellent due to e-paper’s ultra-low power consumption
Hope this helps anyone trying to use M5Stack PaperS3 with the latest ESPHome/ESP-IDF!