2 TCP IP TNC
Tom Russo edited this page 2026-02-15 12:19:37 -07:00

Using Xastir with TCP/IP KISS TNCs

Xastir has no native support for TNC devices that work over TCP/IP, but on Linux and other Unix-like systems you can use the socat program to create a pseudo-terminal device ("PTY") that mirrors the data from the TCP/IP TNC and connect Xastir to that.

For example, if your TNC is running with the IP address 192.168.1.10 and talking on port 8001, a simple example socat invocation that creates a PTY called "/tmp/tnc" and connects that device to the TNC would be

socat PTY,link=/tmp/tnc TCP:192.168.1.10:8001 &

This would run socat, create the PTY, connect the PTY to the port, and then run in the background.

Xastir would then be set up with a normal serial kiss TNC interface using the "/tmp/tnc" device as its "serial port."

Putting it all together in a script

One Xastir user created a script for himself to make the creation of the socat link, invocation of Xastir, and destruction of the socat link a single operation. This script was posted in a Github discussion, but we reproduce it here for convenience:

#!/bin/bash
socat PTY,link=/tmp/tnc TCP:192.168.1.10:8001 &
sleep 1
xastir
sleep 1
kill -SIGTERM $(pidof socat)

This creates the link, puts socat in the background, invokes xastir leaving it in the foreground, and then kills socat when Xastir exits.

Xastir does not automatically reconnect to serial devices when they go away

While this technique does work, Xastir has no setting to allow it to reconnect automatically to serial ports if the device crashes like it does for other network connections. If for some reason your socat crashes or is killed while Xastir is using it, the interface will shut down and not restart until you do so manually.