Monitor a Raspberry Pi / HC-SR04 Ultrasonic Rangefinder Distance with Prometheus
- A Raspberry Pi (this won't work on Mac/PC/etc)
- an HC-SR04 sensor.
- A breadboard
- Follow this guide to wire the Pi's GPIO pins to the sensor using the same pins they specify in the guide.
From the raspberry pi CLI:
git clone git@github.com:geekdave/prometheus_hcsr04_exporter.git
cd prometheus_hcsr04_exporter.git
npm install
sudo node exporter.js
Note: sudo is required to access the GPIO pins.
Test it using:
curl http://localhost:9207/metrics
Apache 2.0
- v0.0.1 (June 2, 2019) : Initial release