GQRX with auto start

990 views
Skip to first unread message

Bruce Quinton

unread,
May 7, 2014, 10:47:27 PM5/7/14
to gq...@googlegroups.com
I have several distributed FITPC's installed and collecting AM radio signals in my area, but when any of my devices get rebooted I have to first of all "notice" and then restart the recording (I pipe the output to sox, cut the file based on silence and then store the audio, wav files, locally) 

Is there a way/plan to enable gqrx to start collecting data on start up? (if so I could write a service to start the application in the case of a reboot/crash)

Also plan for idea to make gqrx headless? it would be fantastic to be able to build a more complex configuration file (eg takes all possible settings) and then start the application with a simple command line call without the over head of having to install a GUI.

I was looking at doing the "new" front end myself, eg replace the main.cpp, to call a configuration parser and tie into your receiever.cpp ect. but if you are already looking at it?

Regards

Alexandru Csete

unread,
May 8, 2014, 4:52:33 AM5/8/14
to gq...@googlegroups.com
Hi Bruce,

I'm not working on it myself, so just go ahead and do it. It sounds
like you are on the right track. Indeed, the interface between the GUI
and the DSP goes through a single object in receiver.cpp. I hope you
will share your result. We can even include it in the gqrx package as
a separate application if you are interested.

Alex

Bruce Quinton

unread,
May 9, 2014, 6:59:09 PM5/9/14
to gq...@googlegroups.com
Ok, well I have started. I have written a gqrxcmd app that reads the existing configuration files (using your "list" if the user wants see which configs are available etc) loads the settings and starts playing. Its very basic at the moment.
The app just runs an internal loop waiting for the user to type "exit" to quit but I want to extent the commands to allow the user to adjust the settings eg move the frequency or set the demodulation type)

Anyway, I have no idea how to tie the compilation in with your Makefile; So I have written the gcc commands into a bash script, of course that restricts the compilation to my processor type (Sorry I'm a windows security application developer so I havent done a lot of development for Linux, I'm sure there is an easy fix for my problem) 

I have compiled the same app on a ATOM (FITPC2 PC) to use on my remote sites. Again I cheated, I compiled your gqrx and piped the "gcc" called to a script file and modified them to include my 4 files.. ;-)

I have noticed that you don't store all the settings in the application, the filter type and a few others. Also I notice a few things in the GUI app like the Filter defaults back to "Normal" if you change the Mode, the FFT changes with it but the filter drop down stays on the existing selection.

You also don't load the settings in the same peace of code, so the "main windows" load config doesn't actually load ALL of the conf items some items are loaded at a later stage for example the IQ_Blalance is loade by the receiver.cpp,

I wish to change the "Audio" play back to allow the user to stop the audio pushing to the sound card. (I know, I know what the point of a radio if you cannot hear it) but I only want to record it remotely so I need to add a GNU Radio "block" I have written that allows GNU to stream to a file. The "block" records for x amount of seconds and starts a new file, it also detects silences and if n number of seconds of silence is detected the file is closed, and once noise is detected again a new file (time stamped) is started. Guidance on how I can achieve this so that it will not be lost during upgrades of your software would be great.

Anyway, that's the update. so far.

Alexandru Csete

unread,
May 10, 2014, 9:03:47 AM5/10/14
to gq...@googlegroups.com
On Sat, May 10, 2014 at 12:59 AM, Bruce Quinton <zan...@gmail.com> wrote:
>
> You also don't load the settings in the same peace of code, so the "main
> windows" load config doesn't actually load ALL of the conf items some items
> are loaded at a later stage for example the IQ_Blalance is loade by the
> receiver.cpp,

The configuration file is loaded into memory in mainwindow.cpp /
loadConfig. This function itself reads some settings, then calls the
relevant subsystems to read their own data from the config. But
nothing is read in receiver.cpp. The only interaction with
receiver.cpp is through the set/get functions.

There is one exception, namely when we check the audio subsystem, but
that's really just a debug output and not a a setting used by gqrx.
It's a gnuradio thing, which is why it is not checked in
mainwindow.cpp.


> I wish to change the "Audio" play back to allow the user to stop the audio
> pushing to the sound card. (I know, I know what the point of a radio if you
> cannot hear it) but I only want to record it remotely so I need to add a GNU
> Radio "block" I have written that allows GNU to stream to a file. The
> "block" records for x amount of seconds and starts a new file, it also
> detects silences and if n number of seconds of silence is detected the file
> is closed, and once noise is detected again a new file (time stamped) is
> started. Guidance on how I can achieve this so that it will not be lost
> during upgrades of your software would be great.

You could use the existing network streaming interface to send audio
to your own code:
http://gqrx.dk/doc/streaming-audio-over-udp

That way your code will not be vulnerable to internal changes in gqrx.

Alex

Bruce Quinton

unread,
May 10, 2014, 5:22:44 PM5/10/14
to gq...@googlegroups.com
Morning Alex,
Thank you for your response, I realise my previous message read like criticism, I apologise, it was written quickly and it was meant to be questions and asking for confirmation of my observation.


Your response points me in the right direction, I will also need to look back at the settings loading.

Thank you again.

Bruce Quinton

unread,
May 12, 2014, 6:13:12 PM5/12/14
to gq...@googlegroups.com

Alex, this is the basic working gqrxcmd command line version.

It does what I need but I needto add somethings to your recevier.cpp, but I wanted to give you a clean version first.

Sorry I cannot finish this off a bit more, but at the moment my day job is taking most of my night too so I'm running low on spare time.

The work you have done on this application is fantastic and I'd like to thank you for what you have achieved and shared.

Regards Bruce Quinton
gqrxcmd.zip

Alexandru Csete

unread,
May 13, 2014, 6:22:08 AM5/13/14
to gq...@googlegroups.com
Hi Bruce,

Thanks for the update. I will take a look at your application later as
I am also very busy at the moment.

Alex
> --
> You received this message because you are subscribed to the Google Groups
> "Gqrx SDR" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gqrx+uns...@googlegroups.com.
> To post to this group, send email to gq...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gqrx/62e31cd2-e9a5-4a7e-9b88-e59bb1bfd440%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Timo Goetze

unread,
Feb 19, 2018, 3:54:14 AM2/19/18
to Gqrx SDR
Hi at all,

for the AUTOSTART option, i use the ctrl+d shortcut.

in my bash script

gqrxWindow=$(xdotool search --name "Gqrx( )")

xdotool windowactivate  --sync $gqrxWindow key ctrl+d


This programatically presses ctrl+d - the "start dsp" shortcut. xdotool is part of most linux distributions.


cheers,

Timo

+++ weather reception with ubuntu 16.4+gqrx+fldigi @ Museum Sailing Vessel http://www.hf329.de +++

Alexandru Csete

unread,
Feb 22, 2018, 9:02:29 AM2/22/18
to gq...@googlegroups.com
On Mon, Feb 19, 2018 at 9:54 AM, Timo Goetze <timo...@gmail.com> wrote:
> Hi at all,
>
> for the AUTOSTART option, i use the ctrl+d shortcut.
>
> in my bash script
>
> gqrxWindow=$(xdotool search --name "Gqrx( )")
>
> xdotool windowactivate --sync $gqrxWindow key ctrl+d
>
> This programatically presses ctrl+d - the "start dsp" shortcut. xdotool is
> part of most linux distributions.

Very nice tip Timo, thanks!

Alex
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

btjust...@gmail.com

unread,
Jun 18, 2022, 10:30:01 PM6/18/22
to Gqrx SDR
I know.  How dare I post to a 4+ year old thread, but it is a top search result for "Auto Start Gqrx".

Wayland apparently doesn't support xdotools so Wayland users need to use netcat instead.

With gqrx-scan extracted to the /home/$USER folder and working along with Gqrx bookmarks tagged, the bash script code at the bottom will:
  1. Open Gqrx.
  2. Start the SDR.
  3. Scan frequencies with gqrx-scan.
I have multiple versions of this bash script saved as Aircraft.sh, EMS.sh, Marine.sh, and so on.  Change "Aircraft" in Line 10 with the tag of the frequencies you want to scan.  Make sure to make each .sh bash script file you create executable (I use Step 2 here).  The following is "Aircraft.sh":

#!/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
Reply all
Reply to author
Forward
0 new messages