Call esp_wifi_stop() before connecting to AP

This commit is contained in:
Sandeep Mistry
2018-06-28 12:59:52 +02:00
parent 7d1d9647ec
commit 4e2b214daf

View File

@@ -175,6 +175,7 @@ uint8_t WiFiClass::begin(const char* ssid, const char* key)
_interface = ESP_IF_WIFI_STA;
esp_wifi_stop();
esp_wifi_set_mode(WIFI_MODE_STA);
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT0, false, true, portMAX_DELAY);