ESPhome: wifi scan timeout when configuring certain wave share epaper models

I have trouble getting a simple text display to run on a Wemos D1 mini.

My configuration looks like this:

esphome:
  name: display75
  platform: ESP8266
  board: d1_mini
  arduino_version: dev

wifi:
  ssid: "[redacted]"
  password: "[redacted]"

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

spi:
  clk_pin: D5
  mosi_pin: D7

display:
  - platform: waveshare_epaper
    cs_pin: D8
    dc_pin: D3
    busy_pin: D2
    reset_pin: D4
    model: 7.50in
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!");

font:
  - file: 'ubuntu-regular.ttf'
    id: font1
    size: 54    

After flashing, the wifi subsystem does not work:

esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 50:02:91:4e:74:38
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 358752 bytes to 250133...
Wrote 358752 bytes (250133 compressed) at 0x00000000 in 22.1 seconds (effective 129.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[17:53:26];l$ܟ<�$�|�d�c|����s�c�c��'o�l'g���cp��$;l;l8�g��$��#'�|l��b��gn�$��l`�\033o'd`'{���'#�lasۓoc�ad�#���p��al��o�[I][logger:116]: Log initialized
[17:53:26][C][ota:364]: There have been 9 suspected unsuccessful boot attempts.
[17:53:26][I][app:028]: Running through setup()...
[17:53:26][C][spi:084]: Setting up SPI bus...
[17:53:28][E][waveshare_epaper:054]: Timeout while displaying image!
[17:53:28][C][wifi:029]: Setting up WiFi...
[17:53:28][D][wifi:272]: Starting scan...
[17:53:59][E][wifi:280]: Scan timeout!
[17:54:05][D][wifi:272]: Starting scan...
[17:54:36][E][wifi:280]: Scan timeout!
[17:54:42][D][wifi:272]: Starting scan...
[17:55:13][E][wifi:280]: Scan timeout!
[17:55:19][D][wifi:272]: Starting scan...
[17:55:51][E][wifi:280]: Scan timeout!
[17:55:51][W][wifi:431]: Restarting WiFi adapter...
[17:55:51][W][wifi:431]: Restarting WiFi adapter...
[17:55:56][D][wifi:272]: Starting scan...
[17:56:28][E][wifi:280]: Scan timeout!
[17:56:33][D][wifi:272]: Starting scan...
[17:57:05][E][wifi:280]: Scan timeout!
[17:57:11][D][wifi:272]: Starting scan...
[17:57:42][E][wifi:280]: Scan timeout!
[17:57:48][D][wifi:272]: Starting scan...
[17:58:19][E][wifi:280]: Scan timeout!
[17:58:19][W][wifi:431]: Restarting WiFi adapter...
[17:58:19][W][wifi:431]: Restarting WiFi adapter...
[17:58:25][D][wifi:272]: Starting scan...
[17:58:27][E][wifi:104]: Can't connect to WiFi, rebooting...
[17:58:27][I][app:123]: Forcing a reboot..

However, if I change the wave share_epaper model to 2.90in, it works! (4.20in model also throws the same error):

esphome:
  name: display75
  platform: ESP8266
  board: d1_mini
  arduino_version: dev

wifi:
  ssid: "[redacted]"
  password: "[redacted]"

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

spi:
  clk_pin: D5
  mosi_pin: D7

display:
  - platform: waveshare_epaper
    cs_pin: D8
    dc_pin: D3
    busy_pin: D2
    reset_pin: D4
    model: 2.90in
    lambda: |-
      it.print(0, 0, id(font1), "Hello World!");

font:
  - file: 'ubuntu-regular.ttf'
    id: font1
    size: 54


esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 50:02:91:4e:74:38
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 374528 bytes to 257154...
Wrote 374528 bytes (257154 compressed) at 0x00000000 in 22.7 seconds (effective 131.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[19:16:03]{ld��<�d�|�l�c<ǃ��s�c�c��'o�l'g���cp��l;l;l8�g��l��#'�|l��b��gn�$��l`�\033ogd`'{���'#�la{��gc�a$�b���p��al��o�[I][logger:116]: Log initialized
[19:16:03][C][ota:364]: There have been 4 suspected unsuccessful boot attempts.
[19:16:03][I][app:028]: Running through setup()...
[19:16:03][C][spi:084]: Setting up SPI bus...
[19:16:03][C][wifi:029]: Setting up WiFi...
[19:16:04][D][wifi:272]: Starting scan...
[19:16:05][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:06][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:07][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:08][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:09][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:10][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:10][D][wifi:287]: Found networks:
[19:16:10][I][wifi:322]: - '[redacted]' [redacted]▂▄▆█
[19:16:10][D][wifi:323]:     Channel: 1
[19:16:10][D][wifi:324]:     RSSI: -36 dB
[19:16:10][I][wifi:322]: - '[redacted]' [redacted]▂▄▆█
[19:16:10][D][wifi:323]:     Channel: 11
[19:16:10][D][wifi:324]:     RSSI: -62 dB
[19:16:10][I][wifi:322]: - '[redacted]' [redacted]▂▄▆█
[19:16:10][D][wifi:323]:     Channel: 6
[19:16:10][D][wifi:324]:     RSSI: -70 dB
[19:16:10][I][wifi:322]: - '[redacted]' [redacted]▂▄▆█
[19:16:10][D][wifi:323]:     Channel: 6
[19:16:10][D][wifi:324]:     RSSI: -81 dB
[19:16:10][D][wifi:326]: - [redacted] [redacted]▂▄▆█
[19:16:10][D][wifi:326]: - [redacted] [redacted]▂▄▆█
[19:16:10][D][wifi:326]: - [redacted] [redacted]▂▄▆█
[19:16:10][D][wifi:326]: - [redacted] [redacted]▂▄▆█
[19:16:10][I][wifi:164]: WiFi Connecting to '[redacted]'...
[19:16:11][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:12][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:13][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:14][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:14][I][wifi:380]: WiFi connected!
[19:16:14][C][wifi:254]:   SSID: [redacted]
[19:16:14][C][wifi:255]:   IP Address: 192.168.86.74
[19:16:14][C][wifi:257]:   BSSID: [redacted]
[19:16:14][C][wifi:258]:   Hostname: 'display75'
[19:16:14][C][wifi:262]:   Signal strength: -41 dB ▂▄▆█
[19:16:14][C][wifi:263]:   Channel: 1
[19:16:14][C][wifi:264]:   Subnet: 255.255.255.0
[19:16:14][C][wifi:265]:   Gateway: 192.168.86.1
[19:16:14][C][wifi:266]:   DNS1: 192.168.86.1
[19:16:14][C][wifi:267]:   DNS2: (IP unset)
[19:16:15][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:15][C][ota:029]: Over-The-Air Updates:
[19:16:15][C][ota:030]:   Address: display75.local:8266
[19:16:15][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 6 restarts
[19:16:15][C][api:030]: Setting up Home Assistant API server...
[19:16:15][I][app:060]: setup() finished successfully!
[19:16:16][E][waveshare_epaper:054]: Timeout while displaying image!
[19:16:16][I][app:096]: esphome version 1.13.6 compiled on Sep 25 2019, 19:15:36
[19:16:16][C][wifi:372]: WiFi:
[19:16:16][C][wifi:254]:   SSID: [redacted]
[19:16:16][C][wifi:255]:   IP Address: 192.168.86.74
[19:16:16][C][wifi:257]:   BSSID: [redacted]
[19:16:16][C][wifi:258]:   Hostname: 'display75'
[19:16:16][C][wifi:262]:   Signal strength: -41 dB ▂▄▆█
[19:16:16][C][wifi:263]:   Channel: 1
[19:16:16][C][wifi:264]:   Subnet: 255.255.255.0
[19:16:16][C][wifi:265]:   Gateway: 192.168.86.1
[19:16:16][C][wifi:266]:   DNS1: 192.168.86.1
[19:16:17][C][wifi:267]:   DNS2: (IP unset)
1 Like

Could be this:

https://github.com/esphome/issues/issues/455

Hey Ragnar

I’ve been having exactly the same issue with a waveshare 7.5 inch display and a d1 mini board. Have tried the suggestions in the linked issue (disabling logger or removing things from config) but not any luck.

The problem definitely seems to be due to the waveshare_epaper display (after removing it from the config, wifi starts working normally). And you’re right that the wifi works after changing the display model from 7.50in to 2.90in - but then you can’t use the epaper display!

Did you ever manage to solve the problem?

I’m considering switching from a d1 mini to a different board, to see if that would make a difference. Maybe an esp32.

I abandoned this project quite some time ago. Might take it up again when I get more time on my hands, and I’ve planned to do like you, i.e. try with a different board.