mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
added delay for wifi stability on ESP8266 clones
This commit is contained in:
@@ -3129,6 +3129,10 @@ void MyESP::loop() {
|
|||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MYESP_DELAY) {
|
||||||
|
delay(MYESP_DELAY); // some time to WiFi and everything else to catch up, and prevent overheating
|
||||||
|
}
|
||||||
|
|
||||||
yield(); // ... and breath.
|
yield(); // ... and breath.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#ifndef MyESP_h
|
#ifndef MyESP_h
|
||||||
#define MyESP_h
|
#define MyESP_h
|
||||||
|
|
||||||
#define MYESP_VERSION "1.2.16"
|
#define MYESP_VERSION "1.2.17"
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
@@ -66,6 +66,10 @@ extern struct rst_info resetInfo;
|
|||||||
#define MYESP_WIFI_CONNECT_TIMEOUT 20000 // Connecting timeout for WIFI in ms (20 seconds)
|
#define MYESP_WIFI_CONNECT_TIMEOUT 20000 // Connecting timeout for WIFI in ms (20 seconds)
|
||||||
#define MYESP_WIFI_RECONNECT_INTERVAL 600000 // If could not connect to WIFI, retry after this time in ms. 10 minutes
|
#define MYESP_WIFI_RECONNECT_INTERVAL 600000 // If could not connect to WIFI, retry after this time in ms. 10 minutes
|
||||||
|
|
||||||
|
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
|
||||||
|
// initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi
|
||||||
|
#define MYESP_DELAY 1
|
||||||
|
|
||||||
// MQTT
|
// MQTT
|
||||||
#define MQTT_PORT 1883 // MQTT port
|
#define MQTT_PORT 1883 // MQTT port
|
||||||
#define MQTT_RECONNECT_DELAY_MIN 2000 // Try to reconnect in 3 seconds upon disconnection
|
#define MQTT_RECONNECT_DELAY_MIN 2000 // Try to reconnect in 3 seconds upon disconnection
|
||||||
|
|||||||
Reference in New Issue
Block a user