HackRF/June 2016: Difference between revisions
From charlesreid1
| Line 16: | Line 16: | ||
</pre> | </pre> | ||
== | ==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. | Next step was to install GnuRadio. Unfortunately, the version in the stable Debian repos, 3.7.5, is too old to work with osmosdr. | ||
| Line 29: | Line 29: | ||
* run <code>apt-get dist-upgrade</code> | * run <code>apt-get dist-upgrade</code> | ||
* run <code>reboot</code> | * run <code>reboot</code> | ||
==Install GnuRadio== | |||
Okay, now install gnuradio: | |||
<pre> | |||
$ apt-get install gnuradio gnuradio-dev | |||
</pre> | |||
==Install More Stuff== | ==Install More Stuff== | ||
Revision as of 06:24, 4 June 2016
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.listto 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 More Stuff
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
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
Links
Getting started notes for the HackRF: https://github.com/mossmann/hackrf/wiki/Getting-Started-with-HackRF-and-GNU-Radio
Getting started notes for osmocom blocks/modules: http://gmr.osmocom.org/trac/wiki/GettingStarted
Gnuradio tutorials (meh): http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials
osmocom transmission? I don't know: https://github.com/osmocom/osmo-trx
GSM sniffing (do this later): http://www.instructables.com/id/SMART-SNIFFING-GSM-TRAFFIC-ON-WINDOWS-WORKSTATION-/