Skip to content

Instantly share code, notes, and snippets.

@bp2008
Created October 11, 2024 17:36
Show Gist options
  • Save bp2008/112310d0964e194aef2f50bb046bc66f to your computer and use it in GitHub Desktop.
Save bp2008/112310d0964e194aef2f50bb046bc66f to your computer and use it in GitHub Desktop.

rtl_433 on Raspberry Pi using RTL-SDR Blog V4 hardware

I technically began by following this guide but rtl_433 was unable to decode any packets, so I researched and found that the RTL-SDR Blog V4 hardware requires a relatively new driver from 2023.

Therefore the following guide is derived from the above guide combined with instructions from https://www.rtl-sdr.com/V4/

New guide for 2024

Begin with a fresh install of Raspberry Pi OS.

Install dependencies:

sudo get install git git-core cmake libusb-1.0-0-dev build-essential cmake pkg-config libtool librtlsdr-dev doxygen

(that is a combined package list from old and new guides; it is not verified if any of the above are redundant)

Install the RTL-SDR Blog drivers:

git clone https://github.com/rtlsdrblog/rtl-sdr-blog
cd rtl-sdr-blog
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig

Blacklist the DVB-T TV drivers:

echo -e "blacklist dvb_usb_rtl28xxu\nblacklist rtl2832\nblacklist rtl2830" | sudo tee /etc/modprobe.d/no-rtl.conf
echo 'blacklist dvb_usb_rtl28xxu' | sudo tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf

Reboot for the above to take effect:

sudo reboot

Install rtl_433 latest from git:

git clone https://github.com/merbanan/rtl_433.git
cd rtl_433/ && mkdir build &&
cd build && cmake ../ &&
make
sudo make install

Now you can test by running rtl_test -t and rtl_433, the latter of which should run until killed with CTRL+C and it should output any packet data that was decoded.

To set it up as a background service

Write a configuration file rtl_433.conf in your home directory.

The following is only an example which outputs data to the console. In your final configuration, you'll want to output to an MQTT server or something in order to consume the data in a useful way, and configure it to listen to the protocols that you care about.

rtl_433.conf:

output kv

frequency 433.92M
convert customary
report_meta time:utc

#[11] Acurite 609TXC Temperature and Humidity Sensor
protocol 11
#[20] Ambient Weather F007TH, TFA 30.3208.02, SwitchDocLabs F016TH temperature sensor
protocol 20
# [40] Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning, 3N1, Atlas
protocol 40
# [41] Acurite 986 Refrigerator / Freezer Thermometer
protocol 41
# [55] Acurite 606TX Temperature Sensor
protocol 55
# [74] Acurite 00275rm,00276rm Temp/Humidity with optional probe
protocol 74
# [163] Acurite 590TX Temperature with optional Humidity
protocol 163
# [194] Inkbird ITH-20R temperature humidity sensor (for pool temperature floater)
protocol 194
# [197] Acurite Grill/Meat Thermometer 01185M
protocol 197

Write a systemd service rule to /etc/systemd/system/rtl433.service:

[Unit]
Description=rtl_433 SDR Receiver Daemon
After=network-online.target

[Service]
ExecStart=/usr/local/bin/rtl_433 -c /home/pi/rtl_433.conf
Restart=always

[Install]
WantedBy=multi-user.target

(Modify the path /home/pi/ as needed for your environment)

Enable the service:

sudo systemctl enable rtl433

Basic service management commands:

sudo systemctl start rtl433
sudo systemctl stop rtl433
sudo systemctl status rtl433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment