bemasher / rtlamr

An rtl-sdr receiver for Itron ERT compatible smart meters operating in the 900MHz ISM band.
GNU Affero General Public License v3.0
2.21k stars 249 forks source link

R900: More consumption bits? #99

Closed edmonds closed 6 years ago

edmonds commented 6 years ago

Hi,

First off, thank you very much for the rtlamr tool!

I noticed today that the Consumption field on one of my R900 meters wrapped around after hitting approximately 16777216, and looking at the source I see that that field is indeed decoded as a 24 bit integer.

However, I noticed that all the decoded measurements prior to that point had the Leak field set to 6 (0b110), and after that point the Leak field was set to 14 (0b1110). If I'm reading this comment (https://github.com/bemasher/rtlamr/issues/29#issuecomment-97622287) correctly, the bit that's now set is the ? bit of the old Unkn4 field.

I've also noticed that 99% of the time, the Unkn1 field is set to 163 (0b10100011), but occasionally it flips to 131 (0b10000011), and then back to 163.

So, I wanted to raise the possibility that there are some R900's out there that have more than 24 bits of consumption data. I believe this R900 is attached to the disc side of a 4" Neptune TRU/FLO compound meter but I have not verified this (or the reading actually displayed on the register) because the meter is down in a sidewalk vault, and it is very hot outside right now. However, up until now, I've been dividing the consumption field by 10000 and it has matched the reading on our water bill.

…
{"Time":"2018-07-02T22:55:30.074070523-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":16772436,"Unkn3":0,"Leak":6,"LeakNow":2}}
{"Time":"2018-07-02T23:10:27.037397693-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":16774256,"Unkn3":0,"Leak":6,"LeakNow":2}}
{"Time":"2018-07-02T23:25:23.340198185-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":16775932,"Unkn3":0,"Leak":6,"LeakNow":2}}
{"Time":"2018-07-02T23:40:42.187814833-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":16777170,"Unkn3":0,"Leak":6,"LeakNow":2}}
{"Time":"2018-07-02T23:55:39.270706205-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":1403,"Unkn3":0,"Leak":14,"LeakNow":2}}
{"Time":"2018-07-03T00:10:35.682526932-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":3132,"Unkn3":0,"Leak":14,"LeakNow":2}}
{"Time":"2018-07-03T00:25:54.798914983-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":4657,"Unkn3":0,"Leak":14,"LeakNow":2}}
{"Time":"2018-07-03T00:40:29.037171679-04:00","Offset":0,"Length":0,"Message":{"ID":1543145582,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":6152,"Unkn3":0,"Leak":14,"LeakNow":2}}
…
bemasher commented 6 years ago

I believe the field Unkn1 is intended to identify the message type and should be 8-bits. As far as I'm aware R900's may transmit two different message types, so it may be safe to ignore the less common one.

If we assume that the consumption field is contiguous, due to the endianness of the packet, the only field that could contribute bits to the consumption field would be backflow and possibly nouse.

You are welcome to try adjusting the fields in your r900 decoder to see if the values it produces make any more sense. Unfortunately I don't have access to an R900-compatible meter to test with.