diff --git a/README.md b/README.md index 2660a7c..1305601 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,14 @@ IR sensor to an [InfluxDB](https://www.influxdata.com/products/influxdb-overview under `Expert settings`. Contiously visualizing the readings with [Grafana](https://grafana.com/oss/grafana/) might help placing the TCRT5000 on your electricity meter to get better readings. +Note that InfluxDB version >=2 requires the Telegraf +[Socket Listener](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/socket_listener/README.md) +plugin to process UDP line protocol streams. + +
+ +
+ ## Contributing Pull requests are welcome! For major changes, please open an issue first to discuss diff --git a/assets/influxdb_sensor_data.png b/assets/influxdb_sensor_data.png new file mode 100644 index 0000000..87ecc37 Binary files /dev/null and b/assets/influxdb_sensor_data.png differ diff --git a/include/config.h b/include/config.h index 3c52081..db82659 100644 --- a/include/config.h +++ b/include/config.h @@ -77,7 +77,7 @@ // to make Arduino IDE happy // version number is set in platformio.ini #ifndef FIRMWARE_VERSION -#define FIRMWARE_VERSION 223 +#define FIRMWARE_VERSION 224 #endif // set default port for MQTT over TLS diff --git a/src/influx.cpp b/src/influx.cpp index 39caf0f..152f562 100644 --- a/src/influx.cpp +++ b/src/influx.cpp @@ -22,9 +22,9 @@ void send2influx_udp(uint16_t counter, uint16_t threshold, uint16_t pulse) { static char measurement[128]; uint32_t requestTimer = 0; - // create request with curr2ent/voltage values according to influxdb line protocol - // https://docs.influxdata.com/influxdb/v1.7/guides/writing_data/ - sprintf(measurement, "esp8266_power_meter,device=%s,counter=%d,threshold=%d,pulse=%d\n", + // create udp packet containing raw values according to influxdb line protocol + // https://docs.influxdata.com/influxdb/v2.4/reference/syntax/line-protocol/ + sprintf(measurement, "esp8266_power_meter,device=%s counter=%d,threshold=%d,pulse=%d\n", INFLUXDB_DEVICE_TAG, counter, threshold, pulse); // send udp packet