diff --git a/src/main.cpp b/src/main.cpp index 8208ae3..2b39f29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,6 +34,10 @@ #include #include +// Auto reset Arduino to start network again and avoid counter overflow +#define REBOOT_EVERY_ms (28 * (3600000 /* hours */)) +void (*resetArduinoNow) (void) = 0; // declare reset fuction at address 0 + // Update these with values suitable for your network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEA }; IPAddress ip(192, 168, 89, 205); @@ -404,4 +408,7 @@ void loop() { checkOutputAutoOff(); + if (millis() > REBOOT_EVERY_ms) { + resetArduinoNow(); + } }