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.18k stars 247 forks source link

Error processing SCM+ message from gas meter #220

Closed mzeesimba closed 2 years ago

mzeesimba commented 2 years ago

Hi, I used the latest build of rtlamr to diagnose messages from my updated gas meter. For some reason, I am getting the following error message. Below is the log of the session from rtlamr:

C:\Users\giveaway\go\bin>rtlamr -msgtype=scm+
14:11:04.032035 decode.go:45: CenterFreq: 912600155
14:11:04.032562 decode.go:46: SampleRate: 2359296
14:11:04.033079 decode.go:47: DataRate: 32768
14:11:04.033595 decode.go:48: ChipLength: 72
14:11:04.034627 decode.go:49: PreambleSymbols: 16
14:11:04.035142 decode.go:50: PreambleLength: 2304
14:11:04.035674 decode.go:51: PacketSymbols: 128
14:11:04.036189 decode.go:52: PacketLength: 18432
14:11:04.036704 decode.go:59: Protocols: scm+
14:11:04.037241 decode.go:60: Preambles: 0001011010100011
14:11:04.041858 main.go:124: GainCount: 29
{Time:2021-11-24T14:11:05.954 SCM+:{ProtocolID:0x1E EndpointType:0x9C EndpointID:  75387939 Consumption:     12216 Tamper:0x0100 PacketCRC:0xF3B5}}
{Time:2021-11-24T14:11:20.953 SCM+:{ProtocolID:0x1E EndpointType:0x9C EndpointID:  75387939 Consumption:     12216 Tamper:0x0100 PacketCRC:0xF3B5}}
{Time:2021-11-24T14:12:06.454 SCM+:{ProtocolID:0x1E EndpointType:0x9C EndpointID:  75387939 Consumption:     12216 Tamper:0x0100 PacketCRC:0xF3B5}}
14:12:13.843551 main.go:343: Receiver context cancelled.
14:12:13.844253 main.go:320: read tcp 127.0.0.1:61773->127.0.0.1:1234: i/o timeout
io.ReadFull
main.(*Receiver).Run.func2
        C:/Users/giveaway/go/pkg/mod/github.com/bemasher/rtlamr@v0.9.3/main.go:181
runtime.goexit
        C:/Program Files/Go/src/runtime/asm_amd64.s:1581

<Cancelled the session here>

What started this was I was not able to get the messages from my meter using metermon and MQTT Explorer so I got pointers to try out rtlamr instead. I was running it on Windows64.

I found the specs of the meter here: https://www.itron.com/-/media/feature/products/documents/spec-sheet/100g-dls-spec-sheet.pdf

Two questions: 1) There seems to be an error with the messages from the gas meter (see log above) 2) Why am I not able to see the SCM+ messages from metermon? I'm trying to automate my HomeAssistant to gather the readings from my gas and electric meters. I get the electric meter readings ok, just the gas meter I cannot get the readings.

Thank you Bob

bemasher commented 2 years ago

The error is unrelated to rtlamr's interpretation of the SCM+ messages you're receiving. If rtl_tcp fails to send a new block of samples at least once every 5 seconds, rtlamr gives up. Otherwise, the messages you did receive appear valid.

https://github.com/bemasher/rtlamr/blob/master/main.go#L174-L185