This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Influxdb to Grafana databases
#1
Hi everyone,
     Ok, I have my RPi 4, a USB GPS reciever, a BMP 180 sensor and I have a Motessier Hat 2 that should be here by the end of the week. I've got the RPi st up with the Headless version, that works well and I can login over VNC with no problem. I somehow stumbled through getting the USB GPS to actually work in OpenCPN...
I followed this tutorial https://nwmichl.net/2020/07/14/telegraf-...m-scratch/
in order to set up an Influxdb Database and then link it to Grafana with a Dashboard (monitoring Rpi temps and CPU usage), it actually works...I'm amazed.

     So, my question is: In order to set up new databases to monitor environmental data (Baro, Temp, etc...) do I need to go into Influx and create a new Database, and give permissions like I did in the example in the tutorial? I think I do but I haven't read that explicitly anywhere... I am not a programmer by any means...I don't know how I got this far with so few problems...lol...

     Another question: When I'm setting up a new Dashboard in Grafana do I need to go into the Configuration>Data sources tabs and pick a new Influxdb source (and name it Influxdb 1, 2 etc...) for each data set or Dashboard that I wand to make or will the one that is currently there (Default) work for everything.
Many thanks,

Rick
Reply
#2
Anybody????
Many thanks,

Rick
Reply
#3
Just had a play on a win10 laptop. Entering a new database name in the siganlk plugin config created a new database in influx

[Image: icwLt5Q.png]

That was all that was required for siganlk to write to influxdb, the data was then available to view in grafana. You could check influx is running OK by pasting this into a terminal >
sudo systemctl status influxd

Also in a terminal, you should get into influx by typing "influx"

Then "show databases" to see what databases exist. Then "quit" to get back out of influx to the command line.
Reply
#4
Thanks for the answer, but maybe I'm not asking the question the right way....I'm really a Software Dumba$$...If you were to hold a gun to my head and say Program Hello World...you'd just have to pull the Trigger...lol...I'm an Aircraft Engineer...I'll design and build anything you can dream of on the "Hardware" side of things, but Software and Programming...No...

 Let me see if I can phrase the question better...I've been trying to use the Videos from Boating with the Baileys to make some Databases for data that I want to log over a period of time. Barometric Pressure, Environmental Temps, Battery usage etc...   In this Video: SignalK to InfluxDB
he goes in through Chronograf and to InfluxDB Admin. to add a database. (He has Influx-1) I like this way as it's easier than trying to do it through the Rpi Terminal in my opinion.

Now...my question is....Do I need to go into Chronograf and set up a different database for every Sensor that I want to Log? Like, do I need to have a Database for a BMP280 and another for a 1Wire Freezer Temp. Sensor and another for Battery Data etc... or does all the Data flow into the single Influx-1 DB and is available there to then use in SignalK?

He then goes on to link the Influx-1 DB to SignalK through the Plugin Config>InfluxDB writer and adds the DB name (Influx-1) to the Database field. If all of the data is being written to one database how do I retrieve the data that I want to use? He goes on to explain about the SignalK Paths and White and Black lists in InfluxDb writer...that kind of lost me, unless it means all of the data is in the one database and you can pick it out by White listing it...

The logged data from Influx I'd then like to bring into Grafana and make a Dashboard.

Oh God...I'm confusing myself with the question...lol...

I don't know if I've made the question any clearer or not...I really want to set up my Boat completely with a Pi based system and OpenPlotter I just need to find a step-by-step method of doing all the programming side of it. I'm like a Parrot...I may not know what it means but if I can get a method down I can repeat it forever...
Many thanks,

Rick
Reply
#5
"Now...my question is....Do I need to go into Chronograf and set up a different database for every Sensor that I want to Log? "
If you are using the signalk - influxdb plug in then you just need to tell the plugin the address of influx, usually same as the screenshot in post 3. That's it, then the plugin will create the database if it doesn't exist and write the measurements, so in chronograf/grafana you will see , say, database - "tempDb", measurements - "environment.wind.speedApparent" etc.

Then to set up grafana you go into configuration/datasources and fill in the address of influxdb and the database name

[Image: M1oezoB.png]

After that all the saved measurements should appear in the dropdown box >
[Image: x8mDWyD.png]
Reply
#6
Yessssss.....Thank you...I've got the 1w Sensor data available....Much appreciated...

Any Idea how to convert the Temp. data in Grafana from °K to °C on a Chart?
Many thanks,

Rick
Reply
#7
(2021-09-11, 03:34 PM)rfe3 Wrote: Yessssss.....Thank you...I've got the 1w Sensor data available....Much appreciated...

Any Idea how to convert the Temp. data in Grafana from °K to °C on a Chart?

To go from Kelvin to DegC you need to add a math select function >>

[Image: 0WMBNGU.png]
Reply
#8
Thank you again , You're awesome....
I have a question about the Retention Policy in Chronograf. If I set it for like 7 days or whetever, does it only show the 7 days of data or does it erase everything more than 7 days old?
Many thanks,

Rick
Reply
#9
(2021-09-12, 09:54 AM)rfe3 Wrote: Thank you again , You're awesome....
I have a question about the Retention Policy in Chronograf. If I set it for like 7 days or whetever, does it only show the 7 days of data or does it erase everything more than 7 days old?

In chronograf the retention policy is what influxdb is set to, change it in chron then influxd gets changes, so set to 7d everything older gets dropped from the database. I run a Pi Zero with signalk then have a little python which copies the latest data from the Pi influx onto my laptop influx which sves forever, the Pi Zero is too slow to run chronograf or grafana.
Reply
#10
I’m also in need of some more detailed Influx/Grafana tutorials.

I’ve installed InfluxDB, the SignalK influx plugin and Grafana. I created a database to store SignalK data hoping to create an almost live view battery and electrical system monitor.

My issue is that the longer I leave Grafana running in a live-view type setup the slower my Pi 3B+ runs until the point it more or less locks up my system. I’ve tried to adjust the parameters in Influx and Grafana to consume fewer resources however I’m still struggling with this. What seems to make things worse is when I incorporate graphs showing longer term trends. Ultimately Grafana seizes up while trying to refresh each panel.

Any suggestions on how to get this working or are the Pi 3’s just too underpowered?

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)