- Grafana Dashboard:
localhost:3000
- IndexDB Dashboard:
localhost:8086
- Install Raspberry OS Lite 64-bit using Raspberry Imager (https://www.raspberrypi.com/software/) and boot the Pi
- Make sure to activate SSH and setup WiFi
- SSH onto the Pi from a PC in the same WiFi:
ssh username@domainNameOrIpOfThePi
- Install InfluxDB: https://docs.influxdata.com/influxdb/v2.6/install/?t=Raspberry+Pi
wget -q https://repos.influxdata.com/influxdb.key
echo '23a1c8836f0afc5ed24e0486339d7cc8f6790b83886c4c96995b88a061c5bb5d influxdb.key' | sha256sum -c && cat influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
sudo apt-get update && sudo apt-get install -y influxdb2
sudo systemctl enable influxdb
sudo systemctl start influxdb
sudo systemctl status influxdb
influx setup
- Install Grafana (https://grafana.com/tutorials/install-grafana-on-raspberry-pi/)
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install -y grafana
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
sudo systemctl status grafana-server
- Create InfluxDB token for Grafana:
- via the CLI:
influx auth create --org <name of the org created during influx setup> --all-access -d grafana
- via the InfluxDB dashboard at
http://domainNameOrIpOfThePi:8086
(easiest to give it all access)
- via the CLI:
- Go to
http://domainNameOrIpOfThePi:3000
and log in withadmin:admin
- Setup InflxuDB data source in Grafana using the token created above and
localhost:8086
as the endpoint
Can also be done on the Grafana/InfluxDB node (in which case you'd ofc skip step 1).
- Install Raspberry OS Lite 64-bit using Raspberry Imager (https://www.raspberrypi.com/software/) and boot the Pi
- Make sure to activate SSH and setup WiFi
- SSH onto the Pi from a PC in the same WiFi:
ssh username@domainNameOrIpOfThePi
- Continue with Option 1 or 2
Note: Currently this has hard-coded values (influx hostname, token, org, and bucket) for our specific setup. If you're setting this up elsewhere, you want to download the file first, adjust the influx values at the top, and only then run it.
- Run
curl 'https://raw.githubusercontent.com/benediktwerner/humidity-logger/master/setup-data-node.py' | python3
- Install sense-hat lib:
sudo apt-get install -y sense-hat
- Install influxdb lib:
sudo apt-get install -y python3-pip && pip install 'influxdb-client[ciso]'
- Copy
logger.py
from this repo to~/humidity-logger/logger.py
- Copy
config.toml.example
from this repo to~/humidity-logger/config.toml
and adjust the values- You can create an InfluxDB token via the InfluxDB UI at
http://domainNameOrIpOfThePi:8086
(give it write access to the bucket you want to use or just all buckets) or viainflux auth create --org <org name> --write-buckets
. You can reuse the same token for all data nodes.
- You can create an InfluxDB token via the InfluxDB UI at
- Copy
humidity-logger.service
from this repo to/etc/systemd/system/
- Edit the file and change all instances of
wernerfamily
to the username running on the pi (runwhoami
to find out what it is) - Enable and start the service:
sudo systemctl enable humidity-logger
sudo systemctl start humidity-logger