RTL-SDR Weather Station Radio setup
Installing RTL-SDR from source
$ sudo apt install libusb-1.0.0-dev git cmake
$ sudo apt install pkg-config
Then clone the rtl-sdr repo
$ git clone https://github.com/osmocom/rtl-sdr.git
Once it is cloned, make a build directory, build it and install it:
$ cd rtl-sdr
$ mkdir build
$ cd build
$ cmake ../ -DINSTALL_UDEV_RULES=ON
$ make
$ sudo make install
$ sudo cp ../rtl-sdr.rules /etc/udev/rules.d
$ sudo ldconfig
Creating permissions for non-root users
Next, you need to add some udev rules to make the dongle available for the non-root users.
Find the vendor id and product id for your dongle.
mtb@netrabrick:~$ lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 005: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 004 Device 004: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 004 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth
Bus 004 Device 002: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 04b4:0003 Cypress Semiconductor Corp. USB-UART LP
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsusb
The important line was the Realtek dongle:
Bus 004 Device 002: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
The important parts are "0bda" (the vendor id) and "2838" (the product id).
Create a new file as root named /etc/udev/rules.d/20.rtlsdr.rules that contains the following line:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="adm", MODE="0666", SYMLINK+="rtl_sdr"
With the vendor and product ids for your particular dongle. This should make the dongle accessible to any user in the adm group. and add a /dev/rtl_sdr symlink when the dongle is attached.
When finished, run
Blacklisting the Default Kernel Driver
The default kernel might automatically load drivers for the RTL-SDR, which can prevent SDR applications from accessing the dongle. You need to blacklist it.
Create a blacklist.conf file
sudo vi /etc/modprobe.d/blacklist.conf
Add the following lines at the end of the file:
blacklist dvb_usb_rtl28xxu
Unload the conflicting kernel module:
sudo rmmod dvb_usb_rtl28xxu
Reboot the system to apply changes:
sudo reboot
Testing SDR
If the SDR radio receiver can be found, you should see similar output:
rtl_433
rtl_433
is an open-source software tool used with RTL-SDR (Software Defined Radio) dongles. It is specifically designed for decoding and demodulating signals from various low-cost ISM (Industrial, Scientific, and Medical) band devices that operate around the 433 MHz frequency range. These devices often include sensors such as:
Weather stations
Tire pressure monitoring systems (TPMS)
Remote temperature and humidity sensors
Power consumption meters (e.g., smart meters)
Doorbells and remote control devices
Installing rtl_433
Connecting to weather relayer
mtb@netrabrick:~/Aleph_hackathon/oviwox$ weather_relay.py