Last post in a series of three (previous posts here and here).
The decoder for this data, in CoffeeScript, is as follows:
Note that the API of these decoders is still changing. They are now completely independent little snippets of code which do only one thing – no assumptions on where the data comes from, or what is to be done with the decoded results. Each decoder takes the data, creates an object with decoded fields, and finishes by calling the supplied “cb” callback function.
Here is some sample output, including a bit of debugging:
As you can see, this example packet used 19 bytes to encode 10 values plus a format code.
Explanation of the values shown:
usew
is 0: no power is being drawn from the gridgenw
is 6: power feed into the grid is 10 x 6, i.e. ≈ 60Wp1
+p3
is current total consumption: 8 + 191, i.e. 199Wp2
is current solar power output: 258W
With a rate of about 50 Kbit/sec using the standard RF12 driver settings, and with some 10 bytes of packet header + footer overhead, this translates to (19 + 10) * 8 * 20 = 4,640 µS “on-air” time once every 10 seconds, i.e. still under 0.05 % bandwidth utilisation. Fine.
This is weblog post #1200 – onwards! :)