powreader
1.0.0
เครื่องมือขนาดเล็กและเรียบง่ายที่ฉันใช้ในการอ่านเครื่องวัดพลังงานอัจฉริยะ (ดัตช์) ของเราและเพื่อส่งข้อมูลไปยังการไหลเข้าบนอุปกรณ์อื่น สิ่งนี้ช่วยให้ฉันสามารถใช้ยูทิลิตี้มากขึ้นใน Raspberry Pi เดียวกันโดยไม่ต้องทุ่มเทเพื่ออ่านเครื่องวัดพลังงาน
มันถูกสร้างขึ้นเพื่อเชื่อมโยงกับ pi แต่อาจทำงานบนอุปกรณ์ Linux ใด ๆ มันใช้เกือบจะไม่มีพลังงาน CPU และ RAM น้อยกว่า 3 MB
$ ./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' คือการเชื่อมต่อแบบอนุกรมกับเครื่องวัดพลังงานอัจฉริยะและส่วนที่ influxDB เป็นที่ตั้งของฐานข้อมูล influxDB ที่ฉันใช้เพื่อผลักดันข้อมูลด้วย UDP
จากนั้นฉันใช้ Grafana เพื่อแสดงการวัดในกราฟและเกจ