This is an old revision of the document!
GNU Radio is a free & open-source software development toolkit that provides signal processing blocks to implement software radios or other generic processing. This articles focuses on using IIO based devices like PlutoSDR, AD-FMCOMMS2-EBZ, AD-FMCOMMS3-EBZ, AD-FMCOMMS4-EBZ, ARRADIOand AD-FMCOMMS5-EBZ within GNU Radio itself. This support is currently provided in an out-of-tree (OOT) module called gr-iio.
gr-iio requires a few main dependencies:
Since GNU Radio can come from many different sources and with many different packages includes we will try to cover all the necessary dependencies but this can differ depending on OS packaging. If you have built and installed gnuradio from source yourself you should be good to go. Otherwise, consult the GNU Radio Wiki for further documentation on the development installation.
Most dependencies do have pre-built binaries available on github (libiio, libad9361) or can be build from source as below.
Libiio requires the following packages:
Install with apt:
(sudo) apt install libxml2 libxml2-dev bison flex cmake git libaio-dev libboost-all-dev
If you want the documentation for the C API you will require doxygen:
(sudo) apt install doxygen
If you want the USB backend add libusb support:
(sudo) apt install libusb-1.0-0-dev
If you want zeroconf add avahi support:
(sudo) apt install libavahi-common-dev libavahi-client-dev
Build and install libiio from source:
git clone https://github.com/analogdevicesinc/libiio.git cd libiio mkdir build cd build cmake .. -DPYTHON_BINDINGS=ON make sudo make install cd ../..
Build and install libiio from source:
git clone https://github.com/analogdevicesinc/libad9361-iio.git cd libad9361-iio mkdir build cd build cmake .. -DPYTHON_BINDINGS=ON make sudo make install cd ../..
If you did not install libiio from source you will need the following packages as well:
Install with apt:
(sudo) apt install bison flex cmake git libgmp-dev
For GNU Radio 3.7+ to enable python support requires swig:
(sudo) apt install swig
On Ubuntu 16.04 or newer GNU Radio can be installed from the package management. The installed version should be compatible with the gr-iio package build from source. Libiio and gr-iio may also be available from the package management, but to get the latest and most feature complete work, it’s recommend to build it from the latest github sources.
git clone https://github.com/analogdevicesinc/gr-iio.git cd gr-iio cmake . make sudo make install cd .. sudo ldconfig
Since GNU Radio 3.8 is not fully mainstream across package managers 3.8+ support requires a non-master branch, specifically upgrade-3.8. To get GNU Radio 3.8+ consult the GNU Radio wiki.
gr-iio in 3.8+ requires liborc-dev
(sudo) apt install liborc-dev
Build and install gr-iio from source:
git clone -b upgrade-3.8 https://github.com/analogdevicesinc/gr-iio.git cd gr-iio cmake . make sudo make install cd .. sudo ldconfig
GNU Radio 3.8.2 is already installed on the latest Kuiper version, but if for some reason you have to install it, here is how:
apt-get update apt install gnuradio -y ldconfig
For 3.7, GNU Radio will recommend you include
/usr/local/lib${type}/python${PYVER}/site-packages/gnuradio
or
/usr/local/lib${type}/python${PYVER}/dist-packages/gnuradio
in your PYTHONPATH during installation. If this is not the case you will need to modify the cmake command for the gr-iio configuration above with:
cmake -DCMAKE_INSTALL_PREFIX=/usr .
For 3.7, certain binary installs of GNU Radio, python binding are placed in a competing folder to GNU Radio's built-in blocks. This may require you to manually copy blocks between the /usr/lib and /usr/local/lib. If you receive import error for iio_swig this is likely the case. To remedy this move the blocks between the necessary folders:
cp -r /usr/local/lib/python2.7/dist-packages/gnuradio/iio /usr/lib/python2.7/dist-packages/gnuradio/
This is due to the iio python blocks being placed in the gnuradio subfolder. This is required since the iio language binding for python would overwrite these blocks.
For 3.8, make sure the gr-iio swig interface is on your PYTHONPATH. Otherwise, you will get import errors in python. The common command would be (depending on OS and install location):
export PYTHONPATH=$PYTHONPATH:/usr/lib/python{PYTHON VERSION}/{site or dist}-packages
The added path is the location of the newly installed iio folder.
For 3.8.2 no additional steps have to be taken
GNU Radio and the gr-iio blocks are installed by default. If you want to install GNU Radio on your host consult the official GNURadio Wiki.
The current recommended way to use GNU Radio under Windows is with the Windows Subsystem for Linux (WSL). To install WLS follow the instructions from Microsoft here: https://docs.microsoft.com/en-us/windows/wsl/install-win10 . Please install Ubuntu when selecting an operating system. Note that GR 3.7 has only been tested on WSL.
Once Ubuntu is up and running go to GNU Radio install section above and proceed with “the preferred way” install, which will be much faster than pybombs.
Once all the blocks are installed an X11 server will need to be install on Windows itself so we can use GNU Radio's GUI tools. Download and install Xming in Windows.
Next back in Ubuntu, add the following to your .bashrc file:
DISPLAY=:0.0 export DISPLAY
Then in Ubuntu source the file with command
source ~/.bashrc
Next, launch Xming in Windows which should only add an icon to your taskbar tray.
Finally, launch GNU Radio Companion from Ubuntu with command
gnuradio-companion
This should launch the familar GUI for GNU Radio.
A complete GNU Radio installer with gr-iio support is provided for Windows 7/10. Please read the entire linked page before installing.
Although the GNU Radio block is called “FMCOMMS-2”, it will work with the any of the AD-FMCOMMS[234], ADRV9361, ADRV9364, ADRV9363 or ARRADIO boards. The FMCOMMS-2 IIO blocks can run over the IP network or USB. By setting the “IIO context URI” parameter to the IP address of the target board, you can stream samples from/to the remote board. It should be preferred when possible, as it is faster, knowing that the target board does not have the processing power of your PC.
Several sample flow graphs that use the FMCOMMS-2/3/4 IIO blocks are provided in our GNU Radio repository. They can be found in the “iio-example” folder.