HackRF/VirtualBox
From charlesreid1
Instructions: Debian Virtualbox
These are instructions for how to get the HackRF working with a Macbook Pro running OS X, by running the HackRF through a Debian VirtualBox.
Create Debian VirtualBox
I created a VirtualBox running Debian 8.4 and the XFCE desktop.
Install Libhackrf
Next step was to install HackRF libraries:
$ aptitude search hackrf $ apt-get install libhackrf0 libhackrf-dev
Switch to Sid
Next step was to install GnuRadio. Unfortunately, the version in the stable Debian repos, 3.7.5, is too old to work with osmosdr.
The unstable Debian repo, sid, has version 3.7.9, which was late enough to work with osmosdr.
Guess I'm upgrading to sid (unstable Debian). Instructions: https://www.digitalocean.com/community/tutorials/upgrading-debian-to-unstable
The short version is:
- edit your
/etc/apt/sources.list
to replace stable repos with unstable repos - run
apt-get update
- run
apt-get dist-upgrade
- run
reboot
Install GnuRadio
Okay, now install gnuradio:
$ apt-get install gnuradio gnuradio-dev
Install Cmake and Boost
We also need cmake to build osmosdr stuff, and boost because osmosdr links to it.
$ apt-get install cmake $ apt-get install libboost-dev libboost-all-dev $ ldconfig
Install GnuRadio Osmo SDR Stuff
To successfully use a HackRF with Gnu Radio, you need version 3.7 or later, and GnuRadio Osmo SDR block.
Follow these instructions for installing the block: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
git clone git://git.osmocom.org/gr-osmosdr cd gr-osmosdr mkdir build cd build cmake ../
This will generate a makefile that you can use to build the osmo blocks for gnuradio.
make clean make sudo make install
Whatever you do, do not use make -j2
, or the Python SWIG bindings will be broken.
Testing GnuRadio Osmocom Blocks
To test that the Osmo sdr stuff was installed correctly, open Gnu Radio Companion:
$ gnuradio-companion
Look for an Osmo source block, listed under "Sources":
Instructions: Andy's Ham Radio Linux
Download KB1OIQ Andy's Ham Radio Linux
Start by downloading Andy's Ham Radio Linux. This is a Debian distribution with a slew of useful radio programs, including NEC, the antenna simulation software. This also comes with gnuradio, gqrx, and other useful sdr tools, so this is a good candidate operating system to get the HackRF working.
Alternatively, you can use Pentoo, which is recommended by the HackRF folks, or Kali, although I understand some people have had a harder time with SDR after the January 2016 rolling release of Kali. You can also use the Gnu Radio Companion virtualbox provided by the Gnu Radio project, which runs Ubuntu.
https://github.com/mossmann/hackrf/wiki/Getting-Started-with-HackRF-and-GNU-Radio
Install KB1OIQ Linux
Once you've downloaded Andy's Ham Radio Linux and run it, you'll see that it is relatively spartan - it's using icewm, good for older, junky machines. Everything has an early 90s feel. You can take a look around at all the programs available: Andys Ham Radio Linux
Get a Reasonable Terminal
the xterm that comes with Any's ham radio linux is terrible, horrible, ugly, awful, and cruddy. Update it first thing:
$ apt-get install gnome-terminal
Get a Reasonable Key Repeat Rate
Another problem is the keyboard repeat rate, which is by default set to wait for about 6 seconds before it starts repeating, and only repeats about 3 characters per second. Absuuuuuuurd.
You can fix this by using the xset command. This command fixes the repeat rate once, if executed from the command line:
xset r 120 70
To make this happen every time, add this command to the list of things icewm does when it starts the x server. Edit the file:
$ vim /etc/X11/icewm/startup
abd add the line
xset r rate 120 70
now everything should work fine - log out, log back in, and test it out.
Install Libhackrf
apt-get install libhackrf0 libhackrf-dev
Install GnuRadio Osmo SDR Stuff
To successfully use a HackRF with Gnu Radio, you need version 3.7 or later, and GnuRadio Osmo SDR block.
Follow these instructions for installing the block: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
git clone git://git.osmocom.org/gr-osmosdr cd gr-osmosdr mkdir build cd build cmake ../
This will generate a makefile that you can use to build the osmo blocks for gnuradio.
make clean make sudo make install
Whatever you do, do not use make -j2
, or the Python SWIG bindings will be broken.
Testing GnuRadio Osmocom Blocks
To test that the Osmo sdr stuff was installed correctly, open Gnu Radio Companion, and look for an Osmo source block, listed under "Sources":
Test Drive The HackRF
Now that you've installed all the requisite software, you're ready to run GnuRadio with an Osmocom SDR source, which is what will allow you to use the HackRF with GnuRadio and receive signals from it.
Start by plugging in the HackRF and making sure it is present and visible by the computer:
$ hackrf_info
Download the FM receiver test (the HackRF equivalent of "Hello world") from here: http://github.com/rrobotics/hackrf-tests
Now run the FM receiver test from the command line. You should hear some static from your speakers:
$ python fm_radio_rx.py