powreader
1.0.0
我用來讀取(荷蘭)智能電錶的小型而簡單的工具,並將數據發送到另一台設備上的infuxdb。這使我可以在相同的Raspberry Pi上運行更多的實用程序,而無需它僅閱讀功率計。
它的構建是可以交叉補充的,例如PI,但它可能可以在任何Linux設備上運行。它幾乎沒有CPU功率,少於3 MB的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
我做了一個SystemD配置,以確保該程序始終運行。對我的執行字符串是:
/home/ubuntu/powreader --influxdb=192.168.0.50:8089 /dev/ttyUSB0其中“/dev/ttyusb0”是與智能功率計的串行連接,而infuxdb-part是我用來將數據推向UDP的InfluxDB數據庫的位置。
然後,我使用Grafana在圖和儀表中顯示測量值。