Hardware: AI Thinker ESP-12K (nodemcu-32s2 clone)
Freshly installed from web through USB cable. I can load the webpage running on the device. After a couple of minutes it confirms correct boot and writes the settings to flash.
Next I try to program my YAML configuration using the OTA dialog to update the firmware. Immediately this fails with the message “Update Failed: Flash Read Failed on first OTA attempt”.
I’m new to ESPhome so please bear with me
The YAML I try to run is pretty simplistic:
Sorry, I may not express myself clearly.
Initial installation is done through https://web.esphome.io with the device connected on USB.
Once this succeeds, I try to perform OTA firmware update by adding it in Home Assistant and connecting to the link presented under “Device info” which is just the http://<dev_ip>:80 website.
On this page the device name is properly displayed, and a short while after booting it prints some log information in the box on the right:
Time level Tag Message
21:15:27 [I] [ota:113]
Boot seems successful, resetting boot loop counter.
21:15:27 [D] [esp32.preferences:114]
Saving 1 preferences to flash...
21:15:27 [D] [esp32.preferences:143]
Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
From this page, in the section “OTA Update” I choose the yaml file that I copied in the opening post (with the ota: component included now), yet still the same error when I press the “Update” button.
Using the command line, I managed to generate a new YAML and upload a new firmware file to the device using OTA update: esphome run <file.yaml> --device <device_ip>
Probably I do something wrong with the browser-based flashing?
The web based OTA update is so you can flash a compiled .bin file to the device. You cannot flash a .yaml file directly to the device.
The esphome run command you successfully updated with does 2 things. It compiles your .yaml file with ESPHome and creates a .bin file. It then loads that .bin file to the device.
Thanks, I finally get it. I guess I was confused by the fact that the file dialog for upload accepts a YAML as input while it should actually get a bin file instead.