Waveshare e-ink 4.2 - constant 'component display took a long time..'

I’ve been pulling my hair out trying to get this thing to work - I have two of them so I’ve hopefully ruled out hardware failure (both exhibit same behavior).

I’ve tried several code samples using both a D1 Mini as well as a regular esp32dev board with the same results.

This in the logs over and over:

[20:12:12][W][component:237]: Component display took a long time for an operation (134 ms).
[20:12:12][W][component:238]: Components should block for at most 30 ms.

I’ve hunted around and it seems only one other topic with this issue which is unresolved. Any ideas to steer me in the right direction here? I haven’t even begun to try to worry about what I want to display yet, just trying to get the thing working. Below is the YAML I’m using on the full esp32dev board:

esphome:
  name: dev4
  friendly_name: Dev4
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: dev

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dev4 Fallback Hotspot"
    password: "4rSWggamfl8M"

captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial
web_server:
  
# Example configuration entry
font:
  - file: 'fonts/Lato-Regular.ttf'
    id: font1
    size: 18

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23

display:
  - platform: waveshare_epaper
    id: epaperdisplay
    cs_pin: GPIO26
    dc_pin: GPIO25
    busy_pin: GPIO27
    reset_pin: GPIO33
    model: 4.20in
    update_interval: 10s
    reset_duration: 2ms
    lambda: |-
      it.print(10, 10, id(font1), "Hello World!");   

I did also on a whim try setting the model to 4.20in-bV2 and get an additional line in the output:

[20:24:43][E][waveshare_epaper:159]: Timeout while displaying image!
[20:24:43][W][component:237]: Component display took a long time for an operation (1165 ms).
[20:24:43][W][component:238]: Components should block for at most 30 ms.

Appreciate any steer!

1 Like

As I continue to dig looking at the ESPHome repository for these displays I notice it’s been quite some time since anything was updated: GitHub - soonuse/epd-library-arduino: Arduino libraries for Waveshare e-paper series I noticed an issue asking if partial refresh could be added to the support for the 4.2" screen (which it definitely does say it supports in the documentation).

I’m a bit above my depth here but is it feasible we’re starting to see some newer iterations of these displays that require updates?

Here’s the version of the board I have - note the V2 sticker

Would be great if someone who has one of these 4.2” displays working could share their version or at least if they have a V2 sticker or not

1 Like

The lines from your logs are just warnings and I think many components are hit with this warning even though it is impossible to get these solved. An e-ink takes the time an e-ink takes update.

Thanks - I wouldn’t care about the warnings if something was actually being drawn on the display… sadly I get nothing showing up.

After tons of digging around and finally getting to the point of searching for a way to submit an issue I’ve made the discovery of this: Support for 4.2in v2 display. Board is marked as Rev 2.2 by MrMDavidson · Pull Request #6209 · esphome/esphome · GitHub

If you update your code with the following lines:

external_components:
  - source: github://pr#6209
    components: [ waveshare_epaper ]

Then change the line defining the display to:

model: 4.20in-v2

The display will finally draw (the warnings go away too). Below is my full working hello world test code which hopefully helps someone else:

esphome:
  name: dev4
  friendly_name: Dev4
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: dev

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dev4 Fallback Hotspot"
    password: "4rSWggamfl8M"

captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial
web_server:
  
# Example configuration entry
font:
  - file: 'fonts/Lato-Regular.ttf'
    id: font1
    size: 18

external_components:
  - source: github://pr#6209
    components: [ waveshare_epaper ]

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23

display:
  - platform: waveshare_epaper
    id: epaperdisplay
    cs_pin: GPIO26
    dc_pin: GPIO25
    busy_pin: GPIO27
    reset_pin: GPIO33
    model: 4.20in-v2
    update_interval: 180s
    reset_duration: 2ms
    rotation: 180
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!"); 

It was a royal pain to find this, I wonder if there is a way to improve documentation with links to known issues and a recommendation to search.

3 Likes