diff --git a/esphome/components/esphome/ota/__init__.py b/esphome/components/esphome/ota/__init__.py index 589f44f85c..337064dd27 100644 --- a/esphome/components/esphome/ota/__init__.py +++ b/esphome/components/esphome/ota/__init__.py @@ -97,7 +97,8 @@ def _consume_ota_sockets(config: ConfigType) -> ConfigType: """Register socket needs for OTA component.""" from esphome.components import socket - # OTA needs 1 listening socket (client connections are temporary during updates) + # OTA needs 1 listening socket. The active transfer connection during an update + # uses a TCP PCB from the general pool, covered by MIN_TCP_SOCKETS headroom. socket.consume_sockets(1, "ota", socket.SocketType.TCP_LISTEN)(config) return config diff --git a/esphome/components/socket/__init__.py b/esphome/components/socket/__init__.py index 4204a14747..3369779942 100644 --- a/esphome/components/socket/__init__.py +++ b/esphome/components/socket/__init__.py @@ -23,7 +23,7 @@ KEY_SOCKET_CONSUMERS_TCP_LISTEN = "socket_consumers_tcp_listen" # Recommended minimum socket counts to ensure headroom. # Platforms should apply these (or their own) on top of get_socket_counts(). -# TCP: api(4) + ota(1) = 5 base, +5 headroom for web_server/other components. +# TCP: api(3) = 3 base, +7 headroom for web_server(5)/ota-transfer/other. # UDP: dhcp(1) + dns(1) + mdns(2) + wake_loop(1) = 5 base, +3 headroom. MIN_TCP_SOCKETS = 10 MIN_UDP_SOCKETS = 8