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
#have_mfpu_neon:INTERNAL=1
# to
#have_mfpu_neon:INTERNAL=0
nano CMakeCache.txt  #do the thing
make
sudo make install

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

Comments

Mike Mahoney, July 24, 2016 at 12:33 am

Running a new “Raspbian Jessie” image

Next set up hackrf.

———————————-
Error during the “cmake . . ”
– Configuring Boost C++ Libraries…
– Could NOT find Boost
CMake Error at CMakeLists.txt:125 (message):
Boost required to build gr-osmosdr

– Configuring incomplete, errors occurred!
—————————————————————————

Recommendations?

tomas, September 3, 2016 at 2:02 am

Install boost. Something like

apt-get install libboost-dev

For a list of all boost dev packages do something like

apt-cache search libboost|grep \\-dev

GAURAV PUROHIT, November 4, 2016 at 8:33 am

how to install gr-extra on pi for using pyserial and gr-pyserial

tomas, November 25, 2016 at 11:03 pm

No idea. Maybe configure gnuradio with everything enabled? Can’t find a package named gr-extra or gnuradio-extra so don’t know what would be in it


GAURAV PUROHIT, November 4, 2016 at 8:34 am

who on pi, this is possible https://github.com/jmalsbury/gr-pyserial/wiki/Installation