Added automatic reboot after 28h
This commit is contained in:
parent
bb86029452
commit
e21738913f
|
@ -34,6 +34,10 @@
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <Bounce2.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.
|
// Update these with values suitable for your network.
|
||||||
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEA };
|
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEA };
|
||||||
IPAddress ip(192, 168, 89, 205);
|
IPAddress ip(192, 168, 89, 205);
|
||||||
|
@ -404,4 +408,7 @@ void loop() {
|
||||||
|
|
||||||
checkOutputAutoOff();
|
checkOutputAutoOff();
|
||||||
|
|
||||||
|
if (millis() > REBOOT_EVERY_ms) {
|
||||||
|
resetArduinoNow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue