Gqrx can be controlled using a TCP connection.
http://gqrx.dk/doc/remote-control
This is from a local host.
And this is from a remote host.
In both cases, you must give an IPv4-mapped IPv6 address to the remote control settings.
user1@Asrock ~/Downloads/gqrx-sdr-2.11.5
% grep -r "ffff:127" .
./src/applications/gqrx/remote_control.cpp:#define DEFAULT_RC_ALLOWED_HOSTS "::ffff:127.0.0.1"
user1@Asrock ~/Downloads/gqrx-sdr-2.11.5
% grep -r "AF_INET" .
user1@Asrock ~/Downloads/gqrx-sdr-2.11.5
%
Here is an example Python program to control Airspy HF+ via Gqrx.
import numpy as numpy
import matplotlib.pyplot as plt
import telnetlib
HOST = "192.168.0.90"
EXPECTED =b"dummy"
TOUT = 0.5
tn = telnetlib.Telnet(HOST, 7356)
xvalue = []
yvalue = []
tn.read_until(EXPECTED, timeout=TOUT*5)
tn.write(b"M CW 1000\n")
print(tn.read_until(EXPECTED, timeout=TOUT).decode('ascii'), end="")
for freq_hz in range(500000, 1700000, 1000):
freq=b"F "+str(freq_hz).encode('ascii')+b"\n"
tn.write(freq)
tn.read_until(EXPECTED, timeout=TOUT)
tn.write(b"f\n")
f = int(tn.read_until(EXPECTED, timeout=TOUT).decode('ascii'))
xvalue.append(f)
print(f)
tn.write(b"l\n")
l = float(tn.read_until(EXPECTED, timeout=TOUT).decode('ascii'))
yvalue.append(l)
print(l)
plt.figure(1, figsize=(8,8))
plt.subplot(111)
plt.title('Airspy HF+')
plt.xlabel('Freq [Hz]')
plt.ylabel('Signal Strength [dBm]')
plt.grid(True)
plt.plot(xvalue, yvalue, color='blue', linewidth=1)
plt.show()