GNU Radio is an open-source software development toolkit that provides signal processing blocks to implement software radios. It can be run either with SDR kits (like USRP N210) in combination with off-the-shelf hardware tools, or without hardware in a simulation environment. I will leave this official guide page to explain why you would want to use GNU Radio in the first place.

My goal here is to explain how you can set up GNU Radio with a USRP kit on a Linux environment. I am assuming you are starting from scratch, so I will make no assumptions about dependencies.

Here are all the steps:

1- Python comes pre-installed in a Linux distribution, however, you need to set up some extra dependencies. In particular, you need to install the python package manager pip.

$ sudo apt-get install python-setuptools python-dev build-essential
$ sudo easy_install pip

2- Next, install PyBOMBS. It is a python based GNU Radio install management system for resolving dependencies and pulling in out-of-tree projects.

$ sudo pip install pybombs

3- Add a list of recipes to install some useful extensions:

$ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git
$ pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git

4- Now go to the directory where you want to install pybombs and create your prefix. Prefix is simply a directory into which gnu-radio packages are installed. This means that you can complie and run gnuradio without providing root access and also shift to a new prefix at any time.

$ cd
$ mkdir pybombs
$ pybombs prefix init pybombs -a myprefix -R gnuradio-default

Beware that the third command will take 2-4 hours depending on the speed of your connection. So, set your computer to sleep and take some rest!

5- Run GNU Radio Companion from your new prefix.

$ cd pybombs
$ . ./setup_env.sh
$ gnuradio-companion

Did a GUI interface appear with two default blocks? Yes? Great! No? Go back and make sure you followed all the instructions.

Connecting to USRP Kit

By this point, all the drivers and software you need to connect to your USRP kit have been installed. However, you need to specify some rules to make sure your computer recongizes USRP.

$ cd
$ cp pybombs/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/uhd-usrp.rules
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger

So, what happened here? We simply copied a rules file to utils directory in uhd and then used udevadm to reload the rules without having to boot.

That’s it! You shold be done now. As a final step, run:

$ uhd_usrp_probe

If everything went as expected, the command above should print out device information on your terminal.

Code

If you got lost reading up all the details, here is all the code in one place:

$ sudo apt-get install python-setuptools python-dev build-essential
$ sudo easy_install pip
$ cd
$ sudo pip install pybombs
$ pybombs recipes add gr-recipes git+https://github.com/gnuradio/gr-recipes.git
$ pybombs recipes add gr-etcetera git+https://github.com/gnuradio/gr-etcetera.git
$ mkdir pybombs
$ pybombs prefix init pybombs -a myprefix -R gnuradio-default
$ cd pybombs
$ . ./setup_env.sh
$ cd
$ cp pybombs/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/uhd-usrp.rules
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger

Where To Go From Here?

  • Start with this lab for some basic introduction. It contains exercises from creating and plotting sine waves to building your own FM receivers.

  • Follow this tutorial to create your own custom python blocks.

  • Read a range of tutorials on GNU Radio official page.