Added WiFi.disconnect to ESPNow examples. Fixes https://github.com/espressif/arduino-esp32/issues/1425 (#1511)

This commit is contained in:
lbernstone
2018-06-19 02:33:50 -06:00
committed by Me No Dev
parent 33392af315
commit 36c8020cbc
4 changed files with 8 additions and 4 deletions

View File

@ -40,6 +40,7 @@ esp_now_peer_info_t slave;
// Init ESP Now with fallback
void InitESPNow() {
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
@ -259,4 +260,4 @@ void loop() {
// wait for 3seconds to run the logic again
delay(3000);
}
}