diff --git a/firmware/influxdb.ino b/firmware/influxdb.ino index 8356d43..0e0b881 100644 --- a/firmware/influxdb.ino +++ b/firmware/influxdb.ino @@ -72,6 +72,12 @@ void pushToInfluxDB(String device, float sensorValues[]) { addComma = true; } +#ifdef LOG_MILLIS_TO_INFLUXDB + if (true == addComma) + msg += ","; + msg += "timestamp=" + String(millis()); +#endif + debug(msg); do { @@ -158,6 +164,12 @@ void pushToInfluxDB(String device, float sensorValues[]) { _writePoint(); } +#ifdef LOG_MILLIS_TO_INFLUXDB + sensor.clearFields(); + sensor.addField("timestamp", millis()); + _writePoint(); +#endif + } void _writePoint() { diff --git a/firmware/webUpdater.ino b/firmware/webUpdater.ino index 16aedf1..b2a336e 100644 --- a/firmware/webUpdater.ino +++ b/firmware/webUpdater.ino @@ -89,11 +89,6 @@ void showHTMLMain(void) void hb_webstat_send(void) { - unsigned int timestamp = 0; - for (int i = 0; i < VALUES; i++) - { - timestamp += int(_webUpdater_sensValues[i]) + millis(); - } String msg = hb_ws_msg_start + hb_ws_msg_temp + String(_webUpdater_sensValues[SENSOR_TEMPERATURE], 2) + @@ -111,7 +106,7 @@ void hb_webstat_send(void) String(_webUpdater_sensValues[SENSOR_PRESSURE], 2) + ", " + hb_ws_msg_timestamp + - String(timestamp) + + String(millis()) + hb_ws_msg_end; httpServer.send(200, "text/html", msg);