From 87fcfc9d76a148807012742c35a6cb13a99f395f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 28 Jan 2026 09:40:00 -1000 Subject: [PATCH] [wifi] Fix ESP8266 yield panic when WiFi scan fails (#13603) --- esphome/components/wifi/wifi_component_esp8266.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index be54038af8..c714afaad3 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -756,7 +756,10 @@ void WiFiComponent::wifi_scan_done_callback_(void *arg, STATUS status) { if (status != OK) { ESP_LOGV(TAG, "Scan failed: %d", status); - this->retry_connect(); + // Don't call retry_connect() here - this callback runs in SDK system context + // where yield() cannot be called. Instead, just set scan_done_ and let + // check_scanning_finished() handle the empty scan_result_ from loop context. + this->scan_done_ = true; return; }