Using RTL-SDR to read value from wireless electric/gas/water meters

For my meter (Itron 60W-R), I get total cumulative consumption scaled by 10, therefore 10831 = 1083.1m3. I do not understand why two of your readings with the same meter have such different readings. Do you neighbours readings look the same?


Hi @mladem, I have gotten as far as being able to read use rtlamr to read all off the meter transmissions through the ssh terminal, but I am stuck how to get those mqtt packets to Hassio. I installed rtl-sdr and rtlamr on a dedicated Raspberry Pi and am am able to read the raw data quite well.

Do you have the rtl-sdr dongle on a dedicated raspberry pi and not the Hassio pi? Or is your Hassio and rtlamr on the same machine? I am stuck trying to get the to run correctly on the headless RPi and send mqtt data to Hassio.



Hi Adam,

my rtl-sdr is on an dedicated dongle. Please find below my code:

#!/usr/bin/env python3
import sys
import json
import subprocess
import time
import paho.mqtt.client as mqtt

client = mqtt.Client("power-meter-pi-zero")
client.username_pw_set(username="<USERNAME FOR MQTT>",password="PASSWORD FOR MQTT")
client.connect("<IP OF YOUR MQTT/HOME ASSISTANT>", 1883, 60)

# Delay. Useful for now while I try and figure out systemd targets. I've had
# issues where if both powermon and rtlamr start immediately at boot, no data is
# reported. The delay solves the problem but I don't like it.

 # make sure to replace /home/pi/go/bin/rtlamr with your path for rtlamr and 
proc = subprocess.Popen(['/home/pi/go/bin/rtlamr', '-filterid=<ID OF YOUR UTILITY METER>', '-format=json'],stdout=subprocess.PIPE)
prev_reading = None

  while True:
    line = proc.stdout.readline()
    if not line:
    except ValueError:
        reading = data['Message']['Consumption']

        if prev_reading is not None:
        prev_reading = reading

except KeyboardInterrupt:

Make sure to replace with your own info where it is indicated, e.g.

Thanks @mladem, I will try this weekend when I have some time. I appreciate the help

I love this!! so much for being “secure.” my gas company really shouldn’t explain in detail how everything works, i just bought a dongle for $35, can’t wait to try it out!

1 Like

Were you able to get this working with your utility company?

Yes, I was able to get it working for both my water and gas meter. It’s been running good for the last few days

almost there…, just about done configuring the sdr on rasberry pi, setup was a pain in the ass to get ssh working

I want to change the frequency to listen on 462…, if i do sudo rtl_tcp -4 462.4125 is does Hz and not Mhz, do you know i how i can convert it?

What device are you trying to read at 462MHz? Is it shown on the rtlamr compatibility list? (link)

1 Like

how do you use this?

i finally got go installed and configured, i downloaded the github repository and went into the directory rtlamr, but when i tun rtlamr, nothing happens??

when trying to run the rtlamr, i get an error

david@> raspberrypi:~/projects/src/src/$ go run main.go


./main.go:58: undefined: msgType

./main.go:59: undefined: msgType


Just replied on your other thread…

I keep getting an error,

david@raspberrypi:~$ python3
** File “”, line 11**
** client.connect(“”, 1883, 60)**

now i get invalid character in identifier

Why am i getting an error after 10 minutes?

client = mqtt.Client()
client.connect( **""** , 1883, 60)

try :
while True:

completed =[ '/home/projects/bin/rtlamr' , '-filterid=1481976504' , '-format=json' , '-duration=10m' , 'msgtype=r900' ], stdout=subprocess.PIPE, stderr=subprocess$

try :
data=json.loads(completed.stdout.decode( **"utf-8"** ))
**except** ValueError:
print ( "Error" )

This is the code i feel it’s erroring out on, if i just run the david@raspberrypi:~$ /home/projects/bin/rtlamr -filterid=1481976504 -msgtype=r900 -format=json
it works fine

I have a feeling 10 minutes may not be enough time for it to “pick up” on the signal, so do i need to extend it? i got the script from someone else on this forum and they had it working fine…, this is for a water meter

Before running the script initially try to run rtlamr to see what signals you are able to sniff out.

/home/projects/bin/rtlamr -msgtype=r900

you can try different values for msgtype: all, scm, scm+, idm, netidm, r900 and r900bcd depending on your type of meter and computational power. Once you identify YOUR meter enter the meter number in ‘-filterid=XXXXXXXXXXXXX’.

Thanks for the response, I did! I was able to run this without the quotes of course just fine, however I didn’t wait long enough to see the results since I assume it’s only outputted 4 times a day or so, ‘/home/projects/bin/rtlamr’ , ‘-filterid=1481976504’ , ‘-format=json’ , ‘msgtype=r900’ no errors were ran, if I didn’t have the filterid I would get responses immediiately

Did you read my post?

This is the code i feel it’s erroring out on, if i just run the david@raspberrypi:~$ /home/projects/bin/rtlamr -filterid=1481976504 -msgtype=r900 -format=json
it works fine

there is a - missing for msgtype

Thank you!!! i’ll take a look at this when i get home