Installing GNU Radio and RTL-SDR on ElementaryOS

This is another GNU Radio and RTL2832U Software Defined Radio tutorial based on the article I did on Ubuntu 18.04. ElementaryOS is one of Ubuntu based operating system. The ElementaryOS is designed to be easy to use and the user interface is a lot like the macOS. This ElementaryOS GNU Radio installation tutorial is made for people who just started using Linux so they can transition painlessly to using Linux for RTL SDR and GNU Radio purposes.

Installing the GNU Radio and GNU Radio Companion

Installing GNU Radio and the GNU Radio companion is as easy on ElementaryOS as it is on Ubuntu 18.04, all we need is to access the gnuradio package from APT.

# apt install gnuradio

The package installation takes a while, after finishing the GNU Radio 3.7.11-10 is finally installed on the computer. You can access the GNU Radio Companion program via Terminal or via Application Launcher.

$ gnuradio-companion

Now, we can use GNU Radio and the GNU Radio Companion, the next step of this tutorial is to install the RTL SDR package to use with GNU Radio. This will allow us to receive the IQ data from RTL SDR and use the GNU Radio to process the data as we need.

Screenshot from 2019-03-20 20.36.12
Figure 1. GNU Radio Companion on ElementaryOS

GNU Radio Source

As we can see on the Terminal output of gnuradio installation, the rtl-sdr driver is already installed, the only thing needed to be installed is the GNU Radio Blocks for RTL-SDR via the gr-osmosdr package. The gr-osmosdr is already available in the APT in ElementaryOS.

# apt install gr-osmosdr

After installing the GNU OsmoSDR module, we can access the RTL-SDR source block on GNU Radio Companion under the Sources category.

Screenshot from 2019-03-20 20-59-14
Figure 2. RTL SDR Source on GNU Radio Companion

This concludes the tutorial on how to install GNU Radio Companion on ElementaryOS. Other Ubuntu based operating system should work the same, the APT can be used as a simple way to install the GNU Radio. However, it may not be the latest version, if you need the latest version always use the source and compile your own version by CMake.

Installing GNU Radio for Software Defined Radio on Ubuntu 18.04

As I mentioned previously on my Frequency Modulation Basics post, I would be taking a practical approach to explain the concept of Frequency Modulation. This tutorial explains how to install the GNU Radio on Ubuntu 18.04 alongside the GNU Radio Companion and the SDR dongle support.

Installing the GNU Radio and GNU Radio Companion

First, we can begin by installing the GNU radio package via APT, but check first if the version in the APT system is up to date. As of the writing of this article, GNU Radio on Ubuntu 18.04’s APT is on 3.7.11 and the current version is on 3.7.13.4. To simplify matters, I will use the Ubuntu 18.04’s APT version until I encounter a bug that will only be fixed on the latest version.

# apt-get install gnuradio

The package installation takes a while, after finishing the GNU Radio 3.7.11-10 is finally installed on the computer. You can access the GNU Radio Companion program via Terminal or via Application Launcher.

$ gnuradio-companion

Now, we can use GNU Radio and the GNU Radio Companion, the next step of this tutorial is to install the RTL SDR package to use with GNU Radio. This will allow us to receive the IQ data from RTL SDR and use the GNU Radio to process the data as we need.

Screenshot from 2019-03-20 09-20-40
Figure 1. GNU Radio Companion Window

Software Defined Radio GNU Radio Module

The Software Defined Radio that we will be using is the ubiquitous and inexpensive RTL2832U based DVB-T Dongles turned to Software Defined Radio. We can use the GNU Radio module developed by Osmocom. To build this GNU Radio block module, we need at least GNU Radio v3.7, which is already installed via the Ubuntu APT.

We can install the GNU Radio Osmocom SDR module from the git repository of osmocom or via the github mirror. Before installing the GNU Radio Source, we first must install the RTL-SDR driver created by Osmocom for RTL2832U-based Software Defined Radio dongles.

RTL2382U Driver

First, we have to install any dependencies and required packages before we can build our GNU Radio Osmocom SDR module. The required packages are cmake and build-essential to make sure we can compile the source and install the module. We also need the libusb-1.0-0-dev for the SDR.

# apt-get update
# apt-get install cmake build-essential libusb-1.0-0-dev

Then, we have to clone the repository, save the cloned repository in the desired place, for example we can put it on the Downloads folder

$ cd ~/Downloads
$ git clone https://github.com/osmocom/rtl-sdr.git

After cloning the repository, we can begin installing first by creating the build file and compiling the source via CMake. After compiling, we can install the rtl_sdr. Use the following commands on the Terminal:

$ mkdir build
$ cd build
$ cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
$ make
# make install
# ldconfig

Make sure to have both the build options INSTALL_UDEV_RULES=ON and DETACH_KERNEL_DRIVER=ON. UDEV_RULES is needed to access the dongle as non-root user, and DETACH_KERNEL_DRIVER will detach the default kernel driver for the RTL2832U DVB.

GNU Radio Source

After installing the RTL SDR driver, we need to install the GNU Radio Source module that is provided also by Osmocom. We can also install this automatically via APT-GET since we don’t need  to change any build configuration, use the following command to install the gr-osmosdr package:

# apt-get install gr-osmosdr

After installing, we can access the RTL SDR source on GNU Radio Companion menu under the Sources category.

Screenshot from 2019-03-20 10-58-43
Figure 2. RTL-SDR Source on GNU Radio Companion

That’s it for today’s tutorial, we will explore more about GNU Radio and RTL SDR when I have finished my Frequency Modulation basics series and we will demonstrate the analysis of a real narrow-band and wide-band FM wave on SDR + GNU Radio Companion.