mirror of
https://github.com/esphome/esphome.git
synced 2026-09-12 15:57:33 +00:00
fbafade78c74d17bb4dcd4262a650961d6b63d19
The main `while (total < ota_size)` loop in `ESPHomeOTAComponent::handle_data_()` had a `// TODO: timeout check` and no wall-clock guard. If the uploader side dropped the TCP connection without a FIN/RST being delivered to the device (uploader process killed mid-transfer, NAT/router state dropped, packet loss eating the RST), `recv_fn` would never see a close and `s_err_fn` would never fire, so: - `pcb_` stays non-null - `rx_closed_` stays false - `waiting_for_data_()` stays true forever - the loop spins on `EWOULDBLOCK`, fed by `App.feed_wdt(); continue;`, indefinitely LwIP TCP keepalive is not enabled on the OTA socket, and even when enabled the default keepalive timer is on the order of hours, so the device is effectively unresponsive until power cycle. This matches the "device unresponsive until I do a hard power-reset" symptom in issue #15953. Track the timestamp of the last successful read and abort if no data arrives for `OTA_SOCKET_TIMEOUT_DATA` (90s, same constant the handshake, `readall_()`, and `writeall_()` already use). The timeout resets on every successful read so a slow but live link does not false-trigger.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
592 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
