|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
|
|
|
|
|
//#define _WIFIMGR_LOGLEVEL_ 4
|
|
|
|
|
#define DEBUG 1 |
|
|
|
|
//#define DEBUG 1
|
|
|
|
|
|
|
|
|
|
#include <WiFi.h> |
|
|
|
|
#include <WiFiManager.h> |
|
|
|
@ -81,7 +81,7 @@ void setup() |
|
|
|
|
{ |
|
|
|
|
ap_data_reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
|
|
|
|
|
|
|
|
|
WiFiManager wm; |
|
|
|
@ -122,7 +122,7 @@ void setup() |
|
|
|
|
DEBUG_MSG("mDNS started.\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0,2); |
|
|
|
|
lcd.setCursor(0, 2); |
|
|
|
|
lcd.print(F("Mode WiFi client")); |
|
|
|
|
lcd.setCursor(0, 3); |
|
|
|
|
lcd.print(WiFi.localIP()); |
|
|
|
@ -485,7 +485,10 @@ void get_sensor_data(void) |
|
|
|
|
{ |
|
|
|
|
temp[ACT] = dht.readTemperature(); |
|
|
|
|
hum[ACT] = dht.readHumidity(); |
|
|
|
|
heat[ACT] = dht.computeHeatIndex(temp[ACT], hum[ACT], false); |
|
|
|
|
if (!isnan(temp[ACT]) && !isnan(hum[ACT])) |
|
|
|
|
heat[ACT] = dht.computeHeatIndex(temp[ACT], hum[ACT], false); |
|
|
|
|
else |
|
|
|
|
heat[ACT] = NAN; |
|
|
|
|
|
|
|
|
|
if (minmax_enabled == false && millis() > FIRST_MIN_MAX) |
|
|
|
|
{ |
|
|
|
@ -517,7 +520,7 @@ void get_sensor_data(void) |
|
|
|
|
{ |
|
|
|
|
if (temp[ACT] < temp[MIN]) |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
|
if (temp[ACT] > temp[MAX]) |
|
|
|
|
else if (temp[ACT] > temp[MAX]) |
|
|
|
|
temp[MAX] = temp[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -525,7 +528,7 @@ void get_sensor_data(void) |
|
|
|
|
{ |
|
|
|
|
if (hum[ACT] < hum[MIN]) |
|
|
|
|
hum[MIN] = hum[ACT]; |
|
|
|
|
if (hum[ACT] > hum[MAX]) |
|
|
|
|
else if (hum[ACT] > hum[MAX]) |
|
|
|
|
hum[MAX] = hum[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -533,7 +536,7 @@ void get_sensor_data(void) |
|
|
|
|
{ |
|
|
|
|
if (heat[ACT] < heat[MIN]) |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
if (heat[ACT] > heat[MAX]) |
|
|
|
|
else if (heat[ACT] > heat[MAX]) |
|
|
|
|
heat[MAX] = heat[ACT]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|