This repo contains fragments needed to export metrics to Prometheus from Pimoroni's EnviroPhat, running on a RaspberryPi Zero on Raspberry OS. Soldering instructions and how to install the OS are not covered here.
You can use Pimoroni's own Bash script to install all dependencies and set all needed configurations:
curl https://get.pimoroni.com/envirophat | bash
Or go for a more manual install. If you do the manual install, then you need the following packages:
apt install -y python3-pip \
python3-smbus \
raspi-gpio \
i2c-dev \
i2c-bcm2708 \
python3-envirophat \
And then enable I2C, which the EnviroPhat requires. This is done with raspi-config
.
There's not much to install, just move the peps.py
file to the place where the systemd service file expects it to be.
nstall --target-directory=/usr/local/bin peps.py
This repo includes a .service
file which tells systemd how to manage the process.
Add the serivce file, peps.service
, in `/etc/systemd/system/ .
Then start the service:
systemctl enable peps
systemctl start --now peps
You can now view the metrics on <RPi Zero IP>:8000
.
If you want to change the port or interface, then just edit peps.py
.