E-Ink screen experience with ESPHome?

Hi

I just bought a Waveshare 2.9" e-ink display to use with ESP. I followed the sample code supplied on ESPHome website including wiring. When I power up the whole thing nothing at all happens on display ! I have powered the display using the 3V from ESP board (after checking online doc it looks like 3V is correct for that board).
If I check ESPhome logs all I have is that:

[15:41:57][E][waveshare_epaper:054]: Timeout while displaying image!

Is the fact that screen is 3 colors instead of one (ESPHome is supposed to support only one color ones) might be the problem ? My screen is this one: https://www.aliexpress.com/item/32827638183.html?spm=a2g0s.9042311.0.0.27424c4dpmUagE

Thanks for advices, experiences :wink:

Vincèn

The very first paragraph says:

Currently only single-color E-Ink displays are implemented and of those only a few modules.

Yep but still had secret hope it might work in just one default color but it looks like not :frowning:

I implemented partial support for Waveshare 2.90in type (B) black-white-red display in ESPHome pull request #889. It does not render red color yet - as multi-color display support has to be added to underlying ESPHome display bus, if I understood ESPHome author correctly. You can display B/W text, images, etc. though.

On an additional note (as I’ve seen many reports about Waveshare display not working on Wemos D1 minis) - please observe the ESP8266 boot modes when hooking a Waveshare display to Wemos D1 mini. Using “reserved” PINs D3, D4 and D8 incorrectly may cause ESP to boot into programming mode or not boot at all. Please check https://community.home-assistant.io/t/solved-cant-get-waveshare-display-to-work/135974 for details. I personally am using ESP deep sleep and have found the following combination to work as well, leaving PIN D0 available for deep sleep wake up:

  clk_pin: D5
  mosi_pin: D7
  cs_pin: D3
  dc_pin: D6
  busy_pin: D2
  reset_pin: D1
2 Likes

Sounds great, can’t wait to see it integrated into the code :slight_smile:

Sorry for hijacking this thread but my 4.2in display behaves strange…

the display keeps flashing and inverting the text

made a video:

https://cloud.0x711.de/index.php/s/WEZjt4oWQRLninE

any help is highly appreciated!

esphome code is here:

substitutions:
  devicename: esp32_6

esphome:
  name: $devicename
  platform: ESP32
  board: lolin32


wifi:
  ssid: !secret ssid_iot
  password: !secret password_iot
  fast_connect: on
  manual_ip:
    static_ip: 192.168.0.115
    gateway: !secret gateway
    subnet: 255.255.255.0


logger:
  level: DEBUG

api:
  password: !secret password

ota:
  password: !secret password

spi:
  clk_pin: 15
  mosi_pin: 2

font:
  - file: 'arial.ttf' #'slkscr.ttf'
    id: font1
    size: 12
    glyphs: '!\"%()+,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzß'

  - file: 'BebasNeue-Regular.ttf'
    id: font2
    size: 48

  - file: 'arial.ttf'
    id: font3
    size: 18

  - file: 'arial.ttf'
    id: font4
    size: 14

  - file: 'arial.ttf'
    id: font5
    size: 48
  - file: 'arial.ttf'
    id: font6
    size: 32


display:
  - platform: waveshare_epaper
    cs_pin: 0
    dc_pin: 4
    reset_pin: 16
    busy_pin: 17
    model: 4.20in
    update_interval: 5s
    lambda: |-
      it.print(50, 50, id(font2), "Test 1 2 3 4 5 6 7");
      it.print(50, 150, id(font2), "Test 1 2 3 4 5 6 7");
      it.print(50, 250, id(font2), "Test 1 2 3 4 5 6 7");







web_server:
  port: 80

switch:
  - platform: restart
    name: "${devicename} restart"
  - platform: shutdown
    name: "${devicename} shutdown"

log output here:

INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.0.115 using esphome API
INFO Connecting to 192.168.0.115:6053 (192.168.0.115)
INFO Successfully connected to 192.168.0.115
[03:57:27][I][app:100]: ESPHome version 1.14.3 compiled on Dec 18 2019, 03:56:55
[03:57:27][C][wifi:415]: WiFi:
[03:57:27][C][wifi:283]:   SSID: 'erisnet_iot'
[03:57:27][C][wifi:284]:   IP Address: 192.168.0.115
[03:57:27][C][wifi:286]:   BSSID: B6:FB:E4:11:4E:DB
[03:57:27][C][wifi:287]:   Hostname: 'esp32_6'
[03:57:27][C][wifi:291]:   Signal strength: -44 dB ▂▄▆█
[03:57:27][C][wifi:295]:   Channel: 6
[03:57:27][C][wifi:296]:   Subnet: 255.255.255.0
[03:57:27][C][wifi:297]:   Gateway: 192.168.0.1
[03:57:27][C][wifi:298]:   DNS1: 0.0.0.0
[03:57:27][C][wifi:299]:   DNS2: 0.0.0.0
[03:57:27][C][spi:079]: SPI bus:
[03:57:27][C][spi:080]:   CLK Pin: GPIO15 (Mode: OUTPUT)
[03:57:27][C][spi:082]:   MOSI Pin: GPIO2 (Mode: OUTPUT)
[03:57:27][C][spi:083]:   Using HW SPI: YES
[03:57:27][C][logger:175]: Logger:
[03:57:27][C][logger:176]:   Level: DEBUG
[03:57:27][C][logger:177]:   Log Baud Rate: 115200
[03:57:27][C][logger:178]:   Hardware UART: UART0
[03:57:27][C][restart:021]: Restart Switch 'esp32_6 restart'
[03:57:27][C][restart:021]:   Icon: 'mdi:restart'
[03:57:27][C][shutdown.switch:010]: Shutdown Switch 'esp32_6 shutdown'
[03:57:27][C][shutdown.switch:010]:   Icon: 'mdi:power'
[03:57:27][C][waveshare_epaper:540]: Waveshare E-Paper
[03:57:27][C][waveshare_epaper:540]:   Rotations: 0 °
[03:57:27][C][waveshare_epaper:540]:   Dimensions: 400px x 300px
[03:57:27][C][waveshare_epaper:541]:   Model: 4.2in
[03:57:27][C][waveshare_epaper:542]:   Reset Pin: GPIO16 (Mode: OUTPUT)
[03:57:27][C][waveshare_epaper:543]:   DC Pin: GPIO4 (Mode: OUTPUT)
[03:57:27][C][waveshare_epaper:544]:   Busy Pin: GPIO17 (Mode: INPUT)
[03:57:27][C][waveshare_epaper:545]:   Update Interval: 5.0s
[03:57:27][C][web_server:122]: Web Server:
[03:57:27][C][web_server:123]:   Address: 192.168.0.115:80
[03:57:27][C][ota:029]: Over-The-Air Updates:
[03:57:27][C][ota:030]:   Address: 192.168.0.115:3232
[03:57:27][C][ota:032]:   Using Password.
[03:57:27][C][api:095]: API Server:
[03:57:27][C][api:096]:   Address: 192.168.0.115:6053

Just started playing around with the 4.2in myself. I get the same flickering which is due to the update_interval.

I think this is more like a refresh to remove artifacts rather than telling the display to change data so try setting it much higher.
I’ve only done a static Hello World to prove the hardware works so can’t confirm whether it’ll refresh from HA states immediately or wait for the update_interval. I plan to do more during the holidays.

Please open a new thread instead of hijacking an existing one :rage: As stated by @codechimp your refresh is too low ! as indicated in documentation on ESPHome website use by default 30s and you’ll see it working fine !

Thank you very much for your work
i just tested it on the beta branch of ESPHome and it works :smiley:

Is there any way to use the Partial refresh of the E-Paper display?
also the “full_update_every” attribute is not supported for the “model: 2.90in-b” you added.
Is that a bug or is there a specific reason for it?

Unhappy the e-Paper support is very partial in ESPHome right now :frowning: Partial refresh among other things is not supported yet :frowning:I checked the new beta of ESPHome but still no progress on that part !

AFAIK it’s (still) only specific 2 color e-paper displays that supports partial refresh ?
The partial refresh has to be supported by the display firmware.

Is anybody is using the black-white-red displays? I have big problem using the 2.9in (b) display in my setup.

Did you manage to get your 2.9b working? I bought mine a few days ago and:

  • it works with the original Waveshare ESP32 Driver Board when I upload their Demo
  • it doesn’t work with any other ESP32 board, even with their demo uploaded
  • it doesn’t work with ESPHome, even on their ESP32 Driver Board
    My config for ESPHome:
spi:
  clk_pin: GPIO13
  mosi_pin: GPIO14
#  miso_pin: GPIO12 #not connected for using external SPI

display:
  - platform: waveshare_epaper
    id: eink_display
    cs_pin: GPIO15
    dc_pin: GPIO27
    busy_pin:
      number: GPIO25
#      inverted: true
    reset_pin: GPIO26
    reset_duration: 2ms
    model: 2.90in-b
    update_interval: 30s
    # rotation: 90°
    # auto_clear_enabled: false
    lambda: |-

Did you find a solution to get it working with normal ESP ?

i have the same and it does not work

i have the 2.9in with red black and white

Unfortunately, I didn’t.
I looked into waveshare_epaper.cpp and, in my opinion, the “initialize” method contains wrong sequence of data being sent to the device. I think I’ll create an issue at the ESPHome project. According to the document https://www.waveshare.com/w/upload/b/bb/2.9inch-e-paper-b-specification.pdf, I tried to change the init sequence and compile it, but it didn’t help. Maybe I’m still missing something.

I’ve been unable to get my 2.9" black/white/red WeAct ePaper module (see here on AliExpress) working with ESPHome. Even just in black/white mode (I tried “model: 2.90in-b” and all the others). It’s frustrating, because it very nearly works: black text displays clearly, but the “red” colour is overlaid and the whole display keeps blinking and refreshing endlessly. It’s connected to an ESP32-C3.

ePaper

My conclusion is not to use the displays with red because the refresh time of 20 seconds is just too long vs 5s for the black and white versions. But it would be nice if HA supported them.

If there’s anything else to try, please let me know!

Configuration here;

esphome:
  name: adam2
  friendly_name: adam2

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "1234"

ota:
  - platform: esphome
    password: "1234"

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

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

captive_portal:

font:
  - file:
      type: gfonts
      family: Roboto
    id: roboto_20
    size: 20
    extras: # Need to manually add support for the dollar symbol $
      - file: "gfonts://Roboto"
        glyphs: [$]

  - file:
      type: gfonts
      family: Roboto
    id: roboto_10
    size: 10

  - file: 'fonts/materialdesignicons-webfont.ttf'
    id:  mdi_wifi
    size: 20
    glyphs: [
      # Wifi
      '󰤫', # mdi-wifi-strength-alert-outline
      '󰤟', # mdi-wifi-strength-1
      '󰤢', # mdi-wifi-strength-2
      '󰤥', # mdi-wifi-strength-3
      '󰤨'  # mdi-wifi-strength-4

      ]

time:
  - platform: homeassistant
    id: homeassistant_time

# Add the sensor from Home Assistant
sensor:
  - platform: homeassistant
    entity_id: sensor.exchange_rate_1_btc
    id: bitcoin_price

  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    id: wifisignal
    update_interval: 60s

spi:
  clk_pin: 4       # SCK (SPI Clock) / SCL / CLK on the board - Green / Yellow
  mosi_pin: 6      # MOSI (SPI Data Input) / SDA / DIN on the board - Yellow / Blue

display:
  - platform: waveshare_epaper
    model: 2.90inV2
    cs_pin: 7        # CS (Chip Select) - Blue / Orange
    dc_pin: 1        # D/C (Data/Command) - White / Green
    busy_pin: 3      # BUSY (Busy signal) - Purple / Purple
    reset_pin: 2     # RES (Reset) - Orange / White
    rotation: 270
    full_update_every: 1
    update_interval: 30s
    id: adam_epaper1
    lambda: |-
      ESP_LOGD("display", "Printing bitcoin price");
      if (!isnan(id(bitcoin_price).state)) {
        it.printf(10, 20, id(roboto_20), TextAlign::BASELINE_LEFT, "Bitcoin price: $%.0f", id(bitcoin_price).state);
      } else {
        it.printf(10, 20, id(roboto_20), TextAlign::BASELINE_LEFT, "Bitcoin price unavailable");
      }

      /* FOOTER */
      it.strftime(200, 100, id(roboto_10), TextAlign::BASELINE_RIGHT , "Updated %H:%M %d/%b/%Y", id(homeassistant_time).now());
      
      /* WiFi Signal Strength */
      if(id(wifisignal).has_state()) {
        int x = 260;
        int y = 110;
        if (id(wifisignal).state >= -50) {
            //Excellent
            it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤨");
            ESP_LOGI("WiFi", "Exellent");
        } else if (id(wifisignal).state  >= -60) {
            //Good
            it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤥");
            ESP_LOGI("WiFi", "Good");
        } else if (id(wifisignal).state  >= -75) {
            //Fair
            it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤢");
            ESP_LOGI("WiFi", "Fair");
        } else if (id(wifisignal).state  >= -100) {
            //Weak
            it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤟");
            ESP_LOGI("WiFi", "Weak");
        } else {
            //Unlikely working signal
            it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤫");
            ESP_LOGI("WiFi", "Unlikely");
        }
      }