ESPHome OTA Update error 10

Hi,

a year ago a i replaced default sonoff s26 firmware to ESPHome following this setup.

I used default setup, only i replaced SSID and password:

# Basic Config
esphome:
  name: sonoffs26_1
  platform: ESP8266
  board: esp01_1m
  board_flash_mode: dout

wifi:
  ssid: "XX__MYSSID__XX"
  password: "XX__wifi_password__XX"
  ap:
    ssid: "ap_ssid"
    password: "Password"
  domain: ".domain.com"

status_led:
  pin:
    number: GPIO13
    inverted: false
logger:

api:
  password: "api_password"

ota:
  password: "OTA_password"

web_server:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Sonoff S26_1 Button"
    on_press:
      - switch.toggle: relay
  - platform: status
    name: "Sonoff S26_1 Status"

sensor:
  - platform: wifi_signal
    name: "sonoffs26_1 WiFi Signal"
    update_interval: 60s
switch:
  - platform: gpio
    name: "Sonoff S26_1 Relay"
    pin: GPIO12
    id: "relay"
  - platform: restart
    name: "sonoffs26_1 Restart"

Now i need to modify “SSID” and “Password” and i tried to update firmware by OTA. I replaced SSID and password in yaml file and tried to update it by the device web interface. I select the file to upload and press update button but instatly i receive this error “Update Failed: ERROR[10]: Magic byte is wrong, not 0xE9”.
Can someone tel me if i i’m doing some wrong and how could i change ssid and paswword to the device? I try to avoid to open again the device to update the firmware.

Can you try uploading the firmware from the esphome webpage by using install function and not the device interface?

Finally i succesfuly installed the modified yaml file running esphome commandline command from ubuntu console.

esphome run file.yaml

I had to upgrade esphome python version due it was very old and prompt an HTML error and a suggestion to upgrade. After upgrade i set a redirection in /etc/hosts to the sonoff ip address because esphome don’t resolve domain name.

You could see in esphome documentation, once you have esphome firmware installed you could install again a yaml file “magically”:

This time when uploading, you don’t need to have the device plugged in through USB again. The upload will magically happen “over the air”. Using ESPHome directly, this is the same as from a USB cable, but for docker you need to supply an additional parameter:

esphome livingroom.yaml run

Finally it worked