aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2024-04-30 09:53:44 +0200
committerJan200101 <sentrycraft123@gmail.com>2024-04-30 09:53:44 +0200
commit7150bc196b313e50da6a1af80706a3e94d314fe8 (patch)
tree4546a2b4ccf64c5e62b8d5e0500cb3d44be04797
parent440c1d9a50b5ea32752f2420cb17e8cfc44bf660 (diff)
downloadShelSP-7150bc196b313e50da6a1af80706a3e94d314fe8.tar.gz
ShelSP-7150bc196b313e50da6a1af80706a3e94d314fe8.zip
re-enable APSTA when sta connection fails
-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;
}