GNURadio

Pavel Demin edited this page Oct 19, 2016 · 40 revisions

Bundled GNURadio + GrOsmoSDR

GNU Radio and GrOsmoSDR are bundled with the PothosSDR Windows installer. This allows the GNU Radio blocks to be used within the Pothos framework API and GUI. However, with some additional python dependencies, users can use stock GNU Radio with the GNU Radio companion on a Windows OS.

https://cloud.githubusercontent.com/assets/6347325/12695075/b9435968-c742-11e5-81ce-38557dc55781.png

Notes about the installer

  • The installer is built for 64-bit Windows (amd64).
  • The build configuration is RelWithDebInfo (compatible with Release mode builds).
  • We provide installers for development with MSVC 2013 and 2015
  • Boost runtime DLLs are included with the installer. Users developing C++ GR blocks will need boost development files.
  • GnuRadio is build against Python2.7. We will probably switch to Python3 when its officially supported.
  • GrQtGUI is not included in the installer. Pothos GUI and plotters are based around Qt5, and the PothosSDR installer includes Qt5 runtime. We will be able to build GrQtGUI when GNU Radio switches to Qt5.

Installation instructions

1) Install Python2.7 for amd64

This is a 64-bit installer and GNU Radio requires the 64-bit version of Python 2.7. Look for the "Windows x86-64 MSI installer" on the python downloads page.

2) Install PothosSDR environment

Follow the download and install instructions from the PothosSDR tutorial. We highly recommend following the "recognizing your device" instructions as well. The Pothos GUI instructions are optional, but they might be worth trying out.

3) Run GNURadio Companion

At this point your install is probably missing python modules and the gtk+ runtime. Run GNURadio Companion from the start menu. If the application fails for any reason, the GNURadioHelper script will be automatically invoked to run sanity checks and to install missing dependencies.

Application notes

GNURadio Configuration

To use portaudio you first need to edit config in %appdata%/.gnuradio/config.conf (if the folder doesn't exist then create it) so it will look like this:

[audio]
audio_module = portaudio

Now let's check and see if the config was loaded.

First check if PothosSDR Prefix exist:

gnuradio-config-info --prefix

you should get something like this:

C:\Program Files\PothosSDR

now check if config got loaded:

python -c "from gnuradio import gr; print gr.prefs().to_string()"

and you should see something like this:

[audio]
audio_module = portaudio

[audio_portaudio]
verbose = false

[controlport]
edges_list = False
on = False

[default]
max_messages = 8192
verbose = False

[grc]
canvas_default_size = 1280,1024
canvas_font_size = 8
global_blocks_path = C:\PothosSDR\share\gnuradio\grc\blocks
local_blocks_path =
xterm_executable = xterm

[log]
debug_file = stderr
debug_level = emerg
log_file = stdout
log_level = debug

[modtool]
newmod_path = C:\PothosSDR\share\gnuradio\modtool\gr-newmod

[perfcounters]
clock = thread
export = False
on = False

[wxgui]
fft_rate = 15
frame_decim = 1
style = auto

Now just open config.conf (if the file doesn't exist create it) in you favourite text editor and add:

[audio]
audio_module = portaudio

Save the file and run GNURadio.

GNURadio Companion

Use the start-menu shortcut or invoke the GNURadio Companion from the command line:

gnuradio-companion

Ignore the following warnings:

  • GtkWarning: Could not find the icon 'gnuradio-grc'. The 'hicolor' theme was not found either, perhaps you need to install it.
  • UserWarning: You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.

Other known issues:

  • Blocks cannot be dragged and dropped from the block tree to the graph editor. The reason is unknown, but it appears to be an issue with GTK+ and not an issue with GRC itself. The work-around is to double click on a block in the tree to add it to the editor.

GrOsmoSDR blocks

Most folks will use the GrOsmoSDR source and sink blocks to interface with their SDR device. Because the GrOsmoSDR blocks are compiled with support for as many devices as possible, its best practice to specify specifically which device driver to invoke. For example, to use the first HackRF attached to your system, set the device arguments parameter to "hackrf=0".

https://raw.githubusercontent.com/wiki/pothosware/PothosSDR/images/osmo_source_hackrf.png

Developing blocks

The PothosSDR installer does not provide a complete development environment. You will also need the following to develop GNU Radio blocks:

Getting involved

Supporting this project relies on community help to test the installer and to report bugs.

Reporting problems

Found a bug? having a problem? Let us know: https://github.com/pothosware/pothos/wiki/Support

If you think the bug is narrowed down to a specific software package, post an issue to the PothosSDR issue tracker and to the relevant package's issue tracker as well. This helps us to coordinate to fix issues. We don't want to lose track of an issues or problems that may have been resolved.

Upstreaming patches

We tend to collect a lot of patches the PothosSDR this installer, you can find them here: https://github.com/pothosware/PothosSDR/tree/master/patches Typically we add conditional ifdef and build checks to account for the MSVC compiler differences. Therefore, most of the patches are very small and non-breaking for the standard GCC compiler usage.

Ideally, the patches/ directory should be empty. We are looking for volunteers; anyone who can apply a patch, test the patch on a standard Linux/GCC box, and get the patch upstreamed to its respective project. This can helps others who build with the MSVC compiler from duplicating the same fixes, and makes building future PothosSDR installers more manageable.

Debugging the installation

Environment path notes

Several environment variables must be set in order to use GNURadio runtime, companion, and python modules:

  • The installer should automatically set the GRC_BLOCKS_PATH.
  • Follow the notes about setting the PATH from the tutorial.
  • The installer should also automatically set the PYTHONPATH. If not, manually set the PYTHONPATH to include the GNURadio modules, typically this is "C:/Program Files/PothosSDR/lib/python2.7/site-packages".

Make sure that the installer's python path shows up in the following list:

C:\Python27\python.exe -c "import sys; print('\n'.join(sys.path))"

Make sure the following commands work before continuing:

gnuradio-config-info.exe
C:\Python27\python.exe -c "from gnuradio import gr"

Install dependencies (automatic)

We provide a Python script called GNURadioHelper.py that checks the version of python, looks for various runtime libraries, and test imports various python modules. When a dependency is missing, the script automatically downloads and installs the missing dependency, or prints out a helpful message to guide the user.

Download and run the GNURadioHelper script. Some dependencies make modifications to the system PATH, and require that you close the terminal and re-run the script:

C:\Python27\python.exe GNURadioHelper.py

As an alternative to the automatic instructions, we also provide manual instructions below.

Install dependencies (manual)

1) Download Cheetah, OpenGL, PyGTK, WxPython, LXML, and Numpy wheel files for amd64

2) And install all wheel files with Pip

C:\Python27\Scripts\pip.exe install <path to each whl file>

3) Install GTK+ Runtime for 64-bit

Download and install the 64-bit GTK+ runtime, make sure it matches the PyGTK version number: http://lvserver.ugent.be/gtk-win64/gtk2-runtime/

4) A quick import test

Make sure the following import tests work before continuing:

C:\Python27\python.exe -c "import Cheetah"
C:\Python27\python.exe -c "import OpenGL"
C:\Python27\python.exe -c "import gtk"
C:\Python27\python.exe -c "import wx"
C:\Python27\python.exe -c "import lxml"
C:\Python27\python.exe -c "import numpy"