-
Notifications
You must be signed in to change notification settings - Fork 48
GNURadio
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.
Table of contents
- 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 2019
- Boost runtime DLLs are included with the installer. Users developing C++ GR blocks will need boost development files.
- GnuRadio is build against Python3.9
1) Install Python3.9 for amd64
This is a 64-bit installer and GNU Radio requires the 64-bit version of Python 3.9. Look for the "Windows x86-64 MSI installer" on the python downloads page.
Note: If you choose to customize the python install options, make sure that the "register extension" box is checked. This tells the installer how to find Python at runtime through the windows registry.
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.
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.
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.
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".
The PothosSDR installer does not provide a complete development environment. You will also need the following to develop GNU Radio blocks:
- CMake: https://cmake.org/download/
- MSVC (match the installer's version)
- Boost development files: http://sourceforge.net/projects/boost/files/boost-binaries/
- Also match the installer's copy of boost runtime in bin/boost*.dll
- Read more: https://github.com/pothosware/PothosSDR/wiki/Development
Supporting this project relies on community help to test the installer and to report bugs.
Found a bug? having a problem? Let us know: https://github.com/pothosware/PothosCore/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.
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.
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/python3.9/site-packages".
Make sure that the installer's python path shows up in the following list:
C:\Python39\python.exe -c "import sys; print('\n'.join(sys.path))"
Make sure the following commands work before continuing:
gnuradio-config-info.exe C:\Python39\python.exe -c "from gnuradio import gr"
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:\Python39\python.exe GNURadioHelper.py
As an alternative to the automatic instructions, we also provide manual instructions below.
1) Install most packages with pip
C:\Python39\Scripts\pip.exe install PyQt5 numpy mako pyyaml
2) Install pygtk with pip
Build your own pygtk with https://github.com/wingtk/gvsbuild or use the pre-built wheel and install with pip:
C:\Python39\Scripts\pip.exe install http://downloads.myriadrf.org/binaries/python39_amd64/PothosSDRPyGTK-2021.1.21-cp39-cp39-win_amd64.whl
3) A quick import test
Make sure the following import tests work before continuing:
C:\Python39\python.exe -c "import PyQt5" C:\Python39\python.exe -c "import numpy" C:\Python39\python.exe -c "import mako" C:\Python39\python.exe -c "import yaml" C:\Python39\python.exe -c "import gi; from gi.repository import Gtk"