Gqrx SDR Scanner for Linux (Maybe Mac Too)

Status
Not open for further replies.

BTJustice

Member
Joined
Feb 27, 2012
Messages
77
Gqrx is a wonderful program for SDRs on Linux. If you have it installed already and have bookmarks of frequencies you have tagged as something like Aircraft, EMS, Marine, etc., you can turn Gqrx into a scanner with gqrx-scan (Khaytsus / gqrx-scan · GitLab).

BUT... how do you set it up to where all you have to do is double-click on a file saved on your Desktop, have Gqrx open and start running automatically, and then start scanning automatically? With a bash script! The following is one I use for Aircraft saved on my Desktop as Aircraft.sh:

Code:
#!/bin/bash
# Open Gqrx.
gqrx &
sleep 5
# Start SDR.
echo "U DSP 1" | nc localhost 7356
sleep 5
# Start scanning frequencies with gqrx-scan (https://gitlab.com/khaytsus/gqrx-scan).
cd /home/$USER/gqrx-scan-master/
./gqrx-scan --delaylevel=-50 --delaytime 10 --pause 0.25 --tags "Aircraft" --type gqrxfile --wait

You can modify the last line where it says "Aircraft" for other tagged frequencies and save a new copy on your Desktop to have multiple scanning options such as EMS.sh and Marine.sh and Police.sh and so on.

You need to make sure each .sh bash script file you save to your Desktop is executable (I use Step 2 linked here).

You need to do a few things in Gqrx before you can use .sh bash scripts to scan frequencies with:
  1. Open Gqrx as you normally would to use it. Go ahead and start it.
  2. Be sure to enable "Remote control via TCP" by clicking the icon on the toolbar with the two computers on it.
  3. If everything looks good, save your configuration.
  4. Close the Gqrx window.
So assuming you have Gqrx installed and it works fine with your SDR, you will need to extract the gqrx-scan utility to your /home/$USER folder. It will go to /home/$USER/gqrx-scan-master after you either do git or download and extract the zip at Khaytsus / gqrx-scan · GitLab.

You will need to make sure netcat is installed, and gqrx-scan requires some Perl add-ons to work. I use Fedora KDE 36 so I had to do this in Terminal (Konsole):

Code:
sudo dnf update
sudo dnf install netcat perl-Getopt-Long perl-Net-Telnet perl-sigtrap perl-Term-ANSIColor perl-Time-HiRes

You will have to modify the above for your Linux distro if you are not using Fedora.

Lastly, let me explain what the last line of code does in the .sh bash script:

./gqrx-scan
Starts gqrx-scan.

--delaylevel=-50
This is the squelch level. You may need to lower it to -60, -70, or even lower to hear really weak signals.

--delaytime 10
How many seconds to stay on an active frequency after the transmission ends in case there is more traffic. This is used in conjunction with --wait.

--pause 0.25
Scan speed in seconds.

--tags "Aircraft"
Tags in your Gqrx Bookmarks file to scan for. You can even do multiple tags such as "Aircraft|Marine".

--type gqrxfile
Use the frequencies saved in your Gqrx Bookmarks file to scan with.

--wait
Wait on an active frequency until there is no more activity after --delaytime runs out of time to continue scanning.

That is all! Now all you have to do is double-click on any of your .sh bash script files you created on your Desktop to scan with. You do not have to open Gqrx first and then run a .sh bash script to scan. If Gqrx opens and starts scanning without starting the SDR due to an error message, close Gqrx and run the .sh bash script you want to use again.

Enjoy!
 

BTJustice

Member
Joined
Feb 27, 2012
Messages
77
If you want to see what is happening in Terminal using Aircraft.sh as an example, open your Terminal program and:

Code:
cd Desktop
./Aircraft.sh

Close the Gqrx window first before closing Terminal to avoid errors in Gqrx.
 

BTJustice

Member
Joined
Feb 27, 2012
Messages
77
While doing Steps 1-4 above for getting Gqrx ready to scan, click on VIEW and make sure BOOKMARKS is checked. This will make it much easier to see what is being scanned later. Be sure to save your configuration again before exiting Gqrx.
 

BTJustice

Member
Joined
Feb 27, 2012
Messages
77
I decided to give Ubuntu a spin--specifically Kubuntu since I like KDE. Here is how to make Ubuntu work, but there is a problem. Once Gqrx opens and starts, it will not scan. You have to click the "Remote control via TCP" button (the one with 2 computers on it), and then click it again within a couple of seconds to turn it back on. Scanning will start within a few seconds.

For Ubuntu:
Code:
sudo apt update
sudo apt upgrade
sudo apt install netcat perl
sudo cpan

On CPAN (most of the following may already be installed):
Code:
install Getopt::Long
install Net::Telnet
install sigtrap
install Term::ANSIColor
install Time::HiRes
exit

I began to miss Fedora KDE after a few days. I like KDE and dnf (instead of apt or pacman or pamac or zypper). There is a disro called OpenMandriva which uses dnf like Fedora does. It can be converted into a rolling release easily. The directions in the initial post of this thread work for OpenMandriva. After a few days of OpenMandriva, I am back on Fedora KDE.
 

lobstar

Newbie
Premium Subscriber
Joined
Jul 11, 2022
Messages
1
Thanks for this! I'm hoping to use my Steam Deck as a mobile rig so when I start trying to get this setup I'll be looking back here.
 
Status
Not open for further replies.
Top