I’ve been running my IotaWatt for a few years and exporting the data to Emoncms.
Now I’m about to pack it up for shipment (I sold it; that’s a long story).
I want to preserve all the data on the IotaWatt internal storage in some form of database, so I thought exporting to InfluxDB would be ideal.
I’ve tried to set up the InfluxDBv2 uploader, and it seems to succeed, but it looks like no data is actually getting uploaded. I’ve installed and configured InfluxDB-2.7.1 on my local host (127.0.0.1:8086).
As a learning exercise, I followed the tutorial for InfluxDB and successfully manually added data to my bucket and graphed it using a query.
Here is a screenshot of the uploader setup:
And here is a screenshot of the status screen:
Finally here are the last log entries:
To me it looks like the influxDB_v2 uploader isn’t sending data, as the status doesn’t show a “Last update” value. I copied and pasted the organization ID and authorization token from the InfluxDB UI, so I think those are correct. Also I set up the bucket “IotaData” in that UI, so it definitely exists. Is there something else I need to take care of in the db setup? Or is it a problem to have the db server be the local machine at 127.0.0.1?
127.0.0.1 is the IP address of the local machine. It is only reachable from that machine, is your PC. You need to provide Iotawatt the actual IP address of the PC where you installed InfluxDB.
BTW, clicking “Stop” for the influxDB2 uploader doesn’t appear to stop it; the button grays-out for several seconds, but keeps saying “Stop”. Whereas that button works for the Emoncms uploader as expected.
Thanks frogmore. That must be the issue. Will try and reply.
New uploader settings:
where the server is 192.168.21.127 and is on the same LAN as the IotaWatt unit.
Still there is something wrong:
Does HTTPcode 401 tell us something useful?
From this pc (at 192.168.21.127) I can ping the IotaWatt at its address 192.168.21.121.
Is there a way to open a shell on the Iotawatt to try to ping my pc from there?
For influxDB2, does the server need to be https?
If so, I’ll need to figure out how to make my pc run the influxdb daemon with the secure https protocol, whatever that entails. Would I be better off just installing influxDB1 on my pc server??
Success at last.
The HTTP 401 error told me it was an authentication issue.
It turns out somehow the organization ID was wrong; not sure how that happened, as I thought I had copied it from the DB UI already, but now it shows a different value than what I had copied before. For good measure I copied/pasted the auth token (which I had saved in a text file) again into the uploader setup field.
So now there is data coming into my InfluxDB and I’m thrilled!!
As soon as the total dataset from a few years ago gets uploaded, I can power down my IotaWatt for the last time and box it up. A sad day as it’s been very useful for what I needed it for.
You can only upload data from the current log, which is the past year. Since this is just for historical reference, you might consider if you need 10 second intrrvals. To view historical usage, perhaps one minute or even hourly or daily would be fine and reduce the upload time by an order of magnitude.