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
Hashes for arduino_exporter-0.8.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61afdc04390b313e3be88c075ae4c3c4a10b4f7d7e8e7ece28bf211e7bb04961 |
|
MD5 | 7fe25cfb6878f5c23c362c448504f311 |
|
BLAKE2b-256 | 141b98d4304bf9e39077f3502991ceb4728c9e5e7804118a91cbfe8a30373c52 |