Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clivern/arduino_exporter
🐺 Arduino Prometheus Exporter.
https://github.com/clivern/arduino_exporter
arduino prometheus prometheus-exporter
Last synced: 3 months ago
JSON representation
🐺 Arduino Prometheus Exporter.
- Host: GitHub
- URL: https://github.com/clivern/arduino_exporter
- Owner: Clivern
- License: mit
- Created: 2017-02-17T16:34:24.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-03-23T21:13:11.000Z (10 months ago)
- Last Synced: 2024-04-23T22:19:38.127Z (9 months ago)
- Topics: arduino, prometheus, prometheus-exporter
- Language: Python
- Homepage: https://pypi.org/project/arduino-exporter/
- Size: 40 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/arduino_exporter.svg
:alt: PyPI-Server
:target: https://pypi.org/project/arduino_exporter/
.. image:: https://github.com/Clivern/arduino_exporter/actions/workflows/ci.yml/badge.svg
:alt: Build Status
:target: https://github.com/Clivern/arduino_exporter/actions/workflows/ci.yml|
===========================
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 ... etcTo use the exporter, follow the following steps:
1. Create a python virtual environment.
.. code-block::
$ python3 -m venv venv
$ source venv/bin/activate2. Install arduino-exporter package with pip.
.. code-block::
$ pip install arduino-exporter
3. 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.
.. code-block::
$ arduino_exporter server run -s $serial_port -p $http_port
$ arduino_exporter server run -s /dev/cu.usbmodem14101 -p 80004. Upload a sketch to the arduino to send the metrics to the serial port.
.. code-block::
#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\"}}");
}