Added automatic reboot after 28h

This commit is contained in:
Dirk Jahnke 2021-02-02 16:15:54 +01:00
parent bb86029452
commit e21738913f
1 changed files with 7 additions and 0 deletions

View File

@ -34,6 +34,10 @@
#include <ArduinoJson.h>
#include <Bounce2.h>
// 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();
}
}