I hereby claim:
- I am sandeen on github.
- I am sandeen (https://keybase.io/sandeen) on keybase.
- I have a public key ASDPNrc7zb-rDVzrofuoAdxYcssOCFH5LI85AIcGZL-jyAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
+--------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+--------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
JSON: | |
{"results":[{"series":[{"name":"miso","columns":["time","Coal","NaturalGas","Nuclear","Other","Total","Wind"],"values":[[1516908600,43641,12475,12292,871,72382,3103],[1516908900,43462,12146,12293,869,71966,3196],[1516909200,43316,12128,12300,871,71896,3281],[1516909800,43022,11858,12281,870,71508,3478],[1516910400,42879,11976,12284,860,71707,3709],[1516910700,42982,12253,12289,863,72167,3780],[1516911000,43066,11975,12295,866,72092,3890],[1516911300,43009,11823,12282,875,71950,3961],[1516911600,42905,11739,12286,873,71895,4092]]}]}]} | |
Pretty: | |
{ | |
"results": [ | |
{ | |
"series": [ |
I was trying to solve the problem where I'd like to separate DHW firings | |
from space heating firings, to more accurately calculate heat loss, efficiency, | |
etc. | |
Right now, the way collectd sends measurements to influxdb, it's separate | |
measurements: | |
> select * from modbus_value where time > now() - 2m | |
name: modbus_value | |
time host instance type type_instance value |
// Packet is 1 bit per byte, pack to 8-bits per byte. | |
for pIdx := 0; pIdx < len(d.pkt)*8; pIdx++ { | |
d.pkt[pIdx>>3] <<= 1 | |
if pIdx < d.Cfg.PacketSymbols { | |
d.pkt[pIdx>>3] |= d.Quantized[qIdx+(pIdx*d.Cfg.SymbolLength2)] | |
} else { // zero out last bits past PacketSymbols | |
d.pkt[pIdx>>3] |= 0 | |
} | |
} |
@@ -265,6 +259,15 @@ func (d Decoder) Decode(input []byte) (pkts [][]byte) { | |
d.pkt[pIdx>>3] |= d.Quantized[qIdx+(pIdx*d.Cfg.SymbolLength2)] | |
} | |
+ // Left over bits? | |
+ r := (8 - (d.Cfg.PacketSymbols % 8)) | |
+ if r > 0 { | |
+ for pIdx := 0; pIdx < r; pIdx++ { | |
+ d.pkt[(d.Cfg.PacketSymbols-1)>>3] <<= 1 | |
+ d.pkt[(d.Cfg.PacketSymbols-1)>>3] |= 0 |