|
|
|
@ -48,7 +48,7 @@ DHT dht(TEMP_SENS_PIN, DHTTYPE); |
|
|
|
|
const uint8_t degree_sign[8] = { B00010, B00101, B00010, B00000, B00000, B00000, B00000, B00000 }; |
|
|
|
|
uint8_t add_summertime = 0; |
|
|
|
|
bool last_reset_ap_check = false; |
|
|
|
|
bool minmax_enabled = false; |
|
|
|
|
//bool minmax_enabled = false;
|
|
|
|
|
char date_string_old[9]; |
|
|
|
|
|
|
|
|
|
enum { |
|
|
|
@ -240,48 +240,75 @@ void loop() |
|
|
|
|
client.println("<center>"); |
|
|
|
|
client.println("<h1 style=\"color:green;\">Temperatur</h1>"); |
|
|
|
|
client.print("<h2 style=\"color:green;\">Aktuell: "); |
|
|
|
|
client.print(temp[ACT]); |
|
|
|
|
if (!isnan(temp[ACT])) |
|
|
|
|
client.print(temp[ACT]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.println(" °C</h2>"); |
|
|
|
|
if (millis() > FIRST_MIN_MAX) |
|
|
|
|
{ |
|
|
|
|
client.print("<h2 style=\"color:green;\">Minimum: "); |
|
|
|
|
client.print(temp[MIN]); |
|
|
|
|
if (!isnan(temp[MIN])) |
|
|
|
|
client.print(temp[MIN]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" °C"); |
|
|
|
|
client.print("</h2>\n"); |
|
|
|
|
client.print("<h2 style=\"color:green;\">Maximum: "); |
|
|
|
|
client.print(temp[MAX]); |
|
|
|
|
if (!isnan(temp[MAX])) |
|
|
|
|
client.print(temp[MAX]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" °C"); |
|
|
|
|
client.println("</h2>"); |
|
|
|
|
} |
|
|
|
|
client.println("<hr>"); |
|
|
|
|
client.println("<h1 style=\"color:red;\">Gefühlte Temperatur</h1>"); |
|
|
|
|
client.print("<h2 style=\"color:red;\">Aktuell: "); |
|
|
|
|
client.print(heat[ACT]); |
|
|
|
|
if (!isnan(heat[ACT])) |
|
|
|
|
client.print(heat[ACT]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.println(" °C</h2>"); |
|
|
|
|
if (millis() > FIRST_MIN_MAX) |
|
|
|
|
{ |
|
|
|
|
client.print("<h2 style=\"color:red;\">Minimum: "); |
|
|
|
|
client.print(heat[MIN]); |
|
|
|
|
if (!isnan(heat[MIN])) |
|
|
|
|
client.print(heat[MIN]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" °C"); |
|
|
|
|
client.println("</h2>"); |
|
|
|
|
client.print("<h2 style=\"color:red;\">Maximum: "); |
|
|
|
|
client.print(heat[MAX]); |
|
|
|
|
if (!isnan(heat[MAX])) |
|
|
|
|
client.print(heat[MAX]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" °C"); |
|
|
|
|
client.println("</h2>"); |
|
|
|
|
} |
|
|
|
|
client.println("<hr>"); |
|
|
|
|
client.println("<h1 style=\"color:blue;\">Luftfeuchtigkeit</h1>"); |
|
|
|
|
client.print("<h2 style=\"color:blue;\">Aktuell: "); |
|
|
|
|
client.print(hum[ACT]); |
|
|
|
|
if (!isnan(hum[ACT])) |
|
|
|
|
client.print(hum[ACT]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.println(" %</h2>"); |
|
|
|
|
if (millis() > FIRST_MIN_MAX) |
|
|
|
|
{ |
|
|
|
|
client.print("<h2 style=\"color:blue;\">Minimum: "); |
|
|
|
|
client.print(hum[MIN]); |
|
|
|
|
if (!isnan(hum[MIN])) |
|
|
|
|
client.print(hum[MIN]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" %"); |
|
|
|
|
client.println("</h2>"); |
|
|
|
|
client.print("<h2 style=\"color:blue;\">Maximum: "); |
|
|
|
|
client.print(hum[MAX]); |
|
|
|
|
if (!isnan(hum[MAX])) |
|
|
|
|
client.print(hum[MAX]); |
|
|
|
|
else |
|
|
|
|
client.print("--.--"); |
|
|
|
|
client.print(" %"); |
|
|
|
|
client.println("</h2>"); |
|
|
|
|
} |
|
|
|
@ -319,7 +346,7 @@ void loop() |
|
|
|
|
client.println("WWW-Authenticate: Basic realm=\"Secure\""); |
|
|
|
|
client.println("Content-Type: text/html"); |
|
|
|
|
client.println(); |
|
|
|
|
client.println("<html>Authentication failed</html>"); |
|
|
|
|
client.println("<html>Authentification failed</html>"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} else { // if you got a newline, then clear currentLine
|
|
|
|
@ -500,55 +527,75 @@ void get_sensor_data(void) |
|
|
|
|
else |
|
|
|
|
heat[ACT] = NAN; |
|
|
|
|
|
|
|
|
|
if (minmax_enabled == false && millis() > FIRST_MIN_MAX) |
|
|
|
|
/*
|
|
|
|
|
if (minmax_enabled == false && millis() > FIRST_MIN_MAX) |
|
|
|
|
minmax_enabled = true; |
|
|
|
|
|
|
|
|
|
if (minmax_enabled == false) |
|
|
|
|
{ |
|
|
|
|
if (!isnan(temp[ACT])) |
|
|
|
|
if (minmax_enabled == false) |
|
|
|
|
{ |
|
|
|
|
if (!isnan(temp[ACT])) |
|
|
|
|
{ |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
|
temp[MAX] = temp[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isnan(hum[ACT])) |
|
|
|
|
{ |
|
|
|
|
hum[MIN] = hum[ACT]; |
|
|
|
|
hum[MAX] = hum[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isnan(heat[ACT])) |
|
|
|
|
{ |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
*/ |
|
|
|
|
if (!isnan(temp[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (isnan(temp[MIN])) |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
|
|
|
|
|
|
if (isnan(temp[MAX])) |
|
|
|
|
temp[MAX] = temp[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isnan(hum[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (temp[ACT] < temp[MIN]) |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
|
else if (temp[ACT] > temp[MAX]) |
|
|
|
|
temp[MAX] = temp[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isnan(hum[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (isnan(hum[MIN])) |
|
|
|
|
hum[MIN] = hum[ACT]; |
|
|
|
|
|
|
|
|
|
if (isnan(hum[MAX])) |
|
|
|
|
hum[MAX] = hum[ACT]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isnan(heat[ACT])) |
|
|
|
|
{ |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
} |
|
|
|
|
if (hum[ACT] < hum[MIN]) |
|
|
|
|
hum[MIN] = hum[ACT]; |
|
|
|
|
else if (hum[ACT] > hum[MAX]) |
|
|
|
|
hum[MAX] = hum[ACT]; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
if (!isnan(heat[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (!isnan(temp[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (temp[ACT] < temp[MIN]) |
|
|
|
|
temp[MIN] = temp[ACT]; |
|
|
|
|
else if (temp[ACT] > temp[MAX]) |
|
|
|
|
temp[MAX] = temp[ACT]; |
|
|
|
|
} |
|
|
|
|
if (isnan(heat[MIN])) |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
|
|
|
|
|
if (!isnan(hum[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (hum[ACT] < hum[MIN]) |
|
|
|
|
hum[MIN] = hum[ACT]; |
|
|
|
|
else if (hum[ACT] > hum[MAX]) |
|
|
|
|
hum[MAX] = hum[ACT]; |
|
|
|
|
} |
|
|
|
|
if (isnan(heat[MAX])) |
|
|
|
|
heat[MAX] = heat[ACT]; |
|
|
|
|
|
|
|
|
|
if (!isnan(heat[ACT])) |
|
|
|
|
{ |
|
|
|
|
if (heat[ACT] < heat[MIN]) |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
else if (heat[ACT] > heat[MAX]) |
|
|
|
|
heat[MAX] = heat[ACT]; |
|
|
|
|
} |
|
|
|
|
if (heat[ACT] < heat[MIN]) |
|
|
|
|
heat[MIN] = heat[ACT]; |
|
|
|
|
else if (heat[ACT] > heat[MAX]) |
|
|
|
|
heat[MAX] = heat[ACT]; |
|
|
|
|
} |
|
|
|
|
//}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ConfigAPWeb(void) |
|
|
|
|