From e13d72fa2cb310d3b631e27e6a35f3f5376fd565 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Mon, 16 May 2022 10:25:07 +0200 Subject: [PATCH] Fixed homebrew stat json data generation. --- firmware/config.h | 2 +- firmware/firmware.ino | 7 ++++--- firmware/webUpdater.ino | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/firmware/config.h b/firmware/config.h index beea44a..49753ac 100644 --- a/firmware/config.h +++ b/firmware/config.h @@ -20,7 +20,7 @@ #define WIFI_CONFIG_PORTAL_TIMEOUT_S 120 #define UPDATE_SENSOR_INTERVAL_S 300 #define UPDATE_WEBSERVER_INTVERVAL_S 1 -#define DELAY_LOOP_MS 50 +#define DELAY_LOOP_MS 60 #define POWERSAVING_SLEEP_S 600 #define EMERGENCY_SLEEP_S 172800 // Sleep for 2 days to recover #define ENERGY_SAVING_ITERATIONS 30 diff --git a/firmware/firmware.ino b/firmware/firmware.ino index df69d7f..9dc6c7b 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -165,7 +165,8 @@ void setup() //*************************************************************************// #ifdef BATTERY_POWERED -void criticalBatCheck() { +void criticalBatCheck() +{ float volt = battery_voltage(); if (volt <= BAT_EMERGENCY_DEEPSLEEP_VOLTAGE) { debug("Bat Voltage: " + String(volt) + " V"); @@ -178,7 +179,8 @@ void criticalBatCheck() { #endif -void loop() { +void loop() +{ #ifdef BATTERY_POWERED delay(50); return; @@ -191,7 +193,6 @@ void loop() { } #endif - _loop(); //Needed to give WIFI time to function properly diff --git a/firmware/webUpdater.ino b/firmware/webUpdater.ino index 4cf7da9..1abaf1f 100644 --- a/firmware/webUpdater.ino +++ b/firmware/webUpdater.ino @@ -85,11 +85,11 @@ void hb_webstat_send(void) { httpServer.send(200, "text/html", hb_ws_msg_start + hb_ws_msg_temp + - String(_webUpdater_sensValues[SENSOR_TEMPERATURE], 2) + + String(_webUpdater_sensValues[SENSOR_TEMPERATURE], 2) + ", " + hb_ws_msg_humi + - String(_webUpdater_sensValues[SENSOR_HUMIDITY], 2) + + String(_webUpdater_sensValues[SENSOR_HUMIDITY], 2) + ", " + hb_ws_msg_light + - String(_webUpdater_sensValues[SENSOR_LIGHT], 2) + + String(_webUpdater_sensValues[SENSOR_LIGHT], 2) + ", " + hb_ws_msg_windspeed + String(_webUpdater_sensValues[SENSOR_WINDSPEED], 2) + hb_ws_msg_end);