From c00c0ee6a64fec204b333ce5d9200817c5b9f00b Mon Sep 17 00:00:00 2001 From: Patrick Lapointe Date: Thu, 17 Sep 2020 08:53:55 -0400 Subject: [PATCH] FIX: ESP.reset does not compile for ESP32 --- src/EspMQTTClient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/EspMQTTClient.cpp b/src/EspMQTTClient.cpp index d45bb3a..d651ced 100644 --- a/src/EspMQTTClient.cpp +++ b/src/EspMQTTClient.cpp @@ -269,7 +269,11 @@ void EspMQTTClient::loop() if (_enableSerialLogs) Serial.println("MQTT!: Can't connect to broker after too many attempt, resetting board ..."); - ESP.reset(); + #ifdef ESP8266 + ESP.reset(); + #else + ESP.restart(); + #endif } } else