Skip to content

Instantly share code, notes, and snippets.

@AlekEagle
Last active August 3, 2023 17:51
Show Gist options
  • Save AlekEagle/4d114bca72809e673cb65ba78f633ffb to your computer and use it in GitHub Desktop.
Save AlekEagle/4d114bca72809e673cb65ba78f633ffb to your computer and use it in GitHub Desktop.

Using an SDR on Linux

Introduction

This is a quick guide to getting started with an SDR on Linux. It is not intended to be a comprehensive guide to SDRs or Linux, but rather a quick start guide to get you up and running as quickly as possible.

Getting Started

First we need to give ourselves permission to access (in our case) the SDR we're using. This is done by creating the file /etc/udev/rules.d/20-rtlsdr.rules with the following contents:

# Realtek Semiconductor Corp. RTL2838 DVB-T
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666", GROUP="adm", SYMLINK+="rtl_sdr"

(More SDRs will be added as more are tested.)

This will allow any user in the adm group to access the SDR. To avoid restarting your computer for this change to take effect, run the following command:

sudo udevadm control --reload-rules

To add yourself to the adm group, run the following command:

sudo usermod -a -G adm $USER

You will need to log out and log back in for this change to take effect.

Installing Software

In this guide we will be using GQRX as our SDR software.

Debian/Ubuntu

It is available in the Debian and Ubuntu repositories, so we can simply install it with the following command:

sudo apt install gqrx-sdr

Arch Linux

If you aren't using a Debian or Ubuntu based distribution of Linux, it's possible that you are running a flavor of Arch Linux. Luckily, Arch Linux also includes GQRX in their package repositories as well, and can simply be installed with the following command:

sudo pacman -Sy gqrx

NOTE: When installed on Arch Linux, GQRX does not add an entry to the Application Launcher (The Linux Desktop Environment equivalent of Window's Start Menu.) To run it, you need to open a terminal and run the command gqrx.

Commands Used

Here's all of the commands used in one place for easy copy-pasting:

# Create the udev rules file
sudo tee /etc/udev/rules.d/20-rtlsdr.rules <<EOF
# Realtek Semiconductor Corp. RTL2838 DVB-T
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666", GROUP="adm", SYMLINK+="rtl_sdr"
EOF

# Reload the udev rules
sudo udevadm control --reload-rules

# Add yourself to the adm group
sudo usermod -a -G adm $USER

# Install GQRX

## Debian/Ubuntu
sudo apt install gqrx-sdr

## Arch Linux
sudo pacman -Sy gqrx

Be sure to log out and log back in after this or you might not be able to access the SDR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment