esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 35 forks source link

OTA: ERROR Error receiving acknowledge binary size: timed out USB: ok #6301

Open Littleislandbrewing opened 1 week ago

Littleislandbrewing commented 1 week ago

The problem

ERROR Error receiving acknowledge binary size: timed out while attempting to upload via OTA.

I have 8 units of 4" LVGL screens that have "progressively" shown this issue as I have updated the functionality in them via OTA.

Originally this issue started and would fail but give the option to "retry" which would work, but, possibly, as the memory allocation has increased, this issue has progressed to only being able to flash via USB on all of them except for one unit.

The sketch is approx 3500 lines (yes) and works without issue. (5119552 bytes) and they all have the same code on them except for the name and friendly name.

From what I can see in the logger, ESPHome creates the binary.

Is it possible that ESPHome cant upload a binary of that size via OTA???

Which version of ESPHome has the issue?

2024.9.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32-IDF

Board

board: esp32-s3-devkitc-1

Component causing the issue

No response

Example YAML snippet

this is a OTA issue

Anything in the logs that might be useful for us?

HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - framework-espidf @ 3.40407.240606 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- ArduinoJson @ 6.18.5
|-- lvgl @ 8.4.0
|-- noise-c @ 0.1.6
Compiling .pioenvs/opbd1-b069660/src/main.o
Linking .pioenvs/opbd1-b069660/firmware.elf
RAM:   [=         ]  11.1% (used 36264 bytes from 327680 bytes)
Flash: [======    ]  63.0% (used 5119181 bytes from 8126464 bytes)
Building .pioenvs/opbd1-b069660/firmware.bin
Creating esp32s3 image...
Successfully created esp32s3 image.
esp32_create_combined_bin([".pioenvs/opbd1-b069660/firmware.bin"], [".pioenvs/opbd1-b069660/firmware.elf"])
Wrote 0x4f1e40 bytes to file /data/build/opbd1-b069660/.pioenvs/opbd1-b069660/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/opbd1-b069660/firmware.bin"], [".pioenvs/opbd1-b069660/firmware.elf"])
========================= [SUCCESS] Took 45.03 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.xx.xx
INFO Uploading /data/build/opbd1-b069660/.pioenvs/opbd1-b069660/firmware.bin (5119552 bytes)
ERROR Error receiving acknowledge binary size: timed out

Additional information

No response

j4c3 commented 1 day ago

I have run into this same issue with the same board definition. I found that a sketch that is 2735465 bytes will upload via ota okay, but bumping the size to 3196224 bytes will fail. Logging the esp side, when it works, I see:

08:54:23 [D] [esphome.ota:117] Starting update from 192.168.1.xx...

08:54:32 [D] [esphome.ota:293] Progress: 0.0%

08:54:32 [D] [esphome.ota:...

When it fails, it shows:

08:58:11 [D] [esphome.ota:117] Starting update from 192.168.1.xx...

08:58:23 [W] [esphome.ota:370] Remote closed connection

08:58:23 [W] [esphome.ota:244] Reading binary MD5 checksum failed

08:58:23 [W] [esphome.ota:398] Failed to write 1 bytes of data, errno 104

08:58:23 [E] [component:164] Component esphome.ota set Error flag: unspecified

08:58:28 [E] [component:176] Component esphome.ota cleared Error flag

ssied on discord mentioned there may be an issue with it timing out, potentially in erasing the flash?