Skip to main content

RDS Data Extraction with RFtap and Wireshark

RDS (Radio Data System) is a communication protocol standard used for embedding small amounts of digital information in traditional FM radio broadcasts. It enables radio stations to transmit data such as station identification, program information, and traffic updates. 

To capture and decode RDS data, one method involves using a Software Defined Radio (SDR) along with GNU Radio and RFtap. GNU Radio provides a framework for creating software radios, while RFtap acts as a bridge between GNU Radio and conventional network monitoring and packet analysis tools like Wireshark.

Decoding RDS data using Wireshark.

Unfortunately, as of the time of writing, RFtap is no longer being maintained and does not work with the latest version of GNU Radio (version 3.10.10). This post offers guidelines for rebuild and using RFtap with the new GNU Radio release.

This post assumes that the reader has access to DVB-T dongles based on the Realtek RTL2832U and a PC running Ubuntu or Debian Linux. For this, I used an RTL dongle with Rafael Micro R820T tuner and Ubuntu 24.04 LTS release.

As the first step install the following GNU Radio build dependencies into the OS:


sudo apt-get install cmake libboost-all-dev \
liblog4cpp5-dev qtcreator qtbase5-dev \
qt5-qmake python3-cheetah python3-numpy \
python3-pygtk python3-gi python3-gi-cairo \
gir1.2-gtk-4.0


sudo apt install git g++ libgmp-dev swig \
python3-mako python3-sphinx python3-lxml \
doxygen libfftw3-dev libsdl1.2-dev \
libgsl-dev libqwt-qt5-dev libqt5opengl5-dev \
python3-pyqt5 liblog4cpp5-dev libzmq3-dev \
python3-yaml python3-click \
python3-click-plugins python3-zmq python3-scipy \
libcodec2-dev libgsm1-dev libusb-1.0-0 \
libusb-1.0-0-dev libudev-dev \
python3-setuptools


sudo apt install pybind11-dev python3-matplotlib \
libsndfile1-dev libsoapysdr-dev soapysdr-tools \
python3-pygccxml python3-pyqtgraph


sudo apt install libiio-dev libad9361-dev \
libspdlog-dev python3-packaging python3-jsonschema \
python3-qtpy


sudo apt remove swig

Next, clone and build Volk (Vector-Optimized Library of Kernels)


mkdir ~/rf
cd rf
    
git clone --recursive https://github.com/gnuradio/volk.git
cd volk    
mkdir build
cd build
    
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../
make
sudo make install
sudo ldconfig

After installing the Volk library, we can proceed to build GNU Radio.


cd ~/rf

wget https://github.com/gnuradio/gnuradio/archive/refs/tags/v3.10.10.0.tar.gz
tar -xvf ./v3.10.10.0.tar.gz
cd gnuradio-3.10.10.0

mkdir build
cd build

cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../
make -j8
make test
sudo make install
sudo ldconfig

RFtap Encapsulation block with Socket PDU.

Now GNU Radio is installed with all necessary components. To enable RTL SDR support, we must build and install Osmocom RTL SDR libraries and SDR components.


cd ~/rf

git clone https://gitea.osmocom.org/sdr/rtl-sdr.git
cd rtl-sdr

mkdir build
cd build

cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig


cd ~/rf

git clone https://gitea.osmocom.org/sdr/gr-osmosdr
cd gr-osmosdr

mkdir build
cd build

cmake ../
make
sudo make install
sudo ldconfig

Before plugging in the RTL-SDR dongle, we need to prevent the kernel modules for the RTL-SDR USB device from being loaded into the kernel and taking ownership of the device. To do this, simply navigate to the /etc/modprobe.d directory and create a file called rtl-sdr-blacklist.conf with the following content:


# This system has librtlsdr0 installed in order to
# use digital video broadcast receivers as generic
# software defined radios.
blacklist dvb_usb_rtl28xxu
blacklist e4000
blacklist rtl2832
blacklist rtl2830
blacklist rtl2838

Next, you should clone and build the FM RDS/TMC transceiver module for GNU Radio.


cd ~/rf

wget https://github.com/bastibl/gr-rds/archive/refs/tags/v3.10.tar.gz
tar -xvf ./gr-rds\ -v3.10.tar.gz
cd gr-rds-3.10

mkdir build
cd build

cmake ..
make
sudo make install
sudo ldconfig

For the next steps, we need to have Wireshark and RFTap. Wireshark can be installed using a package manager.


sudo apt-get install wireshark

To run Wireshark without requiring root user permissions, use the following set of commands:


sudo dpkg-reconfigure wireshark-common 
sudo usermod -a -G wireshark $USER
newgrp wireshark

A message may be prompted in the first step above and proceed by selecting the "Yes" option.

Now restart the OS and continue with the RFTap installation.

The official RFTap repository is no longer being maintained and is not compatible with newer versions of GNU Radio. For this step, please use the RFTap fork available in my GitHub repository. This version has been successfully tested with GNU Radio 3.10.10 and Wireshark 4.2.2.


cd ~/rf

git clone https://github.com/dilshan/gr-rftap.git
cd gr-rftap

mkdir build
cd build

cmake ..
make
sudo make install
sudo ldconfig

Now get the modifier version of rds_rx_rftap.grc from the above repository.

Station name received as Sirasa on 106.5MHz.

The Wireshark Dissector file for RDS data is also available in the repository. Copy it to the ~/.config/wireshark/plugins directory. Create the directories if they do not exist.

Launch Wireshark and monitor the loopback (lo) adapter. Start GNU Radio and execute the rds_rx.grc file, which was downloaded in the above step.


If all the steps are performed correctly, the RDS data should appear in the packet list pane as UDP messages. The dissected messages can be observed through the packet bytes pane.

Comments

Popular posts from this blog

CD2003 - yet another simple FM radio receiver

In the last few days, we are looking for some simple FM radio receiver to integrate into one of our ongoing projects. For that, we try several FM radio receiver ICs including TDA7000, CD2003/TA2003/TA8164, CXA1019, and KA22429. Out of all those chips we select CD2003 (or TA2003/TA8164) based receiver for our project because of its simplicity and outstanding performance. Except to CD2003, Sony CXA1019 also perform well but we drop it because of its higher component count. We design our receiver based on Toshiba TA2003 datasheet and later we try TA8164 and CD2003 with the same circuit. Either CD2003 or TA8164 can directly replace TA2003 IC, and as per our observations, TA8164 gives excellent results out of those 3 chips. A prototype version of CD2003 FM radio receiver The PCB design and schematic which we used in our prototype project are available to download at google drive (including pin-outs of crystal filters and inductors ). Except for CD2003 IC, this receiver consist

Arduino superheterodyne receiver

In this project, we extend the shortwave superheterodyne receiver we developed a few years ago . Like the previous design, this receiver operates on the traditional superheterodyne principle.  In this upgrade, we enhanced the local oscillator with Si5351 clock generator module and Arduino control circuit. Compared to the old design, this new receiver uses an improved version of an intermediate frequency amplifier with 3 I.F transformers. In this new design, we divide this receiver into several blocks, which include, mixer with a detector, a local oscillator, and an I.F amplifier. The I.F amplifier builds into one PCB. The filter stage, mixer, and detector stages place in another PCB. Prototype version of 455kHz I.F amplifier. In this prototype build, the Si5351 clock generator drives using an Arduino Uno board. With the given sketch, the user can tune and switch the shortwave meter bands using a rotary encoder. The supplied sketch support clock generation from 5205kHz (tuner frequ

Calculator for audio output transformers

Audio output transformers are heavily used in a vacuum tube and some (older) transistor base audio power amplifiers, but these days output transformer are quite hard to find and expensive item. For homebrew projects, the best option is to construct those transformers by ourselves and this script helps to calculate winding parameters for those transformers. This " AF output transformer calculator " script is written using Python and it works with most of the commonly available Python interpreters . The script is available to download at google drive under the terms of GNU General Public License version 3.0 . Homebrewed 25k: 4 output transformer Once supplied the input parameters this script provides a winding ratio, the number of turns required for primary and secondary winding and required copper wire gauges for both primary and secondary windings, etc. We construct several AF output transformers based on results of this script, which including transformers for M