From a210c9472108662c9e7df32d521cc94bcf6965ca Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Fri, 11 Nov 2022 13:25:28 +0100 Subject: [PATCH] Removed temperature overwriting. Added some disabled debug output messages. Reformatted code. --- firmware/firmware.ino | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 01133d4..b87ff8f 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -376,10 +376,12 @@ void loop() { //*************************************************************************// #ifndef BATTERY_POWERED -void _fsm_loop() { +void _fsm_loop() +{ #ifdef WEBUPDATER_FEATURE - if ((update_webserver_cnt + (UPDATE_WEBSERVER_INTVERVAL_MS)) <= millis()) { + if ((update_webserver_cnt + (UPDATE_WEBSERVER_INTVERVAL_MS)) <= millis()) + { //debug("web updater call"); update_webserver_cnt = millis(); doWebUpdater(); @@ -391,12 +393,15 @@ void _fsm_loop() { { // send the data to the server debug("Sending weather json data to http webserver"); + //debug(String(0) + "=" + String(currentSensorData[0])); + //debug(String(SENSOR_TEMPERATURE) + "=" + String(currentSensorData[SENSOR_TEMPERATURE])); http_call_send_json_data_cnt = millis(); http_call_send_json_data(); } #endif - switch (fsm_state) { + switch (fsm_state) + { /* -------------------------------------------------------------------------------- */ case FSM_STATE_1: @@ -688,7 +693,7 @@ String getJsonData() String(currentSensorData[SENSOR_TEMPERATURE], 2) + ", " + hb_ws_msg_humi + - String( (isnan(currentSensorData[SENSOR_HUMIDITY]) ? 0.0 : currentSensorData[SENSOR_HUMIDITY]), 2) + + String((isnan(currentSensorData[SENSOR_HUMIDITY]) ? 0.0 : currentSensorData[SENSOR_HUMIDITY]), 2) + ", " + hb_ws_msg_light + String(currentSensorData[SENSOR_LIGHT], 0) + // The light level for the homebridge-http-lux2 plugin is only able to parse integer values @@ -711,8 +716,6 @@ String getJsonData() void http_call_send_json_data() { - - currentSensorData[sensor_cnt] = measure_wind_result(); //debug("http call to " + String(HTTP_CALL_SEND_JSON_DATA_URL)); // windspeed exceeded send http call