Tag Archives: raspberrypi

Setting up GNURadio for Raspberry Pi 2

ACTUALLY just download this Raspbian image which comes with gnuradio + hackrf + all the good stuff already (magnet link, direct link).

Another possibility is to use the regular Raspbian image and add the appropriate ppa with a prebuilt gnuradio in it. See this link for more information about that. In short:

Edit /etc/apt/sources.list and add the following line:

deb http://archive.raspbian.org/raspbian jessie main

Then update apt and install gnuradio and gnuradio-dev:

sudo apt-get update && sudo apt-get install gnuradio gnuradio-dev

Installing gqrx + osmocom + related stuff is also recommended:

sudo apt-get install gr-osmosdr libosmosdr-dev gqrx-sdr

That should get you set up for developing with gnuradio, grc and related python things :)

So far I’ve found 500 ksps is about the maximum samplerate the RPi2 can handle when running gnuradio via Python. It might be possible to go faster, since hackrf_transfer claims a transfer speed of 20 MiB/s is possible (corresponding to 10 Msps).

I’m leaving the compilation guide I already started as-is, despite not getting it to do what I wanted. Perhaps it’ll be useful to someone:

This post is an attempt at document my getting hackRF One + GNURadio running on Raspberry Pi 2.

gnuradio requires CMake>=2.8.10 for NEON support, raspbian ships with cmake 2.8.9. Grrmblr. So install that first:

git clone https://cmake.org/cmake.git
cd cmake
git checkout v2.8.10
./configure && make -j3 && sudo make install

Three cores are used for make to speed things up (-j3). Four would cause X to hang. Configuring and compiling cmake will take a while, so go grab a coffee, do laundry or somesuch.

Next set up hackrf. I didn’t record this step, but if I recall correctly you need to download, compile and install gr-osmosdr. Something like this:

git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr
mkdir build
cd build
cmake ..
make -j3
sudo make install

You can check that you got it right by running hackrf_info, then hackrf_transfer -c 127 -f 433960000 to check that the transmit functionality works (remember to attach an antenna).

Finally it is time to install gnuradio itself. A small note on boost here, since it always tends to be a problem for people stumbling upon guides like this: I’m using version 1.49. At the time of writing the latest version available via apt was 1.50. The latest official version (outside Debian) was 1.60.0.

sudo apt-get install libboost-dev libboost-filesystem-dev \
    libboost-system-dev libboost-test-dev \
    libboost-program-options-dev python-pip libcppunit-dev \
    libfftw3-dev   #TODO: gr-fft doesn't build, figure out why
sudo pip install cheetah
git clone https://github.com/gnuradio/gnuradio.gitcd gnuradio
git checkout 72dcbdb  #optional, master as of writing
git submodule init
git submodule update
mkdir build
cd build
cmake ..
# For some reason NEON doesn't work, so disable it by in CMakeCache.txt changing the line
# to
nano CMakeCache.txt  #do the thing
sudo make install

This will build and install.. some parts of gnuradio. Not the Python stuff though, which is what I need. Fffffff-