UHD (USRP) GNU Radio on Ubuntu 12.04


Installation procedure of UHD 3.5.2 and GNU Radio v3.6.4.1
on Ubuntu v12.04 - 100% working.

What is UHD ?
The UHD is the universal hardware driver for Ettus Research products.
The goal of the UHD is to provide a host driver and API for current and future Ettus Research products. It can be used standalone without GNU Radio.
Who is Ettus Research?
Ettus Research™ specializes in low-cost, high-quality software defined radio (SDR) systems. The flagship Ettus Research product, the USRP™ (Universal Software Radio Peripheral), enables users worldwide to address a broad range of research, academic, industrial and defense applications.

What is GNU Radio?
GNU Radio is a free & open-source software development toolkit that provides signal processing blocks to implement software radios. It can be used with readily-available low-cost external RF hardware to create software-defined radios, or without hardware in a simulation-like environment. It is widely used in hobbyist, academic and commercial environments to support both wireless communications research and real-world radio systems.

Installation procedure for UHD 003.005.002 and GNU Radio v3.6.4.1 on Ubuntu v12.04

Source Installation

1. Load baseline ubuntu 12.04 image onto node

2. Build UHD from source code (​http://code.ettus.com/redmine/ettus/projects/uhd/wiki/UHD_Build)
2.1 From the root directory download the source tar ball:
root@node1-1:~# wget https://github.com/EttusResearch/UHD-Mirror/archive/release_003_005_002.tar.gz
root@node1-1:~# tar -zxvf release_003_005_002.tar.gz
root@node1-1:~# mv UHD-Mirror-release_003_005_002/ uhd

2.2 Download prerequisites for UHD
root@node1-1:~# apt-get update
root@node1-1:~# apt-get -y install emacs libboost1.48-all-dev libusb-1.0-0-dev python-cheetah doxygen python-docutils git cmake libncurses5-dev libfftw3-3 libfftw3-dev

2.3 Build UHD (http://files.ettus.com/uhd_docs/manual/html/build.html#build-dependencies)
root@node1-1:~# cd uhd/host
root@node1-1:~ /uhd/host# mkdir build
root@node1-1:~ /uhd/host# cd build
root@node1-1:~ /uhd/host/build# cmake ../
root@node1-1:~ /uhd/host/build# make
root@node1-1:~ /uhd/host/build# make test
root@node1-1:~ /uhd/host/build# make install

2.4 Set up library path
root@node1-1:~# echo "include /root/uhd/host/build/lib" >> /etc/ld.so.conf
root@node1-1:~# ldconfig

2.5 Update network interfaces to enable eth2. Add following line to /etc/network/interfaces
auto eth2
iface eth2 inet static
address 192.168.10.1
netmask 255.255.255.0
broadcast 192.168.10.255

2.6 Add following lines to /etc/sysctl.conf
net.core.rmem_max=50000000
net.core.wmem_max=1048576

3. Build GNU from source code
(?http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide)

3.1 From the root directory get source code in tarball
root@node1-1:~# wget http://gnuradio.org/releases/gnuradio/gnuradio-3.6.4.1.tar.gz
root@node1-1:~# tar -zxvf gnuradio-3.6.4.1.tar.gz
root@node1-1:~# mv gnuradio-3.6.4.1 gnuradio

3.2 Download pre-reqs (http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall)
root@node1-1:~# apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost1.48-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk2.8 git-core guile-1.8-dev libqt4-dev python-numpy ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev python-docutils gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 libasound2-dev python-gtk2

3.3 Build GNU Radio (​http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide#III-Start-the-build-process)
root@node1-1:~# cd gnuradio
root@node1-1:~ /gnuradio# mkdir build
root@node1-1:~ /gnuradio/build# cd build
root@node1-1:~ /gnuradio/build# cmake ../
root@node1-1:~ /gnuradio/build# make
root@node1-1:~ /gnuradio/build# make test
root@node1-1:~ /gnuradio/build# make install

3.4 Set up Python path variable
root@node1-1:~# PYTHONPATH=/usr/local/lib/python2.7/dist-packages/
root@node1-1:~# export PYTHONPATH
root@node1-1:~# ldconfig

4. Finally reboot the node and then ssh back in.
root@node1-1:~# reboot

5. To test out the UHD install
root@node1-1:~# uhd_find_devices
and
root@node1-1:~# uhd_usrp_probe

6. To test out gnu radio install
root@node1-1:~# gnuradio-config-info -v


RTL-SDR Spectrum Analyzer

A Swiss linux distrois used: http://www.pentoo.ch/


RTL-SDR Spectrum Analyzer

Based on the GNU Radio, you can build a RTL-SDR Spectrum Analyzer.

RTL-SDR Spectrum Analyzer

osmocom Gnu Radio Blocks
By using the OsmoSDR block you can take advantage of a common software api in your application(s) independent of the underlying radio hardware.

While primarily being developed for the OsmoSDR hardware, this block as well supports:

​FunCube Dongle through libgnuradio-fcd
​FUNcube Dongle Pro+ through ​gr-fcdproplus
sysmocom OsmoSDR Devices through ​libosmosdr
​Nuand LLC bladeRF through ​libbladeRF library
​Great Scott Gadgets HackRF through ​libhackrf
​Ettus USRP Devices through ​Ettus UHD library
​Fairwaves UmTRX through ​Fairwaves' fork of Ettus' UHD library
RFSPACE ​SDR-IQ, ​SDR-IP, ​NetSDR ​(incl. X2 option)
RTL2832U based DVB-T dongles through librtlsdr
RTL-TCP spectrum server (see librtlsdr project)
MSi2500 based DVB-T dongles through ​libmirisdr
​AirSpy R820t dongles through ​libairspy
gnuradio .cfile input through libgnuradio-blocks

Build process

The Gnu Radio block requires a recent gnuradio (>= v3.7 if building master branch or 3.6.5 when building gr3.6 branch) to be installed.

Before building the block you have to make sure that all the dependencies (see list of supported devices above) you are intend to work with are properly installed. The build system of gr-osmosdr will recognize them and enable specific source/sink components thereafter.

Please note: prior pulling a new version from git and compiling it, please do a "make uninstall" first to properly remove the previous version.

Building with cmake:

git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/


If you are building for gnuradio 3.6 series, you have to switch to the gr3.6 branch as follows

git checkout gr3.6

then continue with

mkdir build
cd build/
cmake ../


Now cmake should print out a summary of enabled/disabled components. You may disable certain components by following guidelines shown by cmake. Make sure the device of your interest is listed here. Check your dependencies and retry otherwise.

-- ######################################################
-- # gr-osmosdr enabled components
-- ######################################################
-- * Python support
-- * Osmocom IQ Imbalance Correction
-- * sysmocom OsmoSDR
-- * FUNcube Dongle
-- * FUNcube Dongle Pro+
-- * IQ File Source
-- * Osmocom RTLSDR
-- * RTLSDR TCP Client
-- * Ettus USRP Devices
-- * Osmocom MiriSDR
-- * HackRF Jawbreaker
-- * nuand bladeRF
-- * RFSPACE Receivers
--
-- ######################################################
-- # gr-osmosdr disabled components
-- ######################################################
--
-- Building for version: v0.1.0-4-g37aba331 / 0.1.1git
-- Using install prefix: /usr/local

as I do not have a USRP hardware I had to run the cmake the following way:

cmake ../ -DENABLE_UHD=OFF

Now build & install:

make
sudo make install
sudo ldconfig


after this you can try your "Spectrum Analyzer" :

~$ sudo osmocom_fft -a rtl=0 -v -f 100e6 -s 2.4e6 -g 15
gr-osmosdr v0.0.2-60-g084d193a (0.0.3git) gnuradio 3.6.4.1
built-in source types: file fcd rtl rtl_tcp rfspace
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
Using Volk machine: sse4_1_64
Set center frequency to 100000000.0

this is showing the Wide FM radio broadcast spectrum (see attached photo)
Of course you can use it for other frequency ranges depends on the tuner.
Using an RTL-SDR it the upper limit is around 1GHz.

if you want to monitor the GSM 900MHz band run the following:

~$ sudo osmocom_fft -a bladerf -v
gr-osmosdr v0.0.2-60-g084d193a (0.0.3git) gnuradio 3.6.4.1
built-in source types: file fcd rtl rtl_tcp rfspace
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
Using Volk machine: sse4_1_64
Set center frequency to 895000000.0


Building an WFM radio receiver

A tunable software defined radio receiver for Wide Band FM
settings..:

RTL-Source: samp_rate=2M Freq=105.8e6
Replace WX GUI FFT Sink with WX GUI Waterfall Sink
Add Filters-}Rational Resampler. Decimation=4. Interpolation=1.
### Note, Resamplers-}Rational Resampler Base != Rational Resampler
Add Filters-}Low Pass Filter. Cutoff Freq=100k. Transition Width=1M
Add Modulation-}WBFM Receive. Quafrature Rate=500k. Audio Decimination=1.
Add Filters-}Rational Resampler. Decimation=500. Interpolation=48.
### This will come in to play when we output to soundcard.
### Note the blue in and orange out of WBFM. IO Size. Must Match. (ie. Float vs Complex)
### Up / Down arrows to change values.
Add Audio Sink. Sample Rate=48KHz (from drop-down)
Add GUI Widgets-}WX GUI Slider.
Change Variable: freq -- Value=variable_slider_0

Screenshot

you can adjust the volume of the audio if you run:
sudo alsamixer