From dce655c519ecb8feec8ac394380defc422540895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 5 Jun 2024 21:26:58 +0200 Subject: [PATCH 1/2] Update FullyFeatured-ESP32.ino Events changes with arduino-esp32-3.0 branch. --- examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino b/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino index c226569..236957a 100644 --- a/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino +++ b/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino @@ -33,13 +33,15 @@ void connectToMqtt() { void WiFiEvent(WiFiEvent_t event) { Serial.printf("[WiFi-event] event: %d\n", event); switch(event) { - case SYSTEM_EVENT_STA_GOT_IP: + //case SYSTEM_EVENT_STA_GOT_IP: // arduino-esp32-2.0 branch + case IP_EVENT_STA_GOT_IP: // arduino-esp32-3.0 branch Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); connectToMqtt(); break; - case SYSTEM_EVENT_STA_DISCONNECTED: + //case SYSTEM_EVENT_STA_DISCONNECTED: // arduino-esp32-2.0 branch + case WIFI_EVENT_STA_DISCONNECTED: // arduino-esp32-3.0 branch Serial.println("WiFi lost connection"); xTimerStop(mqttReconnectTimer, 0); // ensure we don't reconnect to MQTT while reconnecting to Wi-Fi xTimerStart(wifiReconnectTimer, 0); From de112201039753c827699ac0bb25009e8ff068a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 5 Jun 2024 22:09:18 +0200 Subject: [PATCH 2/2] Update FullyFeatured-ESP32.ino --- examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino b/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino index 236957a..2e48162 100644 --- a/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino +++ b/examples/FullyFeatured-ESP32/FullyFeatured-ESP32.ino @@ -34,14 +34,14 @@ void WiFiEvent(WiFiEvent_t event) { Serial.printf("[WiFi-event] event: %d\n", event); switch(event) { //case SYSTEM_EVENT_STA_GOT_IP: // arduino-esp32-2.0 branch - case IP_EVENT_STA_GOT_IP: // arduino-esp32-3.0 branch + case ARDUINO_EVENT_WIFI_STA_GOT_IP: // arduino-esp32-3.0 branch Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); connectToMqtt(); break; //case SYSTEM_EVENT_STA_DISCONNECTED: // arduino-esp32-2.0 branch - case WIFI_EVENT_STA_DISCONNECTED: // arduino-esp32-3.0 branch + case ARDUINO_EVENT_WIFI_STA_DISCONNECTED: // arduino-esp32-3.0 branch Serial.println("WiFi lost connection"); xTimerStop(mqttReconnectTimer, 0); // ensure we don't reconnect to MQTT while reconnecting to Wi-Fi xTimerStart(wifiReconnectTimer, 0);