add reset interval
2 files changed, 10 insertions(+), 0 deletions(-)

M include/config.h
M src/main.cpp
M include/config.h +3 -0
@@ 3,3 3,6 @@ 
 #define WANT_MDNS 1
 
 #define FIRMWARE_REVISION 1024
+
+// reset interval = 7 days
+#define RESET_INTERVAL (1000 * 3600 * 24 * 7)

          
M src/main.cpp +7 -0
@@ 269,6 269,13 @@ void setup() {
 }
 
 void loop() {
+
+    long tsm = millis();
+    if(tsm > RESET_INTERVAL) {
+        ESP.restart();
+        delay(1000);
+    }
+
 #ifdef WANT_NTP
     timeClient.update();
         // don't update this every loop else you'll waste cpu