Control both Airspy HF+ and ICOM IC-7410

When you use both HF+ and IC-7410, it would be convenient if the two frequencies are in sync across the equipment.

There could be various ways to realize that, and here is one:

# filename = airspy_ic7410_telnet.py
# % rigctld -m 367 -r /dev/ttyUSB0 &
# % python3 airspy_ic7410_telnet.py
#
import time
import telnetlib
HOST  = "127.0.0.1"
PORT1 = 7356 # GQRX    default port
PORT2 = 4532 # rigctld default port
EXPECTED =b"dummy"
TOUT = 0.5

f1b4 = 0
f2b4 = 0

tn1 = telnetlib.Telnet(HOST, PORT1)
tn2 = telnetlib.Telnet(HOST, PORT2)

tn1.read_until(EXPECTED, timeout=1); # to discard everythng
tn2.read_until(EXPECTED, timeout=1);

while (True):
    time.sleep(1.0)
    
    tn1.write(b"f\n")
    f1 = int(tn1.read_until(EXPECTED, timeout=TOUT).decode('ascii'))
    if (f1 != f1b4):
        f1b4 = f1
        new_f2=b"F "+str(f1).encode('ascii')+b"\n"
        tn2.write(new_f2)
        tn2.read_until(EXPECTED, timeout=TOUT)

    tn2.write(b"f\n")
    f2 = int(tn2.read_until(EXPECTED, timeout=TOUT).decode('ascii'))
    if (f2 != f2b4):
        f2b4 = f2
        new_f1=b"F "+str(f2).encode('ascii')+b"\n"
        tn1.write(new_f1)
        tn1.read_until(EXPECTED, timeout=TOUT)

This small program uses telnet to talk to HF+ (via Gqrx) and to IC-7410 (via rigctld).

Airspy HF+ and FT8

Let’s see if my new SDR works fine with FT8.

The operating system is macOS High Sierra (10.13.4).

I use Soundflower to send the audio stream from Gqrx to WSJT-X.


Now the settings for Gqrx. Remember that the Mode must be USB.

The Audio output should be either “Multi-Output Device” or “Soundflower (2ch)”.

Do not forget to enable Remote control (Tools -> Remote control).



Finally, the settings for WSJT-X.

“Hamlib NET rigctl” is selected as rig control.

Select “Soundflower (2ch)” for Soundcard Input.

Airspy HF+ and telnet

You can control Gqrx using telnet.

import numpy as numpy
import matplotlib.pyplot as plt
import telnetlib
HOST = "127.0.0.1"
EXPECTED =b"dummy"
TOUT = 0.1

tn = telnetlib.Telnet(HOST, 7356)
xvalue = []
yvalue = []

tn.write(b"M CW 1000\n")
print(tn.read_until(EXPECTED, timeout=TOUT).decode('ascii'), end="")

for freq_hz in range(79000000, 81000000, 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()

The program scan the FM band, and plot the signal strength.

Airspy HF+ (2)

Obviously, you wish to use your SDRs on more reasonable Operating Systems.

This is Gqrx on Ubuntu 18.04.

And Gqrx also runs on macOS.

Airspy HF+ is natively supported by Gqrx under both operating systems.

Gqrx can be controlled remotely via telnet.

% telnet localhost 7356
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
f
7027000
F 7031000
RPRT 0
f
7031000
M ?
OFF RAW AM FM WFM WFM_ST WFM_ST_OIRT LSB USB CW CWU CWR CWL
M CW
RPRT 0
m
CW
500
M CW 300
RPRT 0
m
CW
300
q
Connection closed by foreign host.

The list of available commands is here: remote-control.txt.