Commit 36c8020c authored by lbernstone's avatar lbernstone Committed by Me No Dev

Added WiFi.disconnect to ESPNow examples. Fixes...

Added WiFi.disconnect to ESPNow examples. Fixes https://github.com/espressif/arduino-esp32/issues/1425 (#1511)
parent 33392af3
......@@ -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);
}
\ No newline at end of file
}
......@@ -36,6 +36,7 @@
// Init ESP Now with fallback
void InitESPNow() {
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
......@@ -87,4 +88,4 @@ void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) {
void loop() {
// Chill
}
\ No newline at end of file
}
......@@ -59,6 +59,7 @@ int SlaveCnt = 0;
// Init ESP Now with fallback
void InitESPNow() {
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
......@@ -242,4 +243,4 @@ void loop() {
// wait for 3seconds to run the logic again
delay(1000);
}
\ No newline at end of file
}
......@@ -36,6 +36,7 @@
// Init ESP Now with fallback
void InitESPNow() {
WiFi.disconnect();
if (esp_now_init() == ESP_OK) {
Serial.println("ESPNow Init Success");
}
......@@ -90,4 +91,4 @@ void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) {
void loop() {
// Chill
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment