Skip to main content

Arduino Prometheus Exporter.

Project description

PyPI-Server Build Status

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:

  1. Create a python virtual environment.

$ python3 -m venv venv
$ source venv/bin/activate
  1. Install arduino-exporter package with pip.

$ pip install arduino-exporter
  1. 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
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arduino_exporter-0.8.15.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arduino_exporter-0.8.15-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file arduino_exporter-0.8.15.tar.gz.

File metadata

  • Download URL: arduino_exporter-0.8.15.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for arduino_exporter-0.8.15.tar.gz
Algorithm Hash digest
SHA256 ca59bdd94edba6ad34cb29a709d5517e992d00f5046ba6246532cb96460b1170
MD5 2bd2bc1b8ee74e9ef3767cd06cfee6b6
BLAKE2b-256 69e8a0d16cd57537ff7ddc266b4ce8498899489cb492ff33c93c36d0f3c3e4bc

See more details on using hashes here.

File details

Details for the file arduino_exporter-0.8.15-py3-none-any.whl.

File metadata

File hashes

Hashes for arduino_exporter-0.8.15-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4e6aa34ae1eeaef20c7cd35428f1646cb561bfc3741686a1e747a037193335
MD5 afc00ba88ee085ab3e3914f958dc744a
BLAKE2b-256 e0ad2a7c1607d901cbd8f019af8257c6b0b6f66afbdd8cfb778eeebbea2228bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page