We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a35f474 commit 1131bd2Copy full SHA for 1131bd2
1 file changed
components/wifiManager/wifiManager/wifiManager.cpp
@@ -102,7 +102,12 @@ void WiFiManager::ConnectWithHardcodedCredentials()
102
{
103
SystemEvent event = {EventSource::WIFI, WiFiState_e::WiFiState_ReadyToConnect};
104
this->SetCredentials(CONFIG_WIFI_SSID, CONFIG_WIFI_PASSWORD);
105
- // Skip esp_wifi_stop() on first connection - WiFi not started yet
+
106
+ wifi_mode_t mode;
107
+ if (esp_wifi_get_mode(&mode) == ESP_OK) {
108
+ esp_wifi_stop();
109
+ }
110
111
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
112
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &_wifi_cfg));
113
0 commit comments