KB9IQX RTL-SDR Setup

Basic setup of RTL-SDR shenanigans on Linux. The following instructions will set up the most basic and requisite drivers to let you do some cool SDR stuff on your Linux box. The instructions start for local command line operations directly on the machine and also for setting up rtl_tcp or SoapySDR remote receiver units.

CAVEAT #1: Go Wired for remote receiver units

If you are building a remote receiver -- say, something to put outside or up in your attic -- and thinking about using either rtl_tcp or SoapySDR to control them, then your experience will be immeasurably better with wired connections... in my experience. Maybe you have a super high speed greased angry pixie network operating over a perfect vacuum in your home and wifi will be fine. But probably not.



TL;DR:

Script that does all of the following is OVER HERE, now with prompts! This allows you to run the script to re/install components without overwriting things you want to keep untouched.

CAVEAT: Two SDR drivers enter...

So, the OsmoCom RTL-SDR drivers are great and work for most things SDR. Indeed, most users seem to prefer you install these. HOWEVER, if you're on a Debian system, you can also install pre-compiled drivers with sudo apt-get install librtlsdr0 librtlsdr-dev. And the Soapy install script seem to do this anyway. So this may render your OsmoCom drivers broken and you'll get some crashes/errors complaining about undefined symbol or some nonsense.

Editorial opinion: I wish the world would just settle one method and stick to it. But I get why it doesn't. So this is something to watch out for.



Installation:

Explanations of those prompts as well as detailed steps and instructions follow.

  1. Required Maybe: Install Osmocom rtl-sdr
  2. I say maybe because if you are only interested in Soapy, you might be able to skip this. Oddly enough, several pages I found with instructions for installing SoapySDR seemed to want you to install these first... for Reasons?? In any case, installing these first, and letting the script install the udev rules, only to be overwritten by SoapySDR will not hurt.

    Excellent instructions at satsignal.eu. Distilled down here:

                sudo apt-get update
                sudo apt-get upgrade
                sudo printf 'blacklist dvb_usb_rtl28xxu\nblacklist rtl2832\nblacklist rtl2830' > /etc/modprobe.d/nortl.conf
                sudo apt-get install git-core
                sudo apt-get install git
                sudo apt-get install cmake
                sudo apt-get install libusb-1.0-0-dev  
                sudo apt-get install build-essential 
                git clone git://git.osmocom.org/rtl-sdr.git
                cd rtl-sdr
                mkdir build
                cd build
                cmake ../ -DINSTALL_UDEV_RULES=ON
                make
                sudo make install
                sudo ldconfig
                cd ~
                sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
                git clone git://github.com/MalcolmRobb/dump1090.git
                cd dump1090
                make
                sudo reboot
            
  3. Optional Why not: Install pyrtlsdr

    This is a python library to allegedly do some interesting things with python scripts for your SDR. I have not yet played with this but it seems to hold some promise, I guess, as python is a linuga franca these days, I guess.

                pip install pysrtlsdr
            
  4. Optional But Neat Install FreqShow

    This is a visual Python scanner for SDR. It's from AdaFruit and came with their really cool intro RTL-SDR tutorial. It shows a peak view as well as a requisite waterfall. It has no sound, if I remember correctly but it is neat on a Pi 3.5 TFT touch display, which is what for it is built. You can safely skip this one unless you have a touchscreen Pi that you want to display stuff on.

                git clone https://github.com/adafruit/FreqShow.git
    
                See installation and usage instructions in the guide at: https://learn.adafruit.com/freq-show-raspberry-pi-rtl-sdr-scanner/overview
            
  5. Optional Soapy Remote Receiver Operation Install SoapySDR

    This Soapy abstraction layer or some business like that. If you want Soapy, install all 3 of these Soapy things.

    
                git clone https://github.com/pothosware/SoapySDR.git
                cd SoapySDR/
                mkdir build
                cd build
                cmake ..
                make 
                sudo make install
                sudo ldconfig 
    
            
  6. Install SoapyRTLSDR

                git clone https://github.com/pothosware/SoapyRTLSDR.git
                cd SoapyRTLSDR/
                mkdir build
                cd build/
                cmake ..
                make 
                sudo make install
    
            
  7. Test SoapySDR with the following command. You'll get some informative output.
                SoapySDRUtil --probe="driver=rtlsdr"
             
  8. Install SoapyRemote

    This is the business that allows your local terminal/computer to talk to and control the remote SDR unit.

                git clone http://github.com/pothosware/SoapyRemote.git
                cd SoapyRemote/
                mkdir build
                cd build/
                cmake ..
                make
                sudo make install
       
            
  9. Optional P25 Install OP25

    This is for decoding Police, Fire, and Public Safety P25 (including Phase 2) unencrypted communications for municipal systems using APCO25 trunked blah blah blah..

                git clone https://git.osmocom.org/op25
    
                cd op25
                ./install.sh
            


Operation: Basic

The OsmoCom drivers come with some really cool utilities for listening to various modes. Check out more info right over here. Included is the rtl_tcp remote receiver utility, which I have used with GQRX on Mac. The OsmoCom drivers are usually sufficient, and necessary, for running other SDR utilities. There is a set of Debian drivers that you can fetch using apt-get that seem to work just as well. These seem to be the two competing drivers. Sometimes if an app is expecting one and you have the other installed, it might fail with an error message, so be careful of that.



Operation: SoapySDR remote

To run the Soapy business, just type:

SoapySDRServer --bind

You'll get some output like the following. The SDR remote will be ready to shoot data into your local machine. I use a Mac and CubicSDR, though I suggest probably running a fast Linux machine or, I guess, a Windows machine, if you must, as those platforms have more apps than the Mac. And as you operate things on your actual machine, the open terminal on the SDR will spit out some status messages.

pi@walkman:~ $ SoapySDRServer --bind
######################################################
## Soapy Server -- Use any Soapy SDR remotely
######################################################

Server version: 0.5.2-g5475c9de
Server UUID: af42aa7f-4db6-1618-8567-233b00000000
Launching the server... tcp://[::]:55132
Server bound to [::]:55132
Launching discovery server... 
Connecting to DNS-SD daemon... 
[WARNING] SoapyRemote compiled without DNS-SD support!
Press Ctrl+C to stop the server

Once you are satisfied that it all works, you should probably set up the remote receiver machine to do this automatically on boot up. Then you can put this up in an attic or your yard or sneak it onto a rooftop somewhere.



Operation: P25 shenanigans

I have just recently started messing with P25, primarily because I wanted to follow police traffic in the aftermath of protests supporting Black Lives Matter in May/June 2020, when I noticed traffic switched from regular trunked traffic to P25 encoded channels. Also, I do not have the monies to shell out for commercially available P25 Phase 2 scanner.

It seems that the first trick is to find the Control Channel. The second trick is to futz with some command line switches to receive meaningful signals. I have not yet gotten it to work, tho progress is occuring. So here are some resources:



General Observations and Operating Notes

  1. Having tried both a Raspberry Pi Zero and a Raspberry Pi 3B, I definitely recommend a wired network connection. Over wifi, the data/sound can be really jerky depending on your network load and may not be fun to listen to. Even when one machine of the pair (the Soapy SDR remote receiver) was wired, there was still some latency issue. On the other hand, when both the SoapySDR remote and my Mac were wired, the sound was pretty smooth and nice.
  2. I have a small suspicion that a machine with more processing power and/or RAM might work better. However, I still believe it is mostly a network issue since the SDR is shooting a lot of data.
  3. For sensitive signal scanning and geekery, skip the remote receiver and plug the SDR directly into your machine. Find a nice spot outside or on your porch for your spy shed or spy station. Run some high quality antenna cable and have a decent antenna.