Arduino Prometheus Exporter.
Project description
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\"}}");
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file arduino_exporter-0.8.12.tar.gz
.
File metadata
- Download URL: arduino_exporter-0.8.12.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efde0df56c529c208cbbdb1fc7dd67a048ec70c5feea8e450f63675f484f348c |
|
MD5 | 57df3cf509ebf1a844193c10d9df5c1b |
|
BLAKE2b-256 | 2ccaa82f6d65270d23f12ab7f93d3255d128b79f59318148cd781aa37197306d |
File details
Details for the file arduino_exporter-0.8.12-py3-none-any.whl
.
File metadata
- Download URL: arduino_exporter-0.8.12-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70bf9482e8e0d19abc057c911601646a7042140adb57ffc2b39203e6006c3e4d |
|
MD5 | bace7b53a67cfb24b651c2ec4a79fbc3 |
|
BLAKE2b-256 | d3e2e9b21950318ff7413b099b658f564659fa38baf9e08dc6a8dc33a588093a |