Repeated failure of influx uploader - resolved

Hi,

I am running IoTaWatt 5.0, Firmware version 02_07_04 configured to upload to and influxDB instance on local LAN. I have a repeated issue where the Iotawatt will stop uploading to InfluxDB, which apparently corresponds to every time the unit reboots (for whatever reason - manually rebooting the unit causes the issue).

The uploader status is ‘Query failed, code 400, response:’

The only way I have found to restart the upload is to clear the Iotawatt logs and then to perform the ‘voodoo’ steps of deleting the tag set entries in the Influx configuration and re-adding them. This consistently works.

Any help with this would be greatly appreciated as I cannot see anything obviously wrong from a configuration perspective. Most recent log below.

Many thanks

Jon

** Restart **

SD initialized.
12/11/21 12:33:23z Real Time Clock is running. Unix time 1639226003
12/11/21 12:33:23z Reset reason: Software/System restart
12/11/21 12:33:23z Trace: 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:1[3], 1:2[4], 9:0[4], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:21, 10:22
12/11/21 12:33:23z ESP8266 ID: 12704066, RTC PCF8523
12/11/21 12:33:23z IoTaWatt 5.0, Firmware version 02_07_04
12/11/21 12:33:23z SPIFFS mounted.
12/11/21 12:33:23z Local time zone: +0:00, using DST/BST when in effect.
12/11/21 12:33:23z device name: IotaWatt
12/11/21 12:33:23z HTTP server started
12/11/21 12:33:23z influxDB_v1: Starting, interval:10, url:[blanked out]
12/11/21 12:33:23z timeSync: service started.
12/11/21 12:33:23z statService: started.
12/11/21 12:33:23z dataLog: service started.
12/11/21 12:33:23z dataLog: Last log entry 12/11/21 12:33:20
12/11/21 12:33:23z historyLog: service started.
12/11/21 12:33:23z historyLog: first entry 11/27/21 16:27:00
12/11/21 12:33:27z deletelog=current command received.

** Restart **

SD initialized.
12/11/21 12:33:30z Real Time Clock is running. Unix time 1639226010
12/11/21 12:33:30z Reset reason: Software/System restart
12/11/21 12:33:30z Trace: 9:5, 9:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[3], 1:5[14], 1:6[4], 14:0, 14:4, 14:5, 14:7, 14:8, 1:6[6], 1:1[1], 1:2[2], 9:0[2], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:21, 10:21
12/11/21 12:33:30z ESP8266 ID: 12704066, RTC PCF8523
12/11/21 12:33:30z IoTaWatt 5.0, Firmware version 02_07_04
12/11/21 12:33:30z SPIFFS mounted.
12/11/21 12:33:30z Local time zone: +0:00, using DST/BST when in effect.
12/11/21 12:33:30z device name: IotaWatt
12/11/21 12:33:30z HTTP server started
12/11/21 12:33:30z influxDB_v1: Starting, interval:10, url:[blanked out]
12/11/21 12:33:30z timeSync: service started.
12/11/21 12:33:30z statService: started.
12/11/21 12:33:30z dataLog: service started.
12/11/21 12:33:30z dataLog: New current log created.
12/11/21 12:33:30z dataLog: Last history entry: 11/27/21 18:07:00
12/11/21 12:33:36z WiFi connected. SSID=riverside-services_IoT, IP=192.168.2.65, channel=11, RSSI -77db
12/11/21 12:33:36z MDNS responder started for hostname IotaWatt
12/11/21 12:33:36z LLMNR responder started for hostname IotaWatt
12/11/21 12:33:36z Updater: service started. Auto-update class is BETA
12/11/21 12:33:37z Updater: Auto-update is current for class BETA.
12/11/21 12:34:04z influxDB_v1: Start posting at 12/11/21 12:33:40
12/11/21 12:34:35z historyLog: service started.
12/11/21 12:34:35z historyLog: Last log entry 11/27/21 18:07:00
12/11/21 12:42:49z Restart command received.

** Restart **

SD initialized.
12/11/21 12:42:51z Real Time Clock is running. Unix time 1639226571
12/11/21 12:42:51z Reset reason: Software/System restart
12/11/21 12:42:51z Trace: 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[3], 1:5[14], 1:6[4], 14:0, 1:6[6], 1:1[1], 1:2[2], 9:0[2], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 10:2, 10:3
12/11/21 12:42:51z ESP8266 ID: 12704066, RTC PCF8523
12/11/21 12:42:51z IoTaWatt 5.0, Firmware version 02_07_04
12/11/21 12:42:51z SPIFFS mounted.
12/11/21 12:42:51z Local time zone: +0:00, using DST/BST when in effect.
12/11/21 12:42:51z device name: IotaWatt
12/11/21 12:42:51z HTTP server started
12/11/21 12:42:51z influxDB_v1: Starting, interval:10, url:[blanked out]
12/11/21 12:42:51z timeSync: service started.
12/11/21 12:42:51z statService: started.
12/11/21 12:42:51z dataLog: service started.
12/11/21 12:42:51z dataLog: Last log entry 12/11/21 12:42:45
12/11/21 12:42:51z historyLog: service started.
12/11/21 12:42:51z historyLog: Last log entry 12/10/21 23:51:00
12/11/21 12:43:04z WiFi connected. SSID=riverside-services_IoT, IP=192.168.2.65, channel=11, RSSI -78db
12/11/21 12:43:04z MDNS responder started for hostname IotaWatt
12/11/21 12:43:04z LLMNR responder started for hostname IotaWatt
12/11/21 12:43:04z Updater: service started. Auto-update class is BETA
12/11/21 12:43:06z Updater: Auto-update is current for class BETA.

Please post you influx setup display.

There are several other measurements - 20 in total.

Thank you

I’ll need to try to recreate this to say definitively, but in the short run, could you try using the actual device name in the first tag value field instead of $device?

Let me know if that works please.

Thank you. I have tried changing the $device to a hardcoded value and then restarted the device and I get the same error behaviour - the upload stops.

Thanks

Can I see all of the measurements please?

Sure:

I can recreate the problem by using two tags, but the query seems to be correctly formed, so it’s going to take some digging and maybe an issue with influx.

In the meantime, It works for me with only one tag. Are you sure you need the device tag?

Hi.

I have tried removing the ‘device’ tag and just leaving the ‘name’ tag (which I definitely need to differentiate the readings). If I do a remote restart of the unit I get the same behaviour - Query failed, code 400, response and uploading stops. If I then delete the ‘name’ tag and re-add it it starts working again, as previously.

Bingo! Looking it up, NAME is a Keyword in the influx Query language. I would need to double quote it in the query. I can add double quotes to the tag-name fields in the future, but you won’t see it in a release for a long time. Moreover, you will be faced with the same problem as you try to use that tag-name in your own queries.

I’d recommend you change that tag-name to something that is not a Keyword.

Ah, thank you!

I have updated to move away from using ‘Name’ as a tag and that appears to be working (survives a restart).

Your help is very much appreciated

Thanks

Jon