-
Notifications
You must be signed in to change notification settings - Fork 0
InfluxDB and Grafana Configuration
Important
- Start the InfluxDB and Grafana Configuration only after all the I2C Sensor Configuration steps have been completed.
- Make sure you type
cd
and hit enter to go to the home folder before the following steps
-
Clone the MyVivarium RPi-IoT repository into the home folder:
git clone https://github.com/myvivarium/RPi-IoT.git
-
cd
into the multisensors directory:cd RPi-IoT/multisensors
-
Run
influxdb-multisensor.py
:python influxdb-multisensor.py
You should begin to start seeing readings every minute from the sensors like this:
Let the script continue running.
-
In a new terminal window we will check if the infludb database "multisensors" has readings being sent to it:
docker exec -it influxdb influx
USE multisensors show measurements select * from illuminance
You should begin seeing something like this:
quit
-
Open a browser window and navigate to localhost:3000/login - username is admin and password is admin; change the password when prompted for security reasons. This is the local Grafana application running on the Pi.
-
Add your first datasource right from the home page links - select influxdb -> scroll down to "HTTP" and enter URL http://influxdb:8086
Scroll down to the bottom and make sure that the Database is "multisensors", HTTP method is "GET", Min time interval is "2", then click "Save & test". If everything is successful, you will get a "datasource is working. 4 measurements found" message.
Go to the menu dropdown (three tiny horizontal lines) on the left -> Dashboard -> New -> Import Dashboard -> Copy and paste the contents of "MyVivarium-Grafana-Dashboard.txt" [Link] into "Import via dashboard JSON model" box and click on "Load".
When the Dashboard has been created, click the three dots on the top right of each panel and change the data source to influxdb with the appropriate measurement and hit "Save". Even though you may see "Temperature" or "Humidity" show up on the dashboard by default, you still have to manually change it for the dashboard to detect the values. Save the dashboard when successful and then provide a comment when prompted after saving.
Proceed to repeat the dashboard setup for each sensor.
Verify the sensors are working - example - try to block light entry to the illuminance sensor and notice any change in the readings
Once the above steps are completed, you can proceed to Service File Configuration