decoding the rfm12 packets.

Iv bought a jeelink and im looking at setting up a raspberry pi to receive the data and then depending on the vales do certain actions.. 

The first hurdle is triyng to decode the packets..

OKG 210 10 7 2 0 0 0 0 99 96
OKG 210 10 18 2 0 0 0 0 111 96
OKG 210 10 10 2 0 0 0 0 74 96
OKG 210 20 102 8
OKG 210 10 7 2 0 0 0 0 74 96
OKG 210 20 102 8
OKG 210 15 116 20 26 6
OKG 210 10 1 2 0 0 0 0 103 96
OKG 210 20 102 8
OKG 210 10 255 1 0 0 0 0 128 96
OKG 210 10 0 2 0 0 0 0 38 96
OKG 210 10 3 2 0 0 0 0 6 96
OKG 210 20 102 8
OKG 210 10 251 1 0 0 0 0 246 95
OKG 210 10 2 2 0 0 0 0 59 96
OKG 210 20 102 8
OKG 210 10 5 2 0 0 0 0 63 96

so 210 is the Group (openenergymonitor)
10/15/20 is the node id (20=GLCD, 10=TX,15=RF)

so Node id 20 (GLCD) 102 8 im guessing 102 is the temp (21.5c) but how does 102 = 21.5  
102 in hex is 258? and what is 8?

I'm i missing something.. 

Iv not even though of working out the Tx's values.. As im using the voltage sketch and have PV, So one will be the import / export, one the pv, Voltage?????? and ??????

have looked at http://openenergymonitor.blogspot.co.uk/2012/09/emontx-and-nanoderf-code-guides.html but not sure if this is in the packets or decoded values.

HELP..

Thanks.

Rob (brain melting)

 

Robert Wall's picture

Re: decoding the rfm12 packets.

I'd suggest two ways (a) Google or (b) forget trying to decode real data, set up the absolute simplest system, say just one emonTx with a payload of 1 byte, which you define the contents, and just send that. When you've identified everything in the message, send 2 bytes, etc. Then graduate to an integer, then two....

Having had to do similar things a good few times, cut out as many variables as you can and control everything. Anything uncontrolled is a source of confusion.

You also need to think Hex. Taking your example of temperature, 102 8 is  0x66, 0x08. Reversing the order and joining the two, 0x0866, which in decimal is 2150.  Recognise it? - temperature x 100 (see the sketch!).

robw's picture

Re: decoding the rfm12 packets.

Robert thats sounds like a plan..

Just though i could start on the Glcd as its only sending temp and really thought it would be easy.. (how wrong and i)

Thanks will have a go at some more..

 

Robert Wall's picture

Re: decoding the rfm12 packets.

Your payload presumably is:

typedef struct { int power1, power2, power3, Vrms; } PayloadTX;     

An integer is 2 bytes, so I reckon what you're looking at is

 

"OKG 210 10 7 2 0 0 0 0 99 96" 

7 2         power1
0 0         power2
0 0         power3
99 96    Vrms

- 99 96  is 24675  - obviously voltage x 100  => 246.75 V  which fits with line 91 in the sketch and you see where voltage is multiplied by 100 to send it.

 

Power1 = 519 W.

Job almost done?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.