ESP8266 and deep sleep: doesn't wake up, only red LED burning

I’m using an E-Paper ESP8266 Driver Board with an waveshare 1.54inch display: https://www.waveshare.com/wiki/E-Paper_ESP8266_Driver_Board

My ESP8266 does, what I want from it - except it won’t deep sleep as it should:

  1. it starts
  2. it loads all MQTT-information
  3. it goes to sleep
  4. after 5mins it wants to wake up, but does not
  5. instead the red LED lights up and stays there.

I can only “RESET” it or flash it with a new firmware via USB as it won’t reconnect with my Wifi then.

The YAML looks like this:

esphome:
  name: teamsepaper
  friendly_name: TeamsEpaper
  on_boot:
    priority: -100
    then:
      - wait_until:
      # waiting for valid mqtt data
          mqtt.connected:
      # Give some time 
      - component.update: current_time
      # Wait for display update cycle
      - delay: 5s
      - component.update: teamsEpaperDisplay

esp8266:
  board: nodemcuv2

# Enable logging
logger:

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

ota:
  password: "yyy"

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

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

captive_portal:

# deep sleep
deep_sleep:
  id: deepSleep5min
  run_duration: 30s
  sleep_duration: 5min

# Enable MQTT 
mqtt:
  broker: 192.168.78.18
  username: user
  password: xxx
  client_id: teamsepaper
  topic_prefix: servers/Teams
  birth_message:
    topic: servers/Teams/epaper
    payload: online
  will_message:
    topic: servers/Teams/epaper
    payload: online

# OTA MODUS
  on_message:
    - topic: servers/Teams/ota
      payload: 'ON'
      then:
        - deep_sleep.prevent: deepSleep5min
    - topic: servers/Teams/deepsleep
      payload: 'ON'
      then:
        - deep_sleep.enter: deepSleep5min

# Example configuration entry
spi:
  clk_pin: D5
  mosi_pin: D7

font:
  - file: "segoeui.ttf"
    id: textDisplay
    size: 20
    glyphs:
      ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
       '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
       'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
       'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
       'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
       'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/']           
  - file: "segoeui.ttf"
    id: textDisplayKlein
    size: 12
    glyphs:
      ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
       '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
       'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
       'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
       'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
       'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/']           
  - file: "materialdesignicons-webfont.ttf"
    id: iconsDisplay
    size: 55
    glyphs:
    # Aktivity
    - "\U000F0004" # frei
    - "\U000F0849" # im Gespräch
    # Status
    - "\U000F0133" # verfügbar
    - "\U000F0159" # beschäftigt
    - "\U000F062A" # nicht stören
    - "\U000F1443" # bin gleich zurück
    - "\U000F1A13" # abwesend
    - "\U000F015A" # offline
    - "\U000F03F6" # am Telefon
    - "\U000F0CDE" # out of office
    # Webcam
    - "\U000F05A0" # Webcam an
    - "\U000F1737" # Webcam aus

text_sensor:
    #MQTT TEAMS ACTIVITY
  - platform: mqtt_subscribe
    id: teamsActivity
    topic: servers/Teams/stateActivity
    #MQTT TEAMS STATUS
  - platform: mqtt_subscribe
    id: teamsStatus
    topic: servers/Teams/stateStatus
    #MQTT TEAMS WEBCAM
  - platform: mqtt_subscribe
    id: teamsWebcam
    topic: servers/Teams/stateWebcam
    #MQTT TEAMS ACTIVITY
  - platform: mqtt_subscribe
    id: teamsActivityText
    topic: servers/Teams/activityText
    #MQTT TEAMS STATUS
  - platform: mqtt_subscribe
    id: teamsStatusText
    topic: servers/Teams/statusText
    #MQTT TEAMS WEBCAM
  - platform: mqtt_subscribe
    id: teamsWebcamText
    topic: servers/Teams/webcamText
    #MQTT LAST UPDATE
  - platform: mqtt_subscribe
    id: dateTime
    name: "Uhrzeit"
    topic: servers/Teams/lastUpdate

time:
 - platform: sntp
   id: current_time
   timezone: Europe/Berlin
   servers : 192.168.78.1


display:
  - platform: waveshare_epaper
    id: teamsEpaperDisplay
    cs_pin: D8
    dc_pin: D2
    busy_pin: D1
    reset_pin: D4
    model: 1.54inV2
    update_interval: never
    reset_duration: 2ms

    lambda: |
      it.printf(60,0, id(textDisplay), "%s", id(teamsStatusText).state.c_str());
      it.printf(60,60, id(textDisplay), "%s", id(teamsActivityText).state.c_str());
      it.printf(60,120, id(textDisplay), "%s", id(teamsWebcamText).state.c_str());

      if (id(teamsStatusText).state == "Verfügbar") {it.print(0,0, id(iconsDisplay), "\U000F0133");}
      if (id(teamsStatusText).state == "Beschäftigt") {it.print(0,0, id(iconsDisplay), "\U000F0159");}
      if (id(teamsStatusText).state == "Nicht stören") {it.print(0,0, id(iconsDisplay), "\U000F062A");}
      if (id(teamsStatusText).state == "Bin gleich zurück") {it.print(0,0, id(iconsDisplay), "\U000F1443");}
      if (id(teamsStatusText).state == "Abwesend") {it.print(0,0, id(iconsDisplay), "\U000F1A13");}
      if (id(teamsStatusText).state == "Offline") {it.print(0,0, id(iconsDisplay), "\U000F015A");}
      if (id(teamsStatusText).state == "Am Telefon") {it.print(0,0, id(iconsDisplay), "\U000F03F6");}
      if (id(teamsStatusText).state == "out of office") {it.print(0,0, id(iconsDisplay), "\U000F0CDE");}

      if (id(teamsActivityText).state == "Nicht im Gespräch") {it.print(0,60, id(iconsDisplay), "\U000F0004");}
      if (id(teamsActivityText).state == "Im Gespräch") {it.print(0,60, id(iconsDisplay), "\U000F0849");}

      if (id(teamsWebcamText).state == "An") {it.print(0,120, id(iconsDisplay), "\U000F05A0");}
      if (id(teamsWebcamText).state == "Aus") {it.print(0,120, id(iconsDisplay), "\U000F1737");}

      it.printf(60,170, id(textDisplayKlein), "Update: %s", id(dateTime).state.c_str());

the log looks like this:

rll��|�l�|�l�b|����r�bl�b��nn�lnn���bp��lrlrl�r�n�b�nbp�rll��|�l�|�l�b|����r�b�b��nn�lnn���bp��lrlrlp�n��l��bn�|���b��nn�l��l`�nn�lnr���nrr�`p�n�r������bn�|�b��nn��l`�nn�lnr���nrl`r��nrl`��p�l`��n�l[I][logger:258]: Log initialized
[C][ota:469]: There have been 0 suspected unsuccessful boot attempts.
[I][app:029]: Running through setup()...
[C][spi:023]: Setting up SPI bus...
[C][wifi:037]: Setting up WiFi...
[C][wifi:038]:   Local MAC: C8:C9:xxx
[I][wifi:257]: WiFi Connecting to 'PL.12'...
[I][wifi:518]: WiFi Connected!
[C][wifi:362]:   Local MAC: C8:C9:xxx
[C][wifi:363]:   SSID: [redacted]
[C][wifi:364]:   IP Address: 192.168.78.240
[C][wifi:365]:   BSSID: [redacted]
[C][wifi:367]:   Hostname: 'teamsepaper'
[C][wifi:369]:   Signal strength: -48 dB ▂▄▆█
[C][wifi:373]:   Channel: 1
[C][wifi:374]:   Subnet: 255.255.255.0
[C][wifi:375]:   Gateway: 192.168.78.1
[C][wifi:376]:   DNS1: 192.168.78.11
[C][wifi:377]:   DNS2: 0.0.0.0
[D][wifi:527]: Disabling AP...
[C][ota:093]: Over-The-Air Updates:
[C][ota:094]:   Address: teamsepaper.local:8266
[C][ota:097]:   Using Password.
[C][api:025]: Setting up Home Assistant API server...
[C][mqtt:029]: Setting up MQTT...
[I][mqtt:176]: Connecting to MQTT...
[I][mqtt:216]: MQTT Connected!
[C][sntp:028]: Setting up SNTP...
[C][deep_sleep:037]: Setting up Deep Sleep...
[I][deep_sleep:042]: Scheduling Deep Sleep to start in 30000 ms
[I][app:062]: setup() finished successfully!
[I][app:102]: ESPHome version 2023.3.2 compiled on Apr  3 2023, 15:45:57
[C][wifi:504]: WiFi:
[C][wifi:362]:   Local MAC: C8:C9:xxx
[C][wifi:363]:   SSID: [redacted]
[C][wifi:364]:   IP Address: 192.168.78.240
[C][wifi:365]:   BSSID: [redacted]
[C][wifi:367]:   Hostname: 'teamsepaper'
[C][wifi:369]:   Signal strength: -50 dB ▂▄▆█
[C][wifi:373]:   Channel: 1
[C][wifi:374]:   Subnet: 255.255.255.0
[C][wifi:375]:   Gateway: 192.168.78.1
[C][wifi:376]:   DNS1: 192.168.78.11
[C][wifi:377]:   DNS2: 0.0.0.0
[D][text_sensor:067]: 'teamsActivity': Sending state '0'
[D][text_sensor:067]: 'teamsStatus': Sending state '0'
[D][text_sensor:067]: 'teamsWebcam': Sending state '0'
[D][text_sensor:067]: 'teamsActivityText': Sending state 'Nicht im Gespräch'
[D][text_sensor:067]: 'teamsWebcamText': Sending state 'Aus'
[D][text_sensor:067]: 'teamsStatusText': Sending state 'Verfügbar'
[D][text_sensor:067]: 'Uhrzeit': Sending state '15:44'
[D][sntp:077]: Synchronized time: 2023-04-03 15:54:24
[C][logger:293]: Logger:
[C][logger:294]:   Level: DEBUG
[C][logger:295]:   Log Baud Rate: 115200
[C][logger:296]:   Hardware UART: UART0
[C][spi:101]: SPI bus:
[C][spi:102]:   CLK Pin: GPIO14
[C][spi:104]:   MOSI Pin: GPIO13
[C][spi:106]:   Using HW SPI: YES
[C][waveshare_epaper:221]: Waveshare E-Paper
[C][waveshare_epaper:221]:   Rotations: 0 °
[C][waveshare_epaper:221]:   Dimensions: 200px x 200px
[C][waveshare_epaper:227]:   Model: 1.54inV2
[C][waveshare_epaper:251]:   Full Update Every: 30
[C][waveshare_epaper:252]:   Reset Pin: GPIO2
[C][waveshare_epaper:253]:   DC Pin: GPIO4
[C][waveshare_epaper:254]:   Busy Pin: GPIO5
[C][waveshare_epaper:255]:   Update Interval: never
[C][captive_portal:088]: Captive Portal:
[C][mdns:108]: mDNS:
[C][mdns:109]:   Hostname: teamsepaper
[C][ota:093]: Over-The-Air Updates:
[C][ota:094]:   Address: teamsepaper.local:8266
[C][ota:097]:   Using Password.
[C][api:138]: API Server:
[C][api:139]:   Address: teamsepaper.local:6053
[C][api:141]:   Using noise encryption: YES
[C][mqtt:065]: MQTT:
[C][mqtt:066]:   Server Address: 192.168.78.18:1883 (192.168.78.18)
[C][mqtt:068]:   Username: [redacted]
[C][mqtt:069]:   Client ID: [redacted]
[C][mqtt:071]:   Discovery prefix: 'homeassistant'
[C][mqtt:072]:   Discovery retain: YES
[C][mqtt:074]:   Topic Prefix: 'servers/Teams'
[C][mqtt:076]:   Log Topic: 'servers/Teams/debug'
[C][mqtt:079]:   Availability: 'servers/Teams/epaper'
[C][sntp:053]: SNTP Time:
[C][sntp:054]:   Server 1: '192.168.78.1'
[C][sntp:055]:   Server 2: ''
[C][sntp:056]:   Server 3: ''
[C][sntp:057]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[C][mqtt:609]: MQTT Message Trigger:
[C][mqtt:610]:   Topic: 'servers/Teams/ota'
[C][mqtt:611]:   QoS: 0
[C][mqtt:609]: MQTT Message Trigger:
[C][mqtt:610]:   Topic: 'servers/Teams/deepsleep'
[C][mqtt:611]:   QoS: 0
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsActivity'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/stateActivity
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsStatus'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/stateStatus
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsWebcam'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/stateWebcam
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsActivityText'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/activityText
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsStatusText'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/statusText
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'teamsWebcamText'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/webcamText
[C][mqtt.text_sensor:023]: MQTT Text Sensor 'Uhrzeit':
[C][mqtt.text_sensor:024]:   State Topic: 'servers/Teams/sensor/uhrzeit/state'
[C][mqtt_subscribe.text_sensor:021]: MQTT Subscribe Text Sensor 'Uhrzeit'
[C][mqtt_subscribe.text_sensor:022]:   Topic: servers/Teams/lastUpdate
[C][deep_sleep:049]: Setting up Deep Sleep...
[C][deep_sleep:052]:   Sleep Duration: 300000 ms
[C][deep_sleep:055]:   Run Duration: 30000 ms
[I][deep_sleep:116]: Beginning Deep Sleep
[I][deep_sleep:118]: Sleeping for 300000000us
[E][waveshare_epaper:119]: Timeout while displaying image!
[W][wifi_esp8266:482]: Event: Disconnected ssid='PL.12' bssid=[redacted] reason='Association Leave'

Did you connect GPIO16 to the RST pin ?

Also read the note regarding USB chips here: Deep Sleep Component — ESPHome

1 Like

Thanks. powering the ESP via 3.3V pins did the trick.

1 Like