ESP32 ePaper loosing wifi connection about every minute (seems to depend on screen update)

Hi,
I am using a Waveshare ESP32 to get my Waveshare 7.5in display running. I am trying to do a room sign that shows if/when the room is taken.

My problem ist, that the ESP is loosing the connection about evry minute after start, and “occasionally” comes back, which leads to new Screen Updates.

The Wifi hotspot and the ESP are literally 90cm away from each other (as I am still testing). Wifi Signal is -51 dB

The following things puzzle me:

1.) Every time the display is updated, it takes too long. I am relatively sure, that this is becaus the epaper is slow, but I want to be sure. Warning looks like this:

[10:53:34][W][component:237]: Component esphome.coroutine took a long time for an operation (3126 ms).
[10:53:34][W][component:238]: Components should block for at most 30 ms.

2.) To me it “feels” as if the ESP is getting slower, and the wifi losses are because of too less CPU power.

Has anyone an ESP32 ePaper driver directly connected to a waveshare 7.5 (V3) and send “a few” data to the display.

3.) How can I see what is eating up memory and/or CPU on the ESP, to debug a little further?

4.) I am doing OTA updates without any problems ever. So I really dount that it is the “regular” wifi connection, but wifi is getting bad, iif ESP is running.

5.) As is happens every minute (and when I switched it to every 3 minutes, the problem occured every 3 minutes) I stronly believe this routine is somehow wrong… but I honestly have no clue what is wrong:
(I try to update the screen only if there is new data and if the Helper-Switch in HA is “on”)

# Check whether the display needs to be refreshed every minute,
# based on whether new data is received or epaper. (Thanks @paviro!)
time:
  - platform: homeassistant
    id: homeassistant_time
    on_time:
      - seconds: 0
        minutes: /3
        then:
          - if:
              condition:
                lambda: 'return id(data_updated) == true;'
              then:
                - logger.log: "return ID Data true"
                - if:
                    condition:
                      binary_sensor.is_on: update_epaper_display
                    then:
                      - logger.log: "Sensor data updated and e Paper Update wanted: Refreshing display..."
                      - script.execute: update_screen
                    else:
                      - logger.log: "Sensor data updated but no ePaper Update wanted. Do nothing."
                      - logger.log: 
                          format: "Update ePaper >%s<"
                          args: [ 'id(update_epaper_display).state' ] 
              else:
#                - logger.log: "No sensors updated - skipping display refresh."
                - logger.log: 
                    format: "##### Update ePaper >%s<"
                    args: [ 'id(update_epaper_display).state' ] 

Any help very apprechiated.

Thank you
Juergen

HI,
ok. I think I got it.

I changed the platform from “homeassistant” to “sntp”.

I assume that with platform homeassistant the system tries a connect during screen refresh to HA, which takes to much CPU and time.

But as all the data seems to “fly in” by other asyncronus tasks, using the sntp for a regular check is the way to go.

But as this is only a guess from a very old man, can someone with more clue tell me if this is right or wrong.

thank you
Juergen