Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.01 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.01 KB

Current Cost CC128 real-time power usage exporter for Prometheus

Defaults to -dev /dev/ttyUSB0 -baud 57600

Install

go get -u github.com/jamessanford/currentcost_exporter

Screenshot in Grafana

grafana

Metrics exported

temperature_c 26.4
temperature_f 79.5
watts{channel="ch1"} 65
watts{channel="ch2"} 320

currentcost_read_count 30
currentcost_read_errors 0
currentcost_read_time 1.4612893e+09
currentcost_parse_errors 0

XML input from serial port

<msg><src>CC128-v0.15</src><dsb>01772</dsb><time>00:37:10</time><tmpr>26.4</tmpr><tmprF>79.5</tmprF><sensor>0</sensor><id>00865</id><type>1</type><ch1><watts>00065</watts></ch1><ch2><watts>00320</watts></ch2></msg>

XML format definition from http://www.currentcost.com/cc128/xml.htm

x/net/trace

Just for fun, the exporter registers golang.org/x/net/trace handlers at /debug/events and /debug/requests