Cannot OTA update esphome device


I’m trying to OTA update an esphome device ESP32, but for somehow all I’m trying fails

========================= [SUCCESS] Took 20.36 seconds =========================
INFO Successfully compiled program.
INFO Connecting to
INFO Uploading /data/build/garage-voor-light/.pioenvs/garage-voor-light/firmware.bin (1021344 bytes)
Uploading: [====                                                        ] 6% 
ERROR Error sending data: [Errno 104] Connection reset by peer

that leaves me with 4 options

  • garage-voor-light.bin
  • garage-voor-light-factory.bin
  • garage-voor-light.bin.gz
  • garage-voor-light-factory.bin.gz
    via the webinterface
    both gz and the factory.bin return Update Failed: Wrong Magic Byte
    and the other one, lagacy format
    causes the network connection to be reset

    so no luck there,

my device was originally flashed with tasmota, then I updated to ESPHome arduino,
which was fine, I needed to use legacy format then, but now I’m unable to update again.

are there any other ways to OTA flash my device without needing a physical connection?

edit: also when I try to flash back tasmota the connection gets reset.

edit2: I found

probably it’s the same issue,
but I was always able to migrate tasmota to esphome before without any update issues afterwards, I migrated at least 15 devices before.
and now this one, the first one I dared to update which is hidden in a junction box has this issue.

I really hope there is another solution

That looks like either a dodgy wifi connection or power issues when the wifi on the ESP gets hammered.

I think your only solution is to update it by connecting to it physically, or move a temporary wireless access point close to it.

Did you try already to reboot into safe mode before starting the OTA update? For me that always worked even with devices with (very) weak wifi signal.

that was my first guess, but the esphome dashboard alsways shows somewhere between 5 to 7%. the esphome logging itself alsways shows 0.1%
with dodgy wifi, I can normally always use the webinterface now I cannot.

I read somewhere that Tasmota changes the partition table which esphome can’t handle well. So that might be the issue and I have to serial flash one time.
I will do that another time because in my garage it’s now 5C and I like it warmer while working on the junction box.

I can’t, I need to enable this button first and therefor I have to flash. but just to be sure I added it to the yaml, so next time I can try.

but wifi actually is really steady.

I highly suggest this. It’s in all my yamls and I even (when possible) have it available on a physical button press (like keep it pressed for 10 seconds).

Other option, do you have a fallback ap configured? They also allow OTA? Maybe worth a try. Also you might want to share your yaml just in case some brain finds a loophole!

I will try the give the app approach a try, I have this configured in my base

  id: wifiId
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # power_save_mode: NONE
  power_save_mode: HIGH
  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "${device_name}"
    password: !secret wifi_password


# Enable logging
    key: !secret api_encryption_key
  reboot_timeout: 0s

  safe_mode: true
  reboot_timeout: 3min
  num_attempts: 3
  password: !secret ota_password

  port: 80
  # js_url: https://<mydomain>:8123/local/esphome/v2/www.js
  local: true
    username: admin
    password: !secret web_server_password

  - platform: restart
    name: "${device_name} switch Restart"
    icon: "mdi:restart"
  - platform: safe_mode
    name: "${device_name} Restart (Safe Mode)"
    icon: "mdi:restart-alert"

this is the base for all my devices, I just added safe_mode so I cannot use that one atm.
but I actually think the issue is with this

most devices I flashed from tasmota to esphome were initially flashed using tasmota 10 or 11.
this device probably was serial flashed using tasmota 12.
which means instead of 2 partiations there is a safeboot partition. I cannot find how esphome works with the partition table exept from that it’s different for arduino and esp-idf
but I actually think esphome OTA update cannot handle this tasmota partition scheme. and therefor it fails.

1 Like

Dang! Tasmota makes the life hard even for the ones that left it behind already.

So you never did a (successful) OTA on this devices initially flashed with tasmota? Than certainly that seems to be the problem!

Incompatible versions

WARNING! Migrating via OTA on ESP32, from Tasmota v12 (with boot partition) and up is currently not possible! Trying it could soft-brick your device!

1 Like

I missed that warning,
I was able to flash esphome form tasmota, but once esphome was on it, OTA never worked again,
so I think that’s it.
luckely I included all base functionality in the initial image.
I wanted to add some onsunrise function to get rid of automations. But I have to plan that for another time.
at least I know what the issue is now.

just wanted to let you know that the issue is gone after serial flashing.

1 Like