|
|
|
@ -12,6 +12,7 @@ |
|
|
|
|
#include <ESPDateTime.h> |
|
|
|
|
#include <Time.h> |
|
|
|
|
#include <DHT.h> |
|
|
|
|
#include <esp_task_wdt.h> |
|
|
|
|
|
|
|
|
|
#define MDNS_NAME "wlanthermometer" |
|
|
|
|
#define AP_SSID_CONFIG_NAME "WLANTHERMOMETER-Config" |
|
|
|
@ -33,6 +34,7 @@ |
|
|
|
|
#define DHTTYPE DHT22 |
|
|
|
|
#define FIRST_MIN_MAX 300000 // = 5 min
|
|
|
|
|
#define HTML_RELOAD_PAGE_SECS 30 |
|
|
|
|
#define WDT_TIMEOUT 30 |
|
|
|
|
|
|
|
|
|
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW); |
|
|
|
|
looper sched; |
|
|
|
@ -62,6 +64,9 @@ void setup() |
|
|
|
|
{ |
|
|
|
|
bool ap_reset_last_state; |
|
|
|
|
|
|
|
|
|
esp_task_wdt_init(WDT_TIMEOUT, true); |
|
|
|
|
esp_task_wdt_add(NULL); |
|
|
|
|
|
|
|
|
|
pinMode(AP_DATA_RESET_PIN, INPUT_PULLDOWN); |
|
|
|
|
pinMode(ONBOARD_LED, OUTPUT); |
|
|
|
|
|
|
|
|
@ -161,6 +166,7 @@ void setup() |
|
|
|
|
sched.addJob(show_time, KRATE_TIME); |
|
|
|
|
sched.addJob(check_reset_ap_data, KRATE_RESET_AP_DATA); |
|
|
|
|
sched.addJob(check_datetime, KRATE_CHECK_DATETIME); |
|
|
|
|
sched.addJob(watchdog_reset, WDT_TIMEOUT / 2); |
|
|
|
|
|
|
|
|
|
get_sensor_data(); |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
@ -590,3 +596,8 @@ void check_datetime(void) |
|
|
|
|
show_time(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void watchdog_reset(void) |
|
|
|
|
{ |
|
|
|
|
esp_task_wdt_reset(); |
|
|
|
|
} |
|
|
|
|