diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index a40f04cc45..6edd84e589 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -271,7 +271,15 @@ def final_validate(config): def _consume_wifi_sockets(config: ConfigType) -> ConfigType: - """Register UDP PCBs used internally by lwIP for DHCP and DNS.""" + """Register UDP PCBs used internally by lwIP for DHCP and DNS. + + Only needed on LibreTiny where we directly set MEMP_NUM_UDP_PCB (the raw + PCB pool shared by both application sockets and lwIP internals like DHCP/DNS). + On ESP32, CONFIG_LWIP_MAX_SOCKETS only controls the POSIX socket layer — + DHCP/DNS use raw udp_new() which bypasses it entirely. + """ + if not (CORE.is_bk72xx or CORE.is_rtl87xx or CORE.is_ln882x): + return config from esphome.components import socket # lwIP allocates UDP PCBs for DHCP client and DNS resolver internally.