aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/net.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/net.cpp b/main/net.cpp
index e5bcfe7..f927390 100644
--- a/main/net.cpp
+++ b/main/net.cpp
@@ -230,8 +230,10 @@ esp_err_t net_connect(void)
ESP_LOGI(TAG, "Connected to station, setting STA mode");
} else if (bits & WIFI_FAIL_BIT) {
ESP_LOGI(TAG, "Failed to connect to station");
+ ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA));
} else {
ESP_LOGE(TAG, "UNEXPECTED EVENT");
+ ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA));
return ESP_FAIL;
}