Unknown error from ESP during install or update

Hello,

I have recently added 2 ESPHome devices,
but a lot of times during install or update they throw unspecified errors.

Linking /data/toilet-light/.pioenvs/toilet-light/firmware.elf
RAM:   [====      ]  42.4% (used 34716 bytes from 81920 bytes)
Flash: [=====     ]  50.9% (used 520733 bytes from 1023984 bytes)
Building /data/toilet-light/.pioenvs/toilet-light/firmware.bin
esp8266_copy_factory_bin(["/data/toilet-light/.pioenvs/toilet-light/firmware.bin"], ["/data/toilet-light/.pioenvs/toilet-light/firmware.elf"])
========================= [SUCCESS] Took 48.20 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of toilet-light.local
INFO  -> 192.168.180.195
INFO Uploading /data/toilet-light/.pioenvs/toilet-light/firmware.bin (524880 bytes)
INFO Compressed to 364281 bytes
ERROR Error auth result: Unknown error from ESP
======== [ERROR] /config/esphome/toilet-light.yaml ========



======================== [SUMMARY] ========================
  - /config/esphome/bathroom-light.yaml: SUCCESS
  - /config/esphome/slimmelezer.yaml: SUCCESS
  - /config/esphome/toilet-light.yaml: FAILED

most of the times after an error the device gets unresponsive.
Now, for the first time the device keeps working.

Is there a way to find what is causing those errors, or prevent them from happening.

Try bringing it closer to the AP.

That’s not possible. Also it’s already pretty close.

Other possibility is perhaps the ota password is wrong.

Do you have the web server configured? If so you can upload new firmware in the web interface?

no that’s not it,
after this one I tried 2 times again, the 2nd one gave me a timeout, the 3rd try succeeded.
The issue here is that I sometimes need physical access to fix this,

which is not always easy.

I actually do use power_save_mode, but I think that shouldn’t be an issue, Tasmota by default applies this and with that one I never had any errors for the devices.