Installing RTL_Airband

As some of you may have recall, in the past I wrote up a simple radio recording setup for VHF using a Pi and Motorola Maxtrac Radios. In the spirit of improvement, I decided to try it with a RTL-SDR Dongle. In recent years these inexpensive USB dongles have taken off in popularity.

I chose RTL_Airband as the software to try. It offered numerous features that were appeasing: mp3 encoding and one hour snips of audio to name a few. The biggest issue I had in the entire process of building the setup was the compiling of the software that I chose to use. Searching the internet finally landed me the solution to the issue I was having. But, I figured I would write up a little about it in hopes that it would streamline the install for someone else. The full Wiki for the program can be found at https://github.com/szpajder/RTLSDR-Airband/wiki .

RTL Dongle attached to a RaspberryPi 3b+

Install updates

$ sudo apt-get update
$ sudo apt-get upgrade

Dependencies for Pi V1, 2, 3

$ sudo apt-get install build-essential libmp3lame-dev libshout3-dev libconfig++-dev
$ sudo apt-get install libraspberrypi-dev
$ sudo apt-get install libfftw3-dev

For RTL_SDR

$ apt-get install librtlsdr-dev

Get the software

$ cd
$ git clone https://github.com/f4exb/libmirisdr-4
$ cd libmirisdr-4
$ ./build.sh
$ cd build
$ sudo make install
$ sudo ldconfig

Time to get the program

$ cd
$ git clone https://github.com/szpajder/RTLSDR-Airband.git
$ cd RTLSDR-Airband
$ git checkout unstable
$ mkdir build
$ cd build
$ cmake ../ -DNFM=1
$ make
$ sudo make install

When running cmake, if you would like narrow FM support, you must include -DNFM=1 to enable. The program will have to be recompiled if this options is wanted later on.

Furthermore support for platform specific builds is available by adding the -DPLATFORM= option. As an example, this is what I ran for a Pi3b+:

cmake -DPLATFORM=rpiv2 -DNFM=ON ../

Other platforms are also supported:

  • rpiv1 – Raspberry Pi version 1 (ARMv6 CPU, Broadcom VideoCore IV GPU)
  • rpiv2 – Raspberry Pi version 2 or 3 (ARMv7 CPU, Broadcom VideoCore IV GPU)
  • armv7-generic – ARMv7-based platforms, no VideoCore IV GPU (eg. Cubieboard)
  • armv8-generic – 64-bit ARM platforms, no VideoCore IV GPU (eg. Raspberry Pi version 4, Odroid C2)
  • x86 – x86 or x86_64 PC, Linux
  • x86-freebsd – x86 or x86_64 PC, FreeBSD (probably you need to use gmake instead of make)

There are tons of options and features available with this software. For my use though, I simply wanted it to save the audio files, as a mp3. The configuration file can be found at:

/usr/local/etc/rtl_airband.conf

Below is how my configuration file looks:

fft_size = 1024;
devices: (
  {
    type = "rtlsdr";
    index = 0;
    gain = 48;
    centerfreq = 161.100;
    correction = 00;
    channels:
    (
      {
        freq = 161.520;
#	squelch_threshold = -60;
	modulation = "nfm";
	bandwidth = 6000;
	outputs: (
  	  {
            type = "file";
            directory = "/home/pi/radiooutput/CH94";
            filename_template = "Ranier-CH94";
            continuous = true;
            #   split_on_transmission = false;
            append = false;
	    localtime = true;
          }
    );
      },
      {
        freq = 160.86;
#	squelch_threshold = -60;
	modulation = "nfm";
	bandwidth = 6000;
        outputs: (
          {
            type = "file";
            directory = "/home/pi/radiooutput/CH50";
            filename_template = "Ranier-CH50";
            continuous = true;
            #   split_on_transmission = false;
            append = false;
            localtime = true;
          }
    );
      },
      {
        freq = 161.415;
#	squelch_threshold = -60;
        modulation = "nfm";
        bandwidth = 6000;
        outputs: (
          {
            type = "file";
            directory = "/home/pi/radiooutput/CH87";
            filename_template = "Ranier-CH87";
            continuous = true;
            #   split_on_transmission = false;
            append = false;
            localtime = true;
          }
);

      }
    );
  }
);

As of note you need to set a center frequency in the configuration file. Based on the bandwidth of the RTL you are using. Mine is 1 MHz so I wanted to set it at 161.100.

You can also see that there are some other options that are fairly self explanatory. Including the directory where I wanted the .mp3s to be stored.

To run the program in the foreground simply execute:

$ /usr/local/bin/rtl_airband -f

A couple of notes with this. I didn’t have an antenna hooked up when I took the screen shot – so the signal level is off the chart. For automatic file rollover I used the same script that I used in the past which can be found at my original RaspberryPi recording post:

One thought on “Installing RTL_Airband

  1. thanks for your insturctions wish my pi had listened to the very clear list.. oh well I tried lol

Leave a Reply

Discover more from WirelessBilly

Subscribe now to keep reading and get access to the full archive.

Continue reading