wifi: retry connection if the connection is not valid (#994)

This commit is contained in:
Abílio Costa 2020-03-30 18:32:48 +01:00 committed by GitHub
parent 4ec636c08f
commit 25cdbacecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -420,6 +420,12 @@ void WiFiComponent::check_connecting_finished() {
wl_status_t status = this->wifi_sta_status_(); wl_status_t status = this->wifi_sta_status_();
if (status == WL_CONNECTED) { if (status == WL_CONNECTED) {
if (WiFi.SSID().equals("")) {
ESP_LOGW(TAG, "Incomplete connection.");
this->retry_connect();
return;
}
ESP_LOGI(TAG, "WiFi Connected!"); ESP_LOGI(TAG, "WiFi Connected!");
this->print_connect_params_(); this->print_connect_params_();