HackRF One: Setup

From Embedded Lab Vienna for IoT & Security
Revision as of 22:44, 24 June 2021 by FVarli (talk | contribs)
Jump to navigation Jump to search

Summary

We want to get started with the HackRF One Software Defined Radio. At the end of the setup, the HackRF One will be ready to use and we will be able to see the first incoming radio signals.

Requirements

  • Operating system: Any Linux Distribution but preferably Kali or Pentoo

Description

Installation of Packages

The following commands are for Debian/Ubuntu based Linux Distributions. First, update your machine:

sudo apt-get update sudo apt upgrade

Then install the hackrf tool and libraries:

sudo apt install hackrf libhackrf-dev libhackrf0

Now install GQRX:

sudo apt install gqrx-sdr

If that does not work use:

sudo aptitude install gqrx-sdr

We also must download the newest firmware from this Git repository:

https://github.com/mossmann/hackrf/releases

Download the newest firmware .tar, e.g.:

hackrf-2021.01.1.tar.xz

Check HackRF One

Now, that we have installed the necessary software we can finally connect the HackRF One to our computer. IMPORTANT: Before you connect it to the computer, make sure you have attached the antenna. If you do not do this the HackRF One might get broken.

Hackrf.PNG

Now we must activate the USB port in the virtual machine. In Oracle Virtual Box you can do that by right-clicking the VM -> select options -> click USB -> add USB drive -> choose the HackRF One -> Restart the machine.

Now we can check if the HackRF one is recognized by the machine:

hackrf_info

When everything is correct you should see an output like this:

Output.PNG

Here you can see the HackRF One was found and some more things. Important now is the firmware version. If it is not the newest, we have to do the following: Unpack the folder we downloaded before from https://github.com/mossmann/hackrf/releases and navigate into the firmware-bin subdirectory. Then use this command to update the firmware:

hackrf_spiflash -w hackrf_one_usb.bin

Now navigate into the firmware subdirectory and use this command to update CPLD:

hackrf_cpldjtag -x ./cpld/sgpio_if/default.xsvf

Now restart the HackRF One by simply unplugging and plugging back in. You can now check if the version was updated.

Receiving Radio Waves

To validate that the HackRF One is properly working we want to test it by simply listening to Radio. To do that, we must start the previous downloaded program GQRX. You will be prompted a configuration window which you should edit like that:

Iqinput.PNG

Now the program window will open. We must do some configuration here though:

Gqrx.PNG

  • Change the Mode to ‘WFM(stereo)’
  • Increase the Gain (otherwise you will not hear anything)
  • Click the ‘Start DSP processing’ button
  • Change the Frequency (you can google for radio channel frequencies in your area or try to move the red bar inside one of the white curves)

If you can listen to the radio channel now your HackRF One is set up properly and you can move on to do other, more interesting things with it.


Used Hardware

  • HackRF One
  • Antenna (Antratek ANT500)

Courses

  • Wahlfach Projekt 1 (2021)

References