From 25cdbacecc01a52eee82b34bcb68f8450ada33a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Mon, 30 Mar 2020 18:32:48 +0100 Subject: [PATCH] wifi: retry connection if the connection is not valid (#994) --- esphome/components/wifi/wifi_component.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index e68ab1765b..40f12a8adc 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -420,6 +420,12 @@ void WiFiComponent::check_connecting_finished() { wl_status_t status = this->wifi_sta_status_(); if (status == WL_CONNECTED) { + if (WiFi.SSID().equals("")) { + ESP_LOGW(TAG, "Incomplete connection."); + this->retry_connect(); + return; + } + ESP_LOGI(TAG, "WiFi Connected!"); this->print_connect_params_();