Hamlib provides a linux command-line API for amateur radios.
Installation
On Mac OS you can install using Mac Ports:
sudo port install hamlib
Usage
Get a list of “rig numbers” for supported radios:
rigctl -l
Find available serial ports:
ls /dev/tty.*
Set the frequency to 7.2 MHz and mode to LSB on a Tentec Eagle transceiver:
rigctl -m 1608 -r /dev/tty.usbmodem14531 -s 57600 F 7200000 M LSB 0
Use a rigctl command with no commands at the end to start an interactive command shell.
Network control with TCP/IP
First start the daemon. It uses port 4532 by default, but here we are setting it explicitly:
rigctld -m 1608 -r /dev/tty.usbmodem14531 -s 57600 -t 4532 &
Then in another window, send commands to the daemon using netcat. For set example, to set the frequency to 14.247:
echo ‘F 14247000’ | nc -w 1 localhost 4532
Max/MSP
Note: [mxj tcpClient] no longer functions in Max8 (1/25/2021)
This patch uses the mxj tcpClient object from https://cycling74.com/toolbox/tcpclient/#.Vnj_fpMrKuU by Arvid Tomayko to communicate with rigctld over TCP/IP. The patch below is a modified help file that connected to the radio using rigctld as configured above.
Notes on grig and rpc.rigd
grig is a graphical rig front end for hamlib by Alex Csete. rpc.rigd is a daemon that allows multiple clients. I was able to get both of them sort of working together (use -m 1901 from grig) but the daemon starts streaming error messages “read_string timeout without reading a character”. Also the latency with grig over the LAN is high. Its possible that there are problems with the rig CAT file. I am using the file for the Tentec Orion – as I haven’t figured out how to add new devices. At any rate, the above methods (UDP or TCP command line) are way more responsive.
References:
- manpage: http://manpages.ubuntu.com/manpages/precise/man1/rigctl.1.html
- general information about using Mac for amateur radio: http://www.aerodynes.fr/2013/12/27/ham-operation-on-a-mac/
- daemon: http://www.makelinux.net/man/8/R/rigctld
- rpc.rigd notes: http://sourceforge.net/p/groundstation/mailman/groundstation-user/thread/CAFkZyWTk-uFyDCV4anVmHhAaO5dcE-ECt9rNrQYMYC3b1UQFBg@mail.gmail.com/
- rpc.rigd man page: http://www.manualpages.de/FreeBSD/FreeBSD-ports-9.0-RELEASE/man8/rpc.rigd.8.html