|
|
@ -36,6 +36,7 @@ |
|
|
|
#define FIRST_MIN_MAX 300000 // = 5 min
|
|
|
|
#define FIRST_MIN_MAX 300000 // = 5 min
|
|
|
|
#define HTML_RELOAD_PAGE_SECS 30 |
|
|
|
#define HTML_RELOAD_PAGE_SECS 30 |
|
|
|
#define WDT_TIMEOUT 300 |
|
|
|
#define WDT_TIMEOUT 300 |
|
|
|
|
|
|
|
#define RESET_AFTER_DAYS 7 |
|
|
|
|
|
|
|
|
|
|
|
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW); |
|
|
|
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW); |
|
|
|
looper sched; |
|
|
|
looper sched; |
|
|
@ -438,6 +439,15 @@ void show_time(void) |
|
|
|
lcd.setCursor(12, 0); |
|
|
|
lcd.setCursor(12, 0); |
|
|
|
lcd.print(time_string); |
|
|
|
lcd.print(time_string); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (uptime::getDays() >= RESET_AFTER_DAYS) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lcd.clear(); |
|
|
|
|
|
|
|
lcd.print("Automatic restart"); |
|
|
|
|
|
|
|
DEBUG_MSG("Automatic restart\n"); |
|
|
|
|
|
|
|
delay(2000); |
|
|
|
|
|
|
|
ESP.restart(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
digitalWrite(ONBOARD_LED, led_state); |
|
|
|
digitalWrite(ONBOARD_LED, led_state); |
|
|
|
led_state = !led_state; |
|
|
|
led_state = !led_state; |
|
|
|
} |
|
|
|
} |
|
|
|