Duplicate a RS232 serial port to use ARCP and WSJTX/JTDX at the same time

In the last few months, I have been quite active in the early morning on the 160 and 80m bands. I use my remote station located in Ostia Antica, about 15 km from the home QTH. In this rural site, there are no limitations on antenna size, unlike in urban environments.
The transceiver I use is a Kenwood TS-480HX connected via serial port to a PC running the still very good Kenwood software ARCP.

Everything works fine for CW, but for FT8, the JTDX software cannot be connected via CAT to the transceiver because its serial port is already occupied by ARCP.


Until now, JTDX was set to “Transceiver None,” and band changes were made manually on ARCP (RTX) first, then on JTDX. If I forgot to change the band on JTDX, the QSOs were automatically logged on the wrong band, and I spent a lot of time fixing them.

Another annoying problem when using JTDX without CAT control is the frequent need for TX audio level adjustment to maintain a constant output power while the TX tone frequency is close to the edges of the SSB filter. With working CAT control, on the contrary, it is possible to set the “Split Operation” parameter to RIG or FAKE IT and keep the tone at the center of the TX filter all the time.

So, I researched how to split the serial port to allow two programs to work together and stay synchronized with the rig. I thought it would be easy with socat for Linux and com0com for Windows. The issue arose when ARCP connected to the transceiver. The Kenwood software sets the AI2 mode, and when the AI2 command is sent, the transceiver outputs any parameter variation on the serial port without being prompted (no polls). This results in a large amount of data being sent over the port. JTDX doesn’t handle this type of traffic and fails to connect to the radio.
The idea was to filter the traffic directed to JTDX so that it only receives the responses to its commands without the extra data generated for ARCP.

It worked!


Below tools and commands I used, they can be helpful for someone trying to manage multiple programs interacting with a single transceiver over a serial port.

  • the transceiver is connected via RS232 to a physical port on the PC /dev/ttyS0
  • the program ser2net opens the serial port /dev/ttyS0 and creates a TCP socket server on port 10000
  • the first virtual serial port is created to feed the ARCP control software which runs in wine.
    wine looks for the serial ports in the folder /home/user/.wine/dosdevices/ therefore the command
    /usr/bin/socat PTY,link=/home/user/.wine/dosdevices/com4,raw,echo=0 TCP:localhost:10000
    creates the virtual port com4 in that folder linked to the actual port /dev/ttyS0
  • the second virtual serial port for WSJTX/JTDX needs to be filtered, so the command is a bit more complicated.

    1- Create a FIFO special file with the command mkfifo jtdxfifo

    2- create a text file filter.sh in /home/user/ with the following content
    /usr/bin/stdbuf -i0 -o0 tr ';' '\n' | /usr/bin/grep --line-buffered -e IF -e FA -e FB -e MD -e FW -e AI | /usr/bin/stdbuf -i0 -o0 tr '\n' ';'
    then make it executable with chmod 775 filter.sh

    3- execute this long command to create the virtual filtered port ttyTS480 for WSJTX/JTDX
    /usr/bin/socat - "TCP:localhost:10000" 0<jtdxfifo | /usr/bin/socat - "exec:/home/user/filter.sh" | /usr/bin/socat - PTY,link=/home/user/ttyTS480,raw,echo=0 1>jtdxfifo
  • launch ARCP480 and connect it to the port com4
  • launch JTDX and configure the filtered radio port


  • You’re done!

Just a few words about the data filter…
The preamble /usr/bin/stdbuf -i0 -o0 instructs the system to disable the input and output buffer in order to obtain data output for each line input without waiting the filling of the whole buffer.

The CAT Kenwood commands and replies are all terminated with semicolon. The command tr ';' '\n' replaces the semicolons with a carriage return because the next command grep works with lines.

The grep command /usr/bin/grep --line-buffered -e IF -e FA -e FB -e MD -e FW -e AI simply outputs only the lines that start with IF, FA, FB, MD, FW and AI. Those are the only CAT keywords that WSJTX/JTDX wants to receive.
The last command tr '\n' ';' puts back the semicolon in its place to restore the CAT Kenwood syntax.

Probably all this can be done in different and better ways. However, this works for me.

Leave a comment