Skip to content

RTL SDR setup and calibration

Piotr Krysik edited this page Nov 9, 2026 · 1 revision

RTL-SDR setup and calibration

Most users receive GSM with a cheap RTL-SDR dongle. This page describes how to give your user access to it and how to find its frequency error (ppm), which gr-gsm needs to be told with -p. Other SDR devices that gr-osmosdr supports (HackRF, USRP, bladeRF and others) work too, and have their own setup.

Access to the device

Install the tools (sudo apt-get install rtl-sdr on Debian and Ubuntu) and plug in the dongle. Check that the system sees it and note its USB ID:

lsusb | grep -i realtek
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

Test it with rtl_test. If it prints usb_claim_interface error -6 or cannot open the device, one of the following applies.

Another program uses the dongle. Close the other instance of the live monitor, the scanner or any other SDR program. Only one program can use a dongle at a time.

The kernel DVB driver took it. Prevent it from loading and unplug the dongle, then plug it in again:

echo 'blacklist dvb_usb_rtl28xxu' | sudo tee /etc/modprobe.d/blacklist-rtl.conf
sudo modprobe -r dvb_usb_rtl28xxu

Your user has no permission to open it. Allow the logged in user to use the device with a udev rule. Put the IDs from lsusb (the vendor 0bda and the product 2838 in the example) into /etc/udev/rules.d/20-rtlsdr.rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", TAG+="uaccess"

and reload the rules and replug the dongle:

sudo udevadm control --reload-rules
sudo udevadm trigger

If you use several dongles, add one line for each product ID. The rtl-sdr package of your distribution may already contain such rules.

Frequency calibration

The oscillator of a cheap dongle is off by tens of ppm. gr-gsm corrects a small error by itself, but it has to be told the rough value, otherwise the receiver does not synchronise. kalibrate-rtl measures it using a nearby GSM base station.

kalibrate-rtl is not in the repositories of every distribution (it is not on Ubuntu 24.04). Build it from its upstream repository:

sudo apt-get install autoconf automake libtool librtlsdr-dev libfftw3-dev
git clone https://github.com/steve-m/kalibrate-rtl.git
cd kalibrate-rtl
./bootstrap && CXXFLAGS='-W -Wall -O3' ./configure && make
sudo make install

First scan the band to find the strongest channel (the bands are GSM850, GSM-R, GSM900, EGSM, DCS and PCS):

kal -s GSM900
GSM-900:
	chan: 1 (935.2MHz - 33.430kHz)	power: 55085.23
	chan: 3 (935.6MHz - 34.130kHz)	power: 63242.36
	...
	chan: 112 (957.4MHz - 32.934kHz)	power: 498930.07

Then measure the error on the strongest one (112 here):

kal -c 112
...
average absolute error: 35.897 ppm

Pass the result to the programs, rounded:

grgsm_livemon -p 36
grgsm_scanner -p 36
grgsm_capture -p 36 --arfcn 975 -T 30 capture.cfile

kal can correct only a small offset. If it finds nothing, use a different channel or a different band. The error changes with the temperature of the dongle, so repeat the measurement once it has warmed up.

Raspberry Pi

There are no automatic tests on ARM, and the Raspberry Pi 3 and the Pi Zero W are slow for this workload. Users report that the receiver cannot keep up with the data (the letter O printed on the console means overruns), see the issues #534 and #535. Use grgsm_livemon_headless instead of grgsm_livemon if there is no display, try a lower oversampling ratio (--osr), or process recordings on a faster computer.

Clone this wiki locally