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 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
Create a working directory.
$ mkdir ~/sdr
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.
Move to the hackrf/host directory.
$ cd hackrf/host
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
Build and Install.
$ make $ sudo make install $ sudo ldconfig
Connect the your HackRF One.
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: ...
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.
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.
Clone the GrOsmoSDR repository:
$ cd ~/sdr $ git clone git://git.osmocom.org/gr-osmosdr
Note: When I cloned, I got changeset 58d95b51
.
Move to the repository:
$ cd gr-osmosdr
Create the build directory, move to it, and use Cmake to create the Makefiles required for building.
$ mkdir build && cd build $ cmake ../
Build and Install.
$ make $ sudo make install $ sudo ldconfig
Follow this instructions:
$ sudo apt-get install gqrx-sdr $ sudo apt-get install libvolk1-bin $ volk_profile
Clone the GPS-SDR-SIM repository:
$ cd ~/sdr $ git clone https://github.com/osqzss/gps-sdr-sim
Move to the repository:
$ cd gps-sdr-sim
To build it use GCC:
$ gcc gpssim.c -lm -fopenmp -o gps-sdr-sim
- open file browser home dir
- Ctrl-H to show hidden files
- open file: .bashrc
- add this line:
export PATH="/home/user/sdr/gps-sdr-sim:$PATH"
$ hackrf_si5351c -n 0 -r
Dynamic mode:
$ gps-sdr-sim -b 8 -e brdc2400.16n -g nmea.txt
Static mode (location China):
$ gps-sdr-sim -b 8 -e brdc2400.16n -l 30.286502,120.032669,100
$ hackrf_transfer -t gpssim.bin -f 1575420000 -s 2600000 -a 1 -x 0