Skip to content

Instantly share code, notes, and snippets.

@relistan
Last active January 7, 2025 03:26
Show Gist options
  • Save relistan/bd9c4b8bab55b81c0374f30bf565bbe0 to your computer and use it in GitHub Desktop.
Save relistan/bd9c4b8bab55b81c0374f30bf565bbe0 to your computer and use it in GitHub Desktop.
Enable CAT control for WSJT-X on the (tr)uSDX on macOS

CAT Control on the (tr)uSDX for WSJT-X on macOS

This will enable CAT control on your Mac running WSJT-X with the (tr)uSDX and possibly other USDX rigs as well. WSJT-X uses Hamlib to connecto to and manage CAT on different radios. The problem (thanks to Guido PE1NNZ for identifying), is that Hamlib resets the port when it connects. This causes the radio to reset and then it's not yet available when Hamlib tries to connect. We can work around that by blocking the ability for Hamlib to reset the port. The simplest way to do that is to have the port already in use when Hamlib starts up.

I was not able to achieve that using the Hamlib built into WSJT-X. However, by installing Hamlib separately, and running it in TCP server mode (acts like a network server), I was able to get this all to work.

You need to install hamlib with brew install hamlib. If you don't have brew already, then you will need to either install it, or use a different method for installing hamlib. Once that is installed, you should be able to run rigtctld on its own.

Running It

  1. Connect the (tr)USDX to external power first
  2. Connect the USB cable to the rig
  3. Copy the shell script above into your path (e.g. /usr/local/bin)
  4. Run chmod 755 <where you put it> to make it executable
  5. Run the script with urig if it's in your path or ./urig if it's in the current directory

Once that says 'rigctld' running, you can start WSJT-X. Configure WSJT-X like the screenshot included in this gist.

#!/bin/sh
PORT=`ls -tr "/dev/tty.usbserial-[0-9]*" | tail -1`
if [ -z $PORT ]; then
echo "No suitable USB serial port found"
exit 1
else
echo "Found USB serial port named ${PORT}"
fi
cat $PORT &
CAT_PID=$!
echo "Starting 'rigctld'"
## NOTE! Some versions of the (tr)uSDX use 115200 and you may
## need to change this setting from 38400 -> 115200
rigctld --model=2028 --listen-addr=127.0.0.1 --port=7006 -s 38400 -r $PORT &
RIG_PID=$!
echo "Waiting for radio initialization to complete"
sleep 3
echo "Stopping 'cat' command"
kill $CAT_PID
echo "'rigctld' running"
wait $RIG_PID
@cnorrick
Copy link

cnorrick commented Jan 7, 2025

A slight bug with the script, which also explains why so many people are needing to manually set the port to use, the quotation marks are preventing the pattern match from working. Adjusting that line to PORT=`ls -tr /dev/tty.usbserial-[0-9]* | tail -1` leads to a successful connection as expected.

Thank you for that tip. This has finally solved one part of this mystery. Now I need to figure out getting audio over USB for a one cable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment