Hi Community!
I am a newbie user of Grafana and I wanted to check out if it nice to use with a Raspberry Pi setup measuring a few environmental variables. A python script reads out the sensor values and writes them into a SQLite database file (stored in the user home directory).
In Grafana, I installed the respective plugin and it shows up nicely in the web interface. However, if I enter the path to the db ("/home/pi/testdrive_db.db") I get an error message: “error checking db: unable to open database file: permission denied”.
I tried changing the permissions and changing the storage location, but the problem remains. Searching the web for this problem didn’t yield a solution, so I am hoping on this community to point to the mistake I made (probably).
Thanks a lot,
Thorben
I have several sensors across multiple 'Pis, all writing to the same database and showing results in Grafana. PhpMyAdmin and Grafana Server are on the same Pi, but that’s just my setup, they could just as happily be on different machines.
On Grafana, I have Data Source = MySQL, Host : localhost:3306
localhost would of course be an IP address if the mysql server were on a different 'Pi.
Does that help at all?
Good luck!
Thanks. Unfortunately, I don’t want to setup a database server and would be glad to just use the simple SQlite.
I think it has sth to do with the permission management. I just can’t figure out the solution. No matter where I store the db or which permissions I give (even 777), access is still denied for Grafana.
There was a recent change with the Grafana installation that can cause permission issues in the tmp
and $HOME
folders: GitHub - fr-ser/grafana-sqlite-datasource: Grafana Plugin to enable SQLite as a Datasource
In the link above you can find instructions how to circumvent this (or you can try moving your database)