Help setting up influxdb2 with signalk
Reposting here for visibility
Hello everyone I am trying to setup a new signal k server and I am working on getting the signalk-to-influxdb2 plugin working. I got influxdb installed I created a user, org, and bucket. The token is working with signalk but it says the org does not exist even though when I login to the ui I see both the org and the bucket. Not sure how to troubleshoot further since eveything seems to be there.
Thanks in advance for the help! ๐
Screenshots in ๐งต
https://discord.com/channels/1170433917761892493/1170454794708717568/1225615312385347645
3 Replies
I had an influx 1.8 db that was working, and I upgraded it to 2.7. I also upgraded the signalk plugin, including the API key. When the plugin runs, it successfully executes this SELECT statement with no errors, but it never writes the location or other data to the database. My grafana database visualizatioin stop at the time I did the upgrade.
2024-07-23T00:24:27.707034Z info Executing query {"log_id": "0qZDg6FG000", "service": "query", "query": "SELECT first(lat) AS lat, first(lon) AS lon FROM abientot.autogen."navigation.position" WHERE context = 'vessels.urn:mrn:signalk:uuid:ee0c6d7c-a873-4794-ba66-1a54ffbb80a7' AND time >= '2024-07-22T00:00:00Z' AND time <= '2024-07-22T17:24:27.694Z' GROUP BY time(1m)"}
When I restart, I see this in the SignalK log, but no indication that it's actually writing data back out:
Jul 22 17:27:23 2024-07-23T00:27:23.967Z signalk-to-influxdb2 getDailyLogData
Jul 22 17:27:23 2024-07-23T00:27:23.970Z signalk-to-influxdb2 select first(lat) as lat, first(lon) as lon from "navigation.position" where "context" = 'vessels.urn:mrn:signalk:uuid:ee0c6d7c-a873-4794-ba66-1a54ffbb80a7' and time >= '2024-07-22T00:00:00Z' and time <= '2024-07-22T17:27:23.968Z' group by time(60000ms)
Jul 22 17:27:24 signalk-server running at 0.0.0.0:[object Object]
Jul 22 17:27:24 2024-07-23T00:27:24.120Z signalk-to-influxdb2 0
Do I have to do something to tell the signalk-to-influxdb2 plugin to write data?
In grafana, if I look for "last 5 minutes", I get 'no data'. I've tried both "default" and "autogen"
welp, this is odd. In the influx explorer, I can see all the data. But in grafana, I can only see data up to the upgrade.
Ok. So I changed my Grafana dashboard from the InfluxSQL version the Flux version, and now it's working. But I don't get the nice query builder, so I used this query instead. (This query came from the Influx Data Explorer):
from(bucket: "abientot")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment.depth.belowTransducer")
|> filter(fn: (r) => r["_field"] == "value")
|> aggregateWindow(every: 15s, fn: mean, createEmpty: false)
|> yield(name: "mean")
summary: Flux is better than InfluxSQL because I can see all of my data, but there's no point-and-click query builder in Grafana, but there is one in InfluxDB Data Explorer.
Then I used Gemini to modify the Flux query to convert from Meters to Feet, and ended up with this:
Many people use influx Web page to build the query then copy paste into grafana.
This is strange. The signalk plugin started showing unauthorized errors. I went to the influxdb web page and it took me through first time setup. I created a new organization and user and API key, and created a new grafana connection. Strange that the server reset itself, somehow?