Python script that captures data from serial port, coming from Arduino Nano and re-exports its as Prometheus metrics

by josevnz
GNU/Linux ◆ xterm-256color ◆ bash 912 views

This is for my YAFD (Yet Another Food Dispenser) project:

(YetAnotherFoodDispenser) [josevnz@dmaf5 YetAnotherFoodDispenser]$ scripts/prometheus_yafd_exporter.py –help usage: Script to expose Arduino serial port readings using Prometheus client code. Author: Jose Vicente Nunez (kodegeek.com@protonmail.com)

   [-h] [--serial_port SERIAL_PORT] [--baud BAUD] [--prom_port PROM_PORT] [--verbose]

optional arguments: -h, –help show this help message and exit –serial_port SERIAL_PORT

                    Serial port name /dev/ttyUSB0

–baud BAUD Serial port speed 9600 –prom_port PROM_PORT

                    Prometheus 8000

–verbose Print captured reading to screen