Controlling gqrx via Mac Terminal window

151 views
Skip to first unread message

KTH21

unread,
Apr 18, 2022, 11:35:04 AM4/18/22
to Gqrx SDR

I am encountering a problem accessing gqrx via a remote host.  The article at https://gqrx.dk/doc/remote-control suggests that gqrx was designed for use with a remote host and suggests the commands can be sent via the MacOS Terminal window.  That is helpful because C++ can send commands to the Terminal window using the "system(command_string);" statement, and therefore, seemingly could be used to send commands to gqrx.

According to the example at the link referenced above, the first command to send is a Bash "telnet"  statement.

Unfortunately, MacOS Terminal scripts have changed. In about 2018 Apple removed telnet from the Bash commands.  Then in 2019 the default scripting language was changed from Bash to zsh.  One can still reach the Bash commands by temporarily changing the default scripting language but telnet is no longer available. 

I wonder if anyone has figured out a work-around. 

 

righthal...@gmail.com

unread,
Apr 19, 2022, 12:11:21 AM4/19/22
to Gqrx SDR

KTH21

unread,
May 9, 2022, 5:28:20 PM5/9/22
to Gqrx SDR

My previous post was looking for an alternative to telnet to communicate with the Gqrx server.  

The post referenced https://gqrx.dk/doc/remote-control and pointed out that telnet is no longer available in Terminal.

Some responses suggested downloading telnet and that remains an option. Apparently the telnet command was removed because it lacked security. The existence of other ways to accomplish the same connection suggests those options have sufficient security.  

In my search for alternatives, I found that the Mac system includes two alternatives.  

They are: 

  Netcat using the short version, “nc”, and 

  ssh 

While both are supposed to provide the solution, I have not been able to get them to work.

The responses I am getting from these two commands may be similar to what I would get from telnet. I say this because the telnet example, at the link shown above, shows how to establish a connection, but does not show how to enter the “f” parameter and get a response.

Below are my tests of those two Terminal functions.

 

USING THE NETCAT FUNCTION

The first use of the nc function tests for a connection and finds one. 

The Terminal text is … 

     nc –vz 127.0.0.1 7356

and the final returned value is “succeeded!”

 

=== Begin Text from Terminal Screen  

 

Last login: Mon May  9 15:16:34 on ttys000

[Computer ID goes here]$ nc -vz 127.0.0.1 7356

found 0 associations

found 1 connections:

     1:         flags=82<CONNECTED,PREFERRED>

                  outif lo0

                  src 127.0.0.1 port 49229

                  dst 127.0.0.1 port 7356

                  rank info not available

                  TCP aux info available

Connection to 127.0.0.1 port 7356 [tcp/*] succeeded!

=== End of Text from Terminal Screen

 

Using the Netcat Small “L” Flag

Next is the nc command with a flag that tells it to listen to the port, followed by my entry of the small “f” to ask Gqrx for the frequency. The “-l” flag is a small “L”


=== Begin Text from Terminal Screen   

[Computer ID goes here]$ nc -l 127.0.0.1 7356

f

=== End of Text from Terminal Screen

After the “f” was entered, there was no response from Gqrx.

 

USING THE SSH FUNCTION

 

The ssh function appears to be much simpler.  It is entered as

ssh –p 7358 127.0.0.1 

The –p specifies that the port number follows, and that is followed by the IP address.

Again, there is a pause while Terminal appears to be listening. 

When I enter “f”, there is no response.

 

So the question now is, how do I get the Gqrx server commands from Terminal to Gqrx, and how do I return the values that are supposed to be provided as shown in the Gqrx documentation at:

Vladislav P

unread,
May 9, 2022, 5:40:39 PM5/9/22
to Gqrx SDR
Hello.
nc works well at least on linux.
You should not try to make nc to listen for a connection as gqrx acts as a server. Try connecting to gqrx with nc instead of listening:
user@hostname:~$ nc 127.0.0.17356

вторник, 10 мая 2022 г. в 00:28:20 UTC+3, KTH21:

Paul Wolfson

unread,
May 9, 2022, 8:45:00 PM5/9/22
to Gqrx SDR
nc is a useful tool for troubleshooting protocols.  So is nmap,  https://nmap.org/book/inst-macosx.html.  However, you should be using the terminal emulator, ssh  secure telnet which is part of OpenSSL.  Also, there is something called X-forwarding invoked with ssh -X user...@domain.ext or ssh -X user...@192.168.1.xxx or as appropriate for your network.   Similarly, there is a visual tool VNC which can be used securely though on Linux it can be a little dicey.  TightVNC has no licensing limitation.    Any basic text or Google-Fu on Unix style networking will help you out.

Vladislav P

unread,
May 9, 2022, 9:01:47 PM5/9/22
to Gqrx SDR
Ssh X frowarding and VNC are godd for GUI remote access, but, I think, the question is about accessing gqrx using it's builtin remote protocol over tcp socket.

I've missed a space. The nc command should look like
user@hostname:~$ nc 127.0.0.1 7356
вторник, 10 мая 2022 г. в 03:45:00 UTC+3, pwol...@dlglt.com:

Paul Wolfson

unread,
May 9, 2022, 9:05:49 PM5/9/22
to gq...@googlegroups.com
Ah, thanks Vladislav - I didn't read far enough.

Paul Wolfson  KC3SHI
Washington, DC

--
You received this message because you are subscribed to a topic in the Google Groups "Gqrx SDR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gqrx/hJprzkOkM4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gqrx+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gqrx/8538be2a-7749-41b1-8b48-d3d2c0a23100n%40googlegroups.com.

KTH21

unread,
May 9, 2022, 10:58:15 PM5/9/22
to Gqrx SDR
That worked!!   

by entering...

nc 127.0.0.1 7356

and then entering an "f"
returned the number 10000000 which was the 10 Mhz setting on the Gqrx. including the setting for the up converter that makes 135 Mhz show as 10 Mhz.
and then entering "F 9000000" changed the frequency to 9 Mhz, and 
then entering "F 10000000" changed the frequency back to 10 Mhz..  

I am now having a dialog with the Gqrx server and running commands.  

It is now a simple process.

Thank you

Reply all
Reply to author
Forward
0 new messages