Influx/Grafana Help

Release = Raspbian GNU/Linux 10 (buster)
Kernel = Linux 4.19.75-v7l+
Platform = Raspberry Pi 4 Model B Rev 1.2
OH Version: 2.5

All,

I think I have everything setup as per what I have read in the forum and online via googling :slight_smile: , my problem is that I cannot seem to get anything other than “N/A” to show up in my test dashboard.

I have already done the following


image

image

image

image

Any help appreciated

Select the ‘plus’ for the SELECT line and add something appropriate - aggregation/mean would probably work for this.

image

Also, click on the ‘query inspector’ to see what data your query is returning.

Ok, gave that a try and got the following


In the GROUP BY line, try clicking on "time ($interval) and fill(null) and remove these. If you still have a mean in the SELECT line, remove this as well.

If you wish to use an agrigate function, you will need to specify a time interval.

You could also check your event log to ensure you have values for Temperature_GF-Living within the selected time period (top right time picker)

AntPow

So it looks like those values in the group cannot be removed, the mean in the SELECT line was removed, see below


image

In the event log I see the temp changing every10 sec, this is an mqtt value (not sure if it matters or not ?)

You should bisect your problem. See if data is being written into influx. Try using the command line and select the measurements after opening the database. See this InfluxDB getting started guide. Also, you should see the writes happening in your /var/log/syslog file (assuming you haven’t turned off the write logging). If this is good, proceed to debug Grafana. If you don’t see data, nothing you do in Grafana will help.

Keep clicking on the lowest triangle with response object and see if any data is returned in the array.

Very newbie, how do I


  1. use the command line to select the measurements after opening the database ?
  2. see the log (var/log/syslog) ?

Thanks

Take a look to this tutorial, my setup is base on it and is 100% functional.

It’s in German, but it’s quite visual to follow without understanding the language


Br

For #2, try this: grep -i influx /var/log/syslog

That will pull out all the Influx entries in the syslog. You can also use nano or any other text editor to examine the syslog. You will always see some activity assuming InfluxDB is running. What you are looking for are http writes to the database.

For #1, see the InfluxDB documentation. This getting started guide is very good. Basically something like this:

> show databases (will show databases)
> use openhab_db (or whatever you named it)
> show measurements (should see your Item here in the list)
> select * from Temperature_GF_Living

You should see a list of values for your measurement with their timestamp. You may need to use the user/password when starting up if you set that up. This will use the default retention policy. I’m guessing you haven’t changed that.

If you see the measurements, then you know the data is getting written, and your issue is only with setting up Grafana. If you can’t see the measurements, then we need to figure out why they are not written out.

jswim,

So when for #2 I get this (Note I am now looking at Temperature_GF_Office (I see it comes up)

And for number #1 I get this but I cannot seem to go any further or I am entering in something wrong ?

image

In regards to #1 I figured it out. I had to enter (as you mentioned).
influx -username “user” - password “pass” to get it to work.

I can see that the only database in there is openhab_db but show measurements returns the following


After some further research there seems to be a master user/pass, how would I find this and if I cannot how do I reset and start from scratch ?

Did you follow the instructions on this post originally? If so, that’s where you set the password for your database. Or did you follow some other guide? It seems like you didn’t grant the openhab user access to the openhab_db. Probably you did create an admin password?

$ influx
Connected to http://localhost:8086 version 0.13
InfluxDB shell version: 0.13
> CREATE DATABASE openhab_db
> CREATE USER admin WITH PASSWORD 'SuperSecretPassword123+' WITH ALL PRIVILEGES
> CREATE USER openhab WITH PASSWORD 'AnotherSuperbPassword456-'
> CREATE USER grafana WITH PASSWORD 'PleaseLetMeRead789?'
> GRANT ALL ON openhab_db TO openhab
> GRANT READ ON openhab_db TO grafana
> exit

In case you don’t remember what you did, you can stop influxdb, turn off authentication, start it up and enable it with a new password. See this for more information.

jswim,

I started from scratch (fresh SD install) and I am following the instructions (https://docs.influxdata.com/influxdb/v0.13/introduction/installation) however I get hung up here


v

Joselh,

Thanks for the vid, this essentially follows the setup instructions as per the official doc’s however I am getting stuck as per last post below
?

These are for an old version (0.13). I suggest to follow these instructions for the current version.

The errors you get are caused by the fact that DISTRIB_ID and DISTRIB_CODEBASE are probably not defined as environment variables. You should give them a proper value for the distribution you want,

What do you mean by “You should give them a proper value for the distribution you want”, sorry newbie here

OK, sorry about that :innocent:

I just noticed that you are running Raspbian and looks like you where using the Ubuntu install instructions. The install commands should look like this,(because Raspbian is a distribution based on Debian):

wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

All,

I am currently stuck on this step as per the documentation

How & Where do I access this config file ?

Thanks to another post I figured out how to get access to the files via Filezilla, I now edited the files are per above however when I take the influxdb.conf file from my the PI to PC for editing via visual code studio and try to place it back Filezilla comes up with an error


image

How can I get around this ?

Disregard please, I edited the file via sudo nano /etc/influxdb/influxdb.conf and the changes seemed to stick :slight_smile: