504 error in log with InfluxDB - resolved

Hey Bob,

Trying to get Influx up and running for my IOTAWatt

I currently use Node-Red to post other data to Influx so i know it is working - no authentication for the initial deployment.

Many times after making changes to the Server definition i will get the following popup

After i have configured the Influx Web server and then gone to the status screen and tried to start the InfluxDB engine i get the following in my log

SD initialized.
11/30/20 03:30:39z Real Time Clock is running. Unix time 1606707039
11/30/20 03:30:39z Reset reason: Software/System restart
11/30/20 03:30:39z Trace: 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:3, 1:4, 1:1[3], 1:2[6], 9:0[6], 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
11/30/20 03:30:39z ESP8266 ChipID: 6346788
11/30/20 03:30:39z IoTaWatt 5.0, Firmware version 02_05_11
11/30/20 03:30:39z SPIFFS mounted.
11/30/20 14:30:39 Local time zone: +10:00
11/30/20 14:30:39 Using Daylight Saving Time (BST) when in effect.
11/30/20 14:30:39 device name: IotaWatt
11/30/20 14:30:39 HTTP server started
11/30/20 14:30:39 timeSync: service started.
11/30/20 14:30:39 statService: started.
11/30/20 14:30:39 dataLog: service started.
11/30/20 14:30:39 dataLog: New current log created.
11/30/20 14:30:40 dataLog: Last history entry: 11/30/20 14:30:00
11/30/20 14:30:44 EmonService: started. url=HTTP://172.16.100.20/emoncms, node=IotaWatt, interval=10
11/30/20 14:30:44 influxDB: started, url=HTTP://172.16.100.37:8086, db=iotawattsb, interval=10
11/30/20 14:30:45 WiFi connected. SSID=CURTIN-G, IP=172.16.100.200, channel=7, RSSI -83db
11/30/20 14:30:45 MDNS responder started for hostname IotaWatt
11/30/20 14:30:45 LLMNR responder started for hostname IotaWatt
11/30/20 14:30:45 Updater: service started. Auto-update class is MINOR
11/30/20 14:30:45 influxDB: Last entry query failed.
11/30/20 14:30:45 influxDB: HTTPcode 405, Method Not Allowed

11/30/20 14:30:45 influxDB: Stopped. Last post 11/30/20 01:00:00
11/30/20 14:30:46 EmonService: Start posting at 11/30/20 14:30:40
11/30/20 14:30:47 Updater: Auto-update is current for class MINOR.
11/30/20 14:31:39 historyLog: service started.
11/30/20 14:31:39 historyLog: Last log entry 11/30/20 14:30:00

I have essentially used this as the guide (once i ran into troubles) and can not see where i am going wrong. I am using the same server as i put data out to with Node Red and i use no authentication there either.

https://brettbeeson.com.au/iotawatt-and-influxdb-setup/

And a picture of the setup screen in the InfluxDB connection

I also saw in your blog post about INfluxDB some issue with not having data in a new Database and hence the query for the last data failing.

I took your suggestion in there to add an initial record to the database using

Insert Consumption first=0 1514764800000000

ANy ideas ??

Craig

I’m guessing that you are running the app on two different devices, editing the influx on one and then starting the service on another.

The config app reads the config.txt file at startup. When there is a change to anything, it makes the change in the fille and uploads it. IoTaWatt then does a reconfiguration. When there are multiple browsers running the config app, there needs to be a way to insure that they all have the latest config.txt file. IoTaWatt does that by maintaining a hash of the latest file. When sending an update, the app also sends the hash of the file before the update. If it doesn’t match the hash of the latest file, the update is rejected with the warning that you see, and the app loads the latest copy.

So that warning message has nothing to do with the 405 query response. I’ll take a look at that later.

UPDATE: 405 is method not allowed. IoTaWatt supports only the http: method, and that is what you are correctly using, however I believe your influxDB instance may be configured to require https:

Bob,

Thanks for the quick reply - definitely not loccked into HTTPS

Here is a screenshot of the definition that i use in Node-Red for the same server.

Yes i have EMONCMS and InfluxDB on two seperate Virtual machines (at the moment)

They both run on failry large and quick systems - Intel Core i5 with 32GB RAM and 500GB SSDs - so throughput of the VM is not an issue

image

And here is the one of the grafana datasources that i have defined

OK so i could have mutliple Browser windows open looking at the IOTAWatt status screen (which i do) - no biggie as long as that error is then spurious

What troubleshooting should i do in terms of the influx connection. ?

Craig

What version of influx are you using?

Here you go

image

regards

Craig

OK, that may be the problem. Version 0.10 looks to be at least 4 years old. The IoTaWatt support was developed on 1.7 and works on any subsequent 1.x release. Can you try to upgrade to 1.8?

You are the man !!!

After much messing around uninstalled and then upgraded and all is now working !!

Thanks once again for the great product and timely support.

Craig