Built on Raspberry Pi 4 with the SparkFun Environmental Combo Breakout - CCS811/BME280 (Qwiic) on Python.
Using Balena.io who provide a full technology stack develop, deploy, and manage projects at any scale; all on the cloud.
Pihole + unbound copied from klutchell.
pHAT Shutown button copied from sparkfun reboot and shutdown guide.
Device Service Variables used for this repo that would need to be added to the Balena Cloud Dashboard under the service sensor for individual devices.
DEVICE_DB_LOCATION = The device location INFLUX_DB_BUCKET = The bucket name for Influx DB INFLUX_DB_TOKEN = Token generated from Influx DB. More infomration can be found at InfluxDB's documentation INFLUX_DB_ORG = The organisation ID for your bucket
Sensor uses Python and influxdb-client-python libaries to write into influxdb.
Setup details can be found here and the easiest way is to open up the influxdb url @ http://deviceip:8086 and follow the intial setup prompts.
Alternatively on the Balena dashboard, open up th CLI for influx db and type in:
influx setup
Press enter and follow the instructions. Make note of the details as they will be used next.
The bucket & org would be entered into the Device Service Variable in your balena machine.
On the Balena dashboard under device service variables, please input the following enviromental variables
INFLUX_DB_BUCKET:
Alterinatively you can go into the Python scripts and hardcode these values in directly.
Scripts needed are:
- bme280.py
- ccs811.py
- weather_bom.py
Finally under weather_bom.py / BOMURL please point the URL to your local data feed under Observations - Individual Stations as these feeds provide the necessary .json files which this is written in to accept.
A template dashboard will be in place with some of the datapoints. Follow the instructions here to connect Grafana to Influx DB via Flux.