Added automatic reset after 7 days.

master
Holger Wirtz 4 years ago
parent 17ff2e905e
commit db52b72931
  1. 10
      WLAN_Thermometer.ino

@ -36,6 +36,7 @@
#define FIRST_MIN_MAX 300000 // = 5 min
#define HTML_RELOAD_PAGE_SECS 30
#define WDT_TIMEOUT 300
#define RESET_AFTER_DAYS 7
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW);
looper sched;
@ -438,6 +439,15 @@ void show_time(void)
lcd.setCursor(12, 0);
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);
led_state = !led_state;
}

Loading…
Cancel
Save