Una herramienta pequeña y simple que uso para leer nuestro medidor de potencia inteligente (holandés) y enviar los datos a una entrada de InfluxDB en otro dispositivo. Esto me permite ejecutar más utilidades en la misma Raspberry Pi sin que se dedique a leer el medidor de energía.
Se construye para ser compilable para, por ejemplo, un PI, pero probablemente pueda ejecutarse en cualquier dispositivo Linux. Casi no hay potencia de CPU y menos de 3 MB de RAM.
$ ./powreader --help Powreader 1.0
Powreader interprets the output from the digital power meter and outputs it in JSON or pushes it to an InfluxDB.
USAGE:
powreader [OPTIONS] <SERIALPORT>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --influxdb <influxdb> Sets the full host and port to the influxdb. Data is transfered over UDP. This argument
is given in the form of HOST:PORT. If this argument is not set, data will be printed as
a JSON stream.
ARGS:
<SERIALPORT> Sets the serial port to use
Hice una configuración de Systemd que asegura que este programa siempre se ejecute. La cadena de ejecución para mí es:
/home/ubuntu/powreader --influxdb=192.168.0.50:8089 /dev/ttyUSB0Donde el '/dev/ttyusb0' es la conexión en serie con el medidor de potencia inteligente y el InfluxDB-Part es la ubicación de la base de datos InfluxDB que uso para presionar los datos con UDP.
Luego, uso Grafana para mostrar las medidas en gráficos y medidores.