Software Defined Radio (SDR) has been around for a long time. It wasn’t until recently, however, that it was discovered that a cheap $18 USB TV Tuner dongle could be used to sample arbitrary radio signals in the range of 25MHz to 1750MHz (give or take). With some great open source tools like GNU Radio, meaningful data can be extracted from these samples (for instance, demodulate and playback FM radio stations).

In August of last year, I backed the HackRF project on Kickstarter. Last week, my HackRF One finally arrived and it was well worth the wait.

Here’s why it’s awesome:

[The] HackRF One from Great Scott Gadgets is a Software Defined Radio peripheral capable of transmission or reception of radio signals from 10 MHz to 6 GHz. -HackRF Homepage

If you didn’t back the project on Kickstarter, don’t worry. You can pick one up from NooElec for about $300.

Yes, it’s certainly much more expensive than the $18 USB dongle. The SDR TV Tuner dongles are fun, but having a device that can both receive and transmit in 10MHz to 6GHz is infinitely more entertaining. You’ll have to decide for yourself if your hard-earned dollars are worth it.


I’d like to take a second to mention that HackRF is completely open source. This means that you are free to download the schematics and build your own HackRF One. You are also free to modify the software as you see fit. In fact, all of the software that you’ll be using here is open source and free (as in liberty and beer). To learn more about Free Software, you can look at the Wikipedia article or visit the Free Software Foundation.

Summary

Figuring out what you need to install to get going can be a drag, so I’ll spare you the work and tell you how to quickly get started on an Ubuntu 14.04 LTS system.

Don’t worry, this is going to be relatively painless.

Here’s what we’re going to do:

  • Install some dependencies,
  • Build and Install the HackRF Host Software (libraries and tools),
  • Install GNU Radio,
  • Build and Install GrOsmoSDR,
  • Build and Install Gqrx, and finally
  • Use Gqrx to tune into a local FM radio station.

Install Dependencies

  1. Install the build dependencies.

    $ sudo apt-get install git \
                           build-essential \
                           cmake \
                           libusb-1.0-0-dev \
                           liblog4cpp5-dev \
                           libboost-dev \
                           libboost-system-dev \
                           libboost-thread-dev \
                           libboost-program-options-dev \
                           swig
    
  2. Create a working directory.

    $ mkdir ~/sdr
    

Build HackRF Host Software

  1. Clone the HackRF repository.

    $ cd ~/sdr
    $ git clone https://github.com/mossmann/hackrf.git
    

Note: When I cloned, I got changeset 740940f8. As this article ages, you will likely get a different version, and that’s okay. I’m just recording this as a known-working version.

  1. Move to the hackrf/host directory.

    $ cd hackrf/host
    
  2. Create the build directory, move to it, and use Cmake (installed earlier) to create the Makefiles required for building.

    $ mkdir build && cd build
    $ cmake ../ -DINSTALL_UDEV_RULES=ON
    
  3. Build and Install.

    $ make
    $ sudo make install
    $ sudo ldconfig
    

Test the HackRF Device

  1. Connect the your HackRF One.

  2. Run the hackrf_info tool to get some device information.

    $ hackrf_info
    Found HackRF board.
    Board ID Number: 2 (HackRF One)
    Firmware Version: ...
    Part ID Number: ...
    Serial Number: ...
    

Download and Install GNU Radio

Now let’s download and install GNU Radio.

$ sudo apt-get install gnuradio \
                       gnuradio-dev \
                       gr-iqbal

Note: When I installed, I got version 3.7.2.1.

Download, Build, and Install GrOsmoSDR

Now we’ll download, build, and install GrOsmoSDR. GrOsmoSDR is essentially middle-ware that allows GNU Radio to communicate with the HackRF software to control your HackRF One.

  1. Clone the GrOsmoSDR repository:

    $ cd ~/sdr
    $ git clone git://git.osmocom.org/gr-osmosdr
    

Note: When I cloned, I got changeset 58d95b51.

  1. Move to the repository:

    $ cd gr-osmosdr
    
  2. Create the build directory, move to it, and use Cmake to create the Makefiles required for building.

    $ mkdir build && cd build
    $ cmake ../
    
  3. Build and Install.

    $ make
    $ sudo make install
    $ sudo ldconfig
    

Download, Build, and Install Gqrx

  1. Clone the Gqrx repository:

    $ cd ~/sdr
    $ git clone https://github.com/csete/gqrx.git
    

Note: When I cloned, I got changeset e9171ff9.

  1. Move to the repository:

    $ cd gqrx
    
  2. Create the build directory, move to it, and use qmake (not Cmake) to create the Makefiles required for building.

    $ mkdir build && cd build
    $ qmake ../
    

Note: You may get a message about no prefix being given. This is ok.

  1. Build and Install.

    $ make
    
  2. Run Gqrx

    $ ./gqrx
    

Tune into a Local FM Radio Station

  1. When you start Gqrx for the first time, you’ll see the device configuration window.

Everything should already be set up and ready to go.

Press OK and the main window will appear.

  1. On the right-hand side, switch Mode to WFM (stereo).

  1. Now mouse over the frequency at the top of the window and change it to a local radio station. Here in Arizona, I like to listen to 97.9 FM KUPD.

  1. Lastly, click the power button in the top-left corner and the DSP will start.


  • If the audio is too quiet, you can use the Gain control in the bottom-right corner to adjust the volume.
  • If the audio is choppy, try reducing the sample rate from the configuration menu. A sample rate of 6000000 worked best on my system.

The End

Thank you to the HackRF designer, Michael Ossmann, to the other backers of the Kickstarter project, and to the many maintainers and supporters of all the awesome open source software.