InfoSec Write-ups – Medium–
LimeSDR setup with GNURadio, gr-limesdr and GQRX on Ubuntu-20.04
Bored of this pandemic and I Finally dusted my LimeSDR and setup lab in Ubuntu-20.04. Ubuntu-20.04 has added all the previous PPAs of SDR domain into its default APT cache. This caught my attention. So we will look into how to setup the Lime stack. Not just LimeSuite or Lime tools but other software stacks like osmo-bts, gnuradio and other tools without PPAs. We will also see how to setup LimeSDR as UHD source. Which is actually helpful in a lot of RF applications.
First let’s understand little about tools we are about to install today.
- UHD: The USRP hardware driver (UHD) is the device driver provided by Ettus Research for use with the USRP product family. It supports Linux, MacOS, and Windows platforms. Several frameworks including GNU Radio, LabVIEW, MATLAB and Simulink for UHD ….. from wikipedia
- LimeSuite and Lime tools: Basically lime tools are those which help us run our Lime SDR. Lime Suite enables the transceiver to be programmed and registers to be read back, provides support for calibrating the transceiver and, thanks to SoapySDR, support for applications which use either the SoapySDR or UHD APIs. The Lime Suite GUI can also be used to program the FX3.0 microcontroller, FPGA and configuration flash on the LimeSDR board. While Lime Suite is the official SDR driver for LMS7002M-based platforms and this is recommended for most applications, there are also alternatives for e.g. embedded use and in rapid prototyping. LMS7002M Driver contains a C driver for control of the LMS7002M transceiver. The driver provides user APIs for tuning frequencies, setting gains, setting filters, setting sample rates, setting stream modes, configuring switches, and calibration. Although this driver can select the streaming mode of the LMS7002M, it does not directly interact with receive or transmit baseband data. pyLMS7002M Python package is platform-independent, and is intended for fast prototyping and algorithm development. It provides low level register access and high level convenience functions for controlling the LMS7002M chip and evaluation boards. Example Python apps are provided for CW Tx and a Vector Network Analyser (VNA), amongst other uses.
- SoapySDR: SoapySDR is a software suite developed by Pothosware that provides uniform API to the host system. A fresh and clean vendor neutral and platform independent SDR support library. Basically, SoapySDR communicates with the SDR API, and packages it into a new API. As we known, there are so many SDR hardwares available on the market. Yet most of them implement their individual drivers, which is painful for the RF developers to migrate their projects to different hardwares. So SoapySDR builds a bridge to connect miscellaneous SDR drivers.
- GnuRadio: GNU Radio is a free software development toolkit that provides signal processing blocks to implement software-defined radios and signal-processing systems. It can be used with external RF hardware to create software-defined radios, or without hardware in a simulation-like environment.
- GQRX: Gqrx is an open source software defined radio receiver (SDR) powered by the GNU Radio and the Qt graphical toolkit. These are the actions that you can perform using gqrx. Process I/Q data from the supported devices. Change frequency, gain and apply various corrections (frequency, I/Q balance). AM, SSB, CW, FM-N and FM-W (mono and stereo) demodulators. Special FM mode for NOAA APT. Variable band pass filter. AGC, squelch and noise blankers. FFT plot and waterfall. Record and playback audio to / from WAV file. Record and playback raw baseband data. Spectrum analyzer mode where all signal processing is disabled. Basic remote control through TCP connection. Streaming audio output over UDP.
Let’s begin with initial setup on Ubuntu.
- STEP-1 : Install UHD
sudo apt update
sudo apt upgrade
sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins python3-zmq python3-scipy python3-gi python3-gi-cairo gobject-introspection gir1.2-gtk-3.0
sudo apt install uhd-host uhd-soapysdr
It is very important to first install uhd-host and then install Limesuite and lime drivers. I have done it the otherway round and faced alot of trouble because my uhd host did not detect lime even after several restarts.
- STEP-2 : Install LimeSuite
sudo apt install limesuite limesuite-udev
- STEP-3 : Installing SoapySDR
sudo apt install soapyosmo-common0.7 soapyremote-server soapysdr-module-airspy soapysdr0.7-module-airspy soapysdr-module-all soapysdr0.7-module-all soapysdr-module-audio soapysdr0.7-module-audio soapysdr-module-bladerf soapysdr0.7-module-bladerf soapysdr-module-hackrf soapysdr0.7-module-hackrf soapysdr-module-lms7 soapysdr0.7-module-lms7 soapysdr-module-mirisdr soapysdr0.7-module-mirisdr soapysdr-module-osmosdr soapysdr0.7-module-osmosdr soapysdr-module-redpitaya soapysdr0.7-module-redpitaya soapysdr-module-remote soapysdr0.7-module-remote soapysdr-module-rtlsdr soapysdr0.7-module-rtlsdr soapysdr-module-uhd soapysdr0.7-module-uhd soapysdr-tools
WARNING!!! There is some kind of error if you are installing soapy ‘rfspace’ modules. So please try not installing any rfspace modules.
After installing Soapy, Let’s check how it works.
You can check that LimeSDR has ported with Soapy using LMS7 drivers. Now, most of the applications use SoapySDR API to make SDR work. We will see an example in the next part.
See the Soapy’s magic. Now it has ported the LimeSDR to UHD source. That is the reason why you are able to see lime in uhd device command.
To demonstrate this, I ran the same command from another Ubuntu-20.04 machine. You can see the result as UHD not found. This is because there are no Soapy drivers installed. But you can see LimeSDR is connected($ dmesg).
We have successfully installed the basic setup that is required for LimeSDR to work.
We will see how to setup gnuradio, gr-limesdr and gqrx in PART-2.
Am writing this blog after wasting a lot of hours on how to setup proper SDR lab and to help a lot of beginners who are looking for solutions in RF | SDR setup. Who face alot of trouble installing the software stacks and wasting time. This might save a lot of time for few. Yes, I had many thoughts about Ubuntu-20.04 like how will it support many of the dependencies for SDR software. TBH, it made very easy for most of the setups.
LimeSDR setup with GNURadio, gr-limesdr and GQRX on Ubuntu-20.04 was originally published in InfoSec Write-ups on Medium, where people are continuing the conversation by highlighting and responding to this story.