diff --git a/esphome/components/esphome/ota/ota_esphome_udp.cpp b/esphome/components/esphome/ota/ota_esphome_udp.cpp index ec263bbdc3e..6044284755c 100644 --- a/esphome/components/esphome/ota/ota_esphome_udp.cpp +++ b/esphome/components/esphome/ota/ota_esphome_udp.cpp @@ -36,8 +36,8 @@ static constexpr uint8_t UDP_FLAG_COMMITTED = 0x80; static constexpr uint8_t UDP_MSG_ACK = 0x40; static constexpr size_t UDP_HEADER_SIZE = 9; static constexpr size_t UDP_ACK_HEADER_SIZE = 12; -// The client's 60 s wait for the token over a lossy TCP link, plus its 5 s probe -static constexpr uint32_t UDP_COMMIT_TIMEOUT = 70000; +// The client's 60 s wait for the token over a lossy TCP link, plus its 15 s probe +static constexpr uint32_t UDP_COMMIT_TIMEOUT = 80000; // Like the TCP socket's SO_RCVTIMEO in handle_data_, so readall_ treats both alike static constexpr uint32_t UDP_READ_WAIT_MS = 2000; // How often the commit wait looks at the UDP link between reads of the TCP fallback byte diff --git a/esphome/espota2.py b/esphome/espota2.py index 4f6b17bc040..dc0d27e32cd 100644 --- a/esphome/espota2.py +++ b/esphome/espota2.py @@ -133,8 +133,9 @@ UDP_MAX_PAYLOAD = 1400 # Messages the device queues unconsumed (UDP_WINDOW in ota_esphome.h); as many # as TCP's window holds, so UDP costs the device no more memory than TCP UDP_WINDOW = 4 -# Probe this long before falling back to TCP; the device waits 70 s -UDP_PROBE_TIMEOUT = 5.0 +# Probe this long before falling back to TCP, enough to ride out a radio busy +# with BLE; the device waits 80 s +UDP_PROBE_TIMEOUT = 15.0 UDP_PROBE_INTERVAL = 0.1 # Resend timeout bounds around srtt + 4 * rttvar; random loss never grows it UDP_RESEND_INITIAL = 0.5