Influx2 upload stopped after upgrade

Hi there, first time posting on the forums so I hope I’m pasting in the log correctly.

My IotaWatt recently auto-updated from 02_06_02 to 02_06_05 and since the reboot it no longer uploads to my influxdb instance. Nothing stands out in the logs so I’m not sure where to go from here other than start over.

Thanks!
Rob

** Restart **

SD initialized.
8/01/21 14:23:55z Real Time Clock is running. Unix time 1627827835 
8/01/21 14:23:55z Reset reason: Software/System restart
8/01/21 14:23:55z Trace:  11:22, 11:21, 11:22, 11:20[4], 11:20[5], 11:20[6], 11:20[7], 11:25, 11:30, 11:31, 11:30, 11:35, 11:40, 31:100, 31:100, 31:100, 31:100, 31:101, 31:102, 29:101, 29:101, 29:101, 29:101, 29:102, 29:102, 29:103, 29:103, 31:105, 31:105, 31:106, 11:45, 11:70
8/01/21 14:23:55z ESP8266 ChipID: 8913142
8/01/21 14:23:55z IoTaWatt 5.0, Firmware version 02_06_02
8/01/21 14:23:55z SPIFFS mounted.
8/01/21 08:23:55 Local time zone: -7:00
8/01/21 08:23:55 Using Daylight Saving Time (BST) when in effect.
8/01/21 08:23:55 device name: Bastion
8/01/21 08:23:55 HTTP server started
8/01/21 08:23:55 influxDB_v2: Starting, interval:10, url:http://192.168.2.99:58086/api/v2
8/01/21 08:23:55 timeSync: service started.
8/01/21 08:23:55 statService: started.
8/01/21 08:23:55 dataLog: service started.
8/01/21 08:23:55 dataLog: Last log entry 08/01/21 08:20:40
8/01/21 08:24:00 historyLog: service started.
8/01/21 08:24:00 historyLog: Last log entry 08/01/21 08:20:00
8/01/21 08:27:06 WiFi connected. SSID=Beach House, IP=192.168.2.190, channel=6, RSSI -94db
8/01/21 08:27:06 MDNS responder started for hostname Bastion
8/01/21 08:27:06 LLMNR responder started for hostname Bastion
8/01/21 08:27:06 Updater: service started. Auto-update class is MINOR
8/01/21 08:27:08 Updater: Auto-update is current for class MINOR.
8/01/21 08:31:06 influxDB_v2: Start posting 08/01/21 08:31:10
8/02/21 18:30:43 Updater: Invalid response from server. HTTPcode: -4
8/04/21 09:37:52 WiFi disconnected.
8/04/21 09:39:32 WiFi connected. SSID=Beach House, IP=192.168.2.190, channel=6, RSSI -93db
8/04/21 09:43:23 WiFi disconnected.
8/04/21 09:46:02 WiFi connected. SSID=Beach House, IP=192.168.2.190, channel=6, RSSI -87db
8/07/21 12:42:23 Updater: Update from 02_06_02 to 02_06_05
8/07/21 12:42:23 Updater: download 02_06_05
8/07/21 12:42:36 Updater: Release downloaded 13870ms, size 834296
8/07/21 12:42:45 Updater: signature verified
8/07/21 12:42:53 Updater: firmware upgraded to version 02_06_05
8/07/21 12:42:53 Updater: Firmware updated, restarting.

** Restart **

SD initialized.
8/07/21 18:43:02z Real Time Clock is running. Unix time 1628361782 
8/07/21 18:43:02z Reset reason: Software/System restart
8/07/21 18:43:02z Trace:  18:2, 18:3, 18:2, 18:3, 18:2, 18:3, 18:2, 18:3, 18:4, 18:5, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[2], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[3], 29:60, 31:1, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[3], 1:5[5], 1:6[4], 5:0, 5:7
8/07/21 18:43:02z ESP8266 ChipID: 8913142
8/07/21 18:43:02z IoTaWatt 5.0, Firmware version 02_06_05
8/07/21 18:43:02z Updater: Installing update files for version 02_06_05
8/07/21 18:43:02z Updater: Installing GRAPH.HTM
8/07/21 18:43:02z Updater: Installing GRAPH.JS
8/07/21 18:43:02z Updater: Installing GRAPH2.HTM
8/07/21 18:43:02z Updater: Installing GRAPH2.JS
8/07/21 18:43:03z Updater: Installing INDEX.HTM
8/07/21 18:43:04z Updater: Installing TABLES.TXT
8/07/21 18:43:04z Updater: Installing CNFSTYLE.CSS
8/07/21 18:43:04z Updater: Installing EDIT.HTM
8/07/21 18:43:04z Updater: Installation complete.
8/07/21 18:43:04z SPIFFS mounted.
8/07/21 12:43:04 Local time zone: -7:00
8/07/21 12:43:04 Using Daylight Saving Time (BST) when in effect.
8/07/21 12:43:04 device name: Bastion
8/07/21 12:43:04 HTTP server started
8/07/21 12:43:05 influxDB_v2: Starting, interval:10, url:http://192.168.2.99:58086
8/07/21 12:43:05 timeSync: service started.
8/07/21 12:43:05 statService: started.
8/07/21 12:43:05 dataLog: service started.
8/07/21 12:43:05 dataLog: Last log entry 08/07/21 12:42:35
8/07/21 12:43:10 historyLog: service started.
8/07/21 12:43:10 historyLog: Last log entry 08/07/21 12:42:00
8/07/21 12:43:15 WiFi connected. SSID=Beach House, IP=192.168.2.190, channel=6, RSSI -77db
8/07/21 12:43:15 MDNS responder started for hostname Bastion
8/07/21 12:43:15 LLMNR responder started for hostname Bastion
8/07/21 12:43:15 Updater: service started. Auto-update class is MINOR
8/07/21 12:43:18 Updater: Auto-update is current for class MINOR.

** Restart **

SD initialized.
8/08/21 05:37:51z Real Time Clock is running. Unix time 1628401071 
8/08/21 05:37:51z Power failure detected.
8/08/21 05:37:51z Reset reason: External System
8/08/21 05:37:51z ESP8266 ChipID: 8913142
8/08/21 05:37:51z IoTaWatt 5.0, Firmware version 02_06_05
8/08/21 05:37:52z SPIFFS mounted.
8/07/21 23:37:52 Local time zone: -7:00
8/07/21 23:37:52 Using Daylight Saving Time (BST) when in effect.
8/07/21 23:37:52 device name: Bastion
8/07/21 23:37:55 Connecting with WiFiManager.
8/07/21 23:38:03 HTTP server started
8/07/21 23:38:03 influxDB_v2: Starting, interval:10, url:http://192.168.2.99:58086
8/07/21 23:38:03 WiFi connected. SSID=Beach House, IP=192.168.2.190, channel=6, RSSI -77db
8/07/21 23:38:03 MDNS responder started for hostname Bastion
8/07/21 23:38:03 LLMNR responder started for hostname Bastion
8/07/21 23:38:03 timeSync: service started.
8/07/21 23:38:03 statService: started.
8/07/21 23:38:03 Updater: service started. Auto-update class is MINOR
8/07/21 23:38:03 dataLog: service started.
8/07/21 23:38:03 dataLog: Last log entry 08/07/21 23:37:35
8/07/21 23:38:05 Updater: Auto-update is current for class MINOR.
8/07/21 23:38:08 historyLog: service started.
8/07/21 23:38:08 historyLog: Last log entry 08/07/21 23:37:00
8/08/21 00:08:29 influxDB_v2: stopped, Last post 02/05/06 23:28:16
8/08/21 00:21:47 Restart command received.

Can you post your influx setup display and the status display with the uploaders and datalog tabs expanded?

The uploader status says “httpcode %d404” which I assume means it can’t contact my influx instance but nothing has changed on that side. It would sure be a coincidence for the influx server to stop responding right after the upgrade.
To be sure, I verified the influx server is up and responding on the configured IP:port.


You’re probably right, and you may have evidence of that, but the only thing that’s clear from the posted log is that it wasn’t working after the upgrade. It may have stopped up to three days before that, which wouldn’t be coincident…

Can you look at the data and see where it leaves off?

What changed between 02 and 05 was that the /api/v2 is removed from the URI and was made part of the standard query and write URI. This was because there was confusion about whether it was needed and with the change it should work either way.

But just to cover that base, can you remove the /api/v2 from your URL and try that?

I’ll be in and out today, so I’ll check back later.

I removed the /api/v2 from the influx URL and verified via packet capture that it’s hitting the correct URI.

I stopped the influxdb service, started the capture, then started the influx service again so the attached capture shows the initial query that iotawatt makes to the influx server.

What’s interesting is that the 404 response says that the bucket cannot be found but it most certainly exists.

Here’s the pcap file just renamed with .txt so it would upload to the site.
iotawatt-influx.txt (1.3 KB)

Something is not right here. The query shows that your tag-key “device” is set to tag-value “$device” but the influx setup that you posted shows it as “iotawatt”. I believe that may be the problem. Can you shed light on this situation?

Also, did you manage to look at the data that has been upload to determine when the uploads stopped?

I originally had it as $device but changed it to “IotaWatt” while troubleshooting after reading a different forum post. Changing it to either one doesn’t yield any change.

My last data point was at 12:42:10am on the 7th.

I’m going to take the http request and try to manually send it via curl. Other than that I’ll keep digging.

Should I try a reset or new/old firmware upload on it? It’s a recent purchase so I don’t have a lot of configuration on it.

Ok, so it did stop at the update.

It won’t work with $device. That is a bug that is fixed and waiting for the next release. You also probably are scratching your head at the query. That’s also changed in the next release but should work for your purposes as long as key device=iotawatt (doesnt use the $device variable).

I’d be interested in the pcap with the $device removed.

Do you have a file 02_06_02.bin in directory /download/?

Unfortunately it’s just as exciting as the first one.

Yes, it’s there.

iotawatt-influx2.txt (4.0 KB)

The query is interesting with all the redundant “or” operations but maybe that’s what you were referring to when you said I’d be scratching my head on the query.

from(bucket: "bastion")
  |> range(start: 1628471780, stop: 1628475380)
  |> filter(fn: (r) => r["device"] == "iotawatt" and (r["_measurement"] == "iotawatt" or r["_measurement"] == "iotawatt" or r["_measurement"] == "iotawatt" or r["_measurement"] == "iotawatt" or r["_measurement"] == "iotawatt" or r["_measurement"] == "iotawatt"))
  |> last()
  |> map(fn: (r) => ({_measurement: r._measurement, _time: (uint(v:r._time)) / uint(v:1000000000)}))
  |> sort (columns: ["_time"], desc: true)

If you want to try reverting to 02_06_02, it’s pretty easy.

First, you would need to add the /api/v2 back into the URL.

Set auto-update class to NONE.

Enter this URL into your browser:
http://iotawatt.local/update?release=02_06_02

It will take a few seconds to install the firmware and then your unit will restart under 02_06_02.

Well, the rollback worked and it’s uploading data once again.

One thing I noticed is that with 02_06_02 it doesn’t seem to do an initial influx query but just goes straight to writing? What prompts the query to happen?

Should I try updating to 02_06_05 again to see what happens?

It does a query, but there is a problem with the query and so it ends up restarting at the current time. 02_06_05 fixes that but doesn’t work for you.

Let’s wait and see if anyone else reports this problem. At this point I have no idea what is going on. So if you want to just sit on this release and I’ll message you when another release comes out or if I discover the problem and a workaround.

One last thing. I just want to verify that 192.168.2.99 is the host where influxDB2 is installed and not a proxy server.

Sounds good, I’ll stick on this release and watch the forum and follow the github repo.

Yes, that is the IP of the host which runs influxdb in docker. No proxies involved.

Thanks for the support on this.

This seems to have removed the 404 issue for me also by rolling back as per the suggestion. Still waiting on a lot of data to upload but seems better

9/16/21 06:21:17 Updater: update tables from 0.0.2 to 0.0.3
9/19/21 19:23:39 influxDB_v2: Starting, interval:10, url:http://192.168.1.10:8086
9/19/21 19:23:40 influxDB_v2: Start posting 01/01/21 01:00:10
9/19/21 19:36:51 influxDB_v1: stopped, Last post 09/18/21 22:18:00
9/19/21 20:10:34 influxDB_v2: stopped, Last post 01/05/21 02:26:10
9/19/21 20:10:47 influxDB_v2: Start posting 01/01/21 01:00:10
9/19/21 20:18:56 Restart command received.

Now I have

Stop influxDB2: Running, Last update 01/01/2021 13:38:00

Seems was my failure, I used the id not the name of the bucket.

1 Like