Type something to search...
Running Winlink on Linux with PAT

Running Winlink on Linux with PAT

Setting up pat to get on HF Winlink on Linux

This is a quick run-through of how to put together a few simple software pieces to get your radio on the air with Winlink using only your Linux computer. We don’t believe in Microsoft products here…

Info

I’ll be showing examples here with some specifics to my radio, a Yaesu FT-991a. While your settings might not be exactly the same, you can likely replace any specifics for the 991a with your radio’s specifics in the configuration.

Prerequisites

  • An HF radio capable of connecting to your computer
    • This can achieved with a modern radio that has a USB interface, or a radio with a soundcard and rig control.
  • A working linux installation
  • pat — installed from: https://github.com/la5nta/pat
  • hamlib rigctld installed and running. This one is likely in your package manager, it is available via dnf or rpm-ostree if you’re on Fedora or Silverblue/Kinoite https://www.mankier.com/1/rigctld
  • ardopcf — installed from https://github.com/pflarue/ardop

If you don’t know exactly how to get these setup on your own, don’t worry, that’ll be the first step here, at a high level.

pat installation and configuration

  1. First we’re going to grab the tarball release from GitHub. We’ll do the following in a terminal window on your Linux machine.
curl -JLO https://github.com/la5nta/pat/releases/download/v0.16.0/pat_0.16.0_linux_amd64.tar.gz
tar -xzf pat_0.16.0_linux_amd64.tar.gz
cd pat_0.16.0_linux_amd64
chmod a+x pat
sudo ln -s $PWD/pat /usr/local/bin/pat

Those commands should download the pat tarball — which at the time of writing is the lastest release, extract the archive, mark the binary as executable, and then create a symbolic link into /usr/local/bin so that pat will be in your $PATH, meaning you don’t need to use the full directory structure to call it.

  1. Test and configure pat. There is a handy built-in configure argument that will generate and open a config file for us to start with. To access this run: pat configure in your terminal. If you get an error that the command is not found, then their was an issue with your unpack and symlink setup. You can always specify the full path to the binary as a fallback (i.e. /home/joeschmoe/pat_0.16.0_linux_amd64/pat) You should presented with a TUI text editor (likely nano) and your config file.

  2. In the config file, scroll around and look at the options. Make sure you fill out your callsign and your maidenhead square.

Tip

If you don’t know your grid square, check out this tool to calculate it for you: https://www.levinecentral.com/ham/grid_square.php

  1. Under hamblib_rigs we’re going to setup the details for the radio. This is what I’ve defined for my rigctld setup and the FT-991a.
"hamlib_rigs": {
  "FT-991": {
    "address": "localhost:4532",
    "network": "tcp"
  }
}

Note

The dictionary key needs to match an official rigctl definition. You can view all the supported devices for your version of rigctl by issuing the rigctl -l command.

  1. Now we have to setup our ardop section. You should find that section under the ardop key in your pat configuration file.

Tip

The actual configuration file for pat by default is located in $HOME/.config/pat/config.json. You’re not limited to using the builtin configure command to edit it.

"ardop": {
  "addr": "localhost:8515",
  "arq_bandwidth": {
    "Forced": false,
    "Max": 500
  }
}

ARDOP installation and configuration

  1. Download ardopcf in a similar manner to how we got pat
curl -JLO https://github.com/pflarue/ardop/releases/download/1.0.4.1.3/ardopcf_amd64_Linux_64
chmod a+x ardopcf_amd64_Linux_64
ln -s $PWD/ardopcf_amd64_Linux_64 /usr/local/bin/ardopcf
  1. This one doesn’t require a lot of config, at least for our use case with defaults, but we will have to ensure it has appropriate audio input. This is sort of old-school, at least in my mind given that pipewire is so good at its job, but this is what worked for me, since ham radio is old school sometimes…

Create the following file at: $HOME/.asoundrc:

pcm.ARDOP {
       type rate
       slave {
               pcm "hw:3,0"
               rate 48000
       }
}

You will likely have to change the pcm parameter. This is a value obtained through querying ALSA while you have your radio on and plugged into your computer.

Tip

Try querying your audio devices with aplay -l and arecord -l in the command-line to get your pcm parameter for the above audio config file.

  1. Run it to test config:
ardopcf

This is an interrupting call so your terminal will stay attached to the process and it will run in the background. You could also set this up as a systemd service if you were so inclined.

Putting it all together

These are the steps that work for me in my current linux environment with the above software and FT-991a.

  1. Turn on radio, and plug it in to your computer by USB.
  2. Start rigctl:
rigctld -m 1035 -r /dev/ttyUSB0 -s 38400 -T 127.0.0.1 -t 4532 -vv
  1. Start ardop:
ardopcf
  1. Start pat. We’re going to opt for the local http server to interact with it via our browser. This makes it easier to work on forms.
pat http
  1. Now go to the webUI in your browser: http://localhost:8080

pat can do some other cool things to help you out, like download and populate a list of relays:

pat mslist -s -m ardop --force-download

This is a good way to seed your list of stations to select from in the pat webUI.

You’ll also need to register for a Winlink account, if you don’t have one already. This will then get us a password to put into the pat config file. You don’t need a radio for this part. Check out https://winlink.org/user for access to account utilities. You can also use pat to help you. After launching the webUI you can connect with the telnet profile to get your account going.

pat web interface telnet profile

And that’s it! At least for me, for now. This gets me up and running and into Winlink via HF through some local reflectors.

Share :

Comments

Related Posts

How to install AREDN in a Virtual Machine on Proxmox

How to install AREDN in a Virtual Machine on Proxmox

AREDN as a Proxmox Workload Proxmox Virtual Environment (PVE) is a fantastic open source resource for homelabbers and production hyperconverged infrastructure alike. It does come with ocassional ch

read more