Skip to main content

Grafana Visualization

Grafana is an open platform for beautiful analytics and monitoring. It allows you to create nice-looking dashboards that will give you quick insights into your sensor data.

Install Grafana

info

First, you will need to install InfluxDB.

Start by installing all the needed packages

sudo apt install apt-transport-https curl -y

Add the repository key

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -

Add repository to the source list

echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

Install the InfluxDB Package

sudo apt update && sudo apt install influxdb

Start the InfluxDB Service to test it

sudo systemctl start influxdb
info

After you tested the InfluxDB, you can move to Grafana.

Install Grafana Dependencies

sudo apt install adduser libfontconfig -y

Install Grafana

Download the Latest Version

wget $(wget "https://api.github.com/repos/fg2it/grafana-on-raspberry/releases/latest" -q -O - | grep browser_download_url | grep armhf.deb | head -n 1 | cut -d '"' -f 4) -O grafana.deb

Install the Package

sudo dpkg -i grafana.deb

Enable Grafana on Boot

sudo systemctl daemon-reload
sudo systemctl enable grafana-server

Test Grafana

sudo systemctl start grafana-server

Configure Grafana

To configure Grafana, you will first have to open it and log in:

info

Default User is admin. Default Password is admin.

Create a Data Source

Select Add Data Source and fill the data


  • Enter the Name: node
  • Select the Type: InfluxDB
  • Enter the URL: http://localhost:8086

  • Enter the Database: node
  • Click at Save & Test button to check if everything is OK. You should se same green notification as on the picture.

Import dashboard

Download dashboard.json and import it to Grafana

  • Click the Grafana icon on the top left (1)
  • Click at the + icon to expand submenu (2)
  • Click at the Import (3)

  • Click at the Upload .json File (4)

  • Choose your JSON file (in our case dashboard.json) (5)
  • Select file to upload (6)

  • Select you database (7)
  • Click at the Import button (8)

  • Your dashboard is imported.

Example output for Wireless Climate Monitor and Wireless CO2 Monitor projects