Author: Benjamin Sterling Silver — July 2, 2024
Software Defined Radios, SDRs, can be great tools and resources for sending and receiving radio signals but, handled incorrectly, can be quite infuriating. We hope to avoid these frustrations altogether by utilizing Radioconda, a virtual environment that acts as a package manager for thousands of Radio and Python packages.
Disclaimer: If you have already started setting up some of the drivers and programs for SDRs, you will likely want to uninstall all of the drivers that you installed before setting up Radioconda due to version discrepancies and the difficulty of sorting through duplicates. This does include removing everything installed during the setup process if something goes wrong. Python will also be included in the installation and setup of Radioconda, but having multiple versions of Python installed is less problematic than drivers as we will address further down.
To start, go to the README page here (https://github.com/ryanvolz/radioconda) to download and follow the setup instructions for Radioconda. These instructions will walk you through all of the necessary steps for configuring the settings and permissions required for each SDR you want to use.
To test and ensure that everything is properly setup, I recommend plugging your SDR into your computer and running SoapySDRUtil --find
in the Command line or a running radio-specific command such as, for USRPs, uhd_find_devices
. These commands will give you a list of all radios recognized by and connected to the computer if everything is set up correctly. If you have an SDR plugged into your computer that isn’t recognized, please refer to the above README file to view the necessary permissions and setup steps. Otherwise, those commands will provide valuable information about your radios, such as Serial Number, that you will likely want to note for later.
Once you have found your radio, go to https://pysdr.org for additional tests to run. For example, if you are working with a USRP radio, chapter 6 has some great Python scripts to choose from.
Note the specificity of those instructions to run the Python code in a terminal (a practice commonly referred to as using a REPL). This is because your terminal is already setup to run the proper versions of everything, but some specific applications may not be configured to match it yet. One common example of this is VS Code. If your python scripts work in a REPL but not VS Code, this could be a result of VS Code is running a different version of Python. There are certain advantages to this, but if you would prefer that they match, the solution is relatively simple:
Once that is set up, everything should work in VS Code the same as it does in the terminal.
GRC, or GNU Radio Companion, is another great tool for working with SDRs. To ensure that you are launching the right version of GRC, I recommend launching it from the terminal. To do this, enter the command gnuradio-companion
. If you would like to retain access to your terminal while GRC is still running, you could open a new terminal, or you could redirect the output of your application to a different location. One way to do this is via the following command:
nohup gnuradio-companion > grc.log 2>&1 &
If you would like to get a feel for the platform and ensure that your radio is receiving properly, making an FM radio receiver is basically the “Hello, World!” of GRC. This can take many forms, but here is an example that I made with a USRP: