Arduino Prometheus Exporter
You can run this exporter on a device (PC or Raspberry PI) connected to an arduino. The exporter will listen to messages sent over the serial port and update the metrics exposed to prometheus. I used this project to visualize and trigger alerts for a lot of sensors values like sound, temperature and water level … etc
To use the exporter, follow the following steps:
Create a python virtual environment.
$ python3 -m venv venv
$ source venv/bin/activate
Install arduino-exporter package with pip.
$ pip install arduino-exporter
To run the arduino exporter process. You can use systemd to run the process on PC or Raspberry PI. The serial port value can be retrieved from arduino IDE.
$ arduino_exporter server run -s $serial_port -p $http_port
$ arduino_exporter server run -s /dev/cu.usbmodem14101 -p 8000
Upload a sketch to the arduino to send the metrics to the serial port.
#define LED 13
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
Serial.write("{\"type\": \"gauge\", \"name\": \"room_temp\", \"help\": \"the room temperature.\", \"method\": \"set\", \"value\": 14.3, \"labels\": {\"place\": \"us\"}}");
}
Release files for arduino-exporter 0.8.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arduino_exporter-0.8.15.tar.gz | 13.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arduino_exporter-0.8.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / arduino_exporter-0.8.15.tar.gz
| Download URL | arduino_exporter-0.8.15.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca59bdd94edba6ad34cb29a709d5517e992d00f5046ba6246532cb96460b1170
|
|
BLAKE2b-256 checksum How to use checksums |
69e8a0d16cd57537ff7ddc266b4ce8498899489cb492ff33c93c36d0f3c3e4bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / arduino_exporter-0.8.15-py3-none-any.whl
| Download URL | arduino_exporter-0.8.15-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a4e6aa34ae1eeaef20c7cd35428f1646cb561bfc3741686a1e747a037193335
|
|
BLAKE2b-256 checksum How to use checksums |
e0ad2a7c1607d901cbd8f019af8257c6b0b6f66afbdd8cfb778eeebbea2228bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|