Winlink on Raspberry Pi 5 with VARA & Pat 


“After days of intense testing, I’ve found that for a reliable Ham Radio station on the Raspberry Pi 5, Raspberry Pi OS Bookworm (32-bit) is the superior choice. While 64-bit systems and ‘Trixie’ are cutting-edge, they introduce significant compatibility issues with legacy radio software. By choosing the stable 32-bit Bookworm release, we ensure native support for 32-bit binaries and a proven 4k page size environment, making the installation of VARA HF, Pat, and Hamlib rock-solid and reproducible.”

Part 1: The Foundation – Wine (32-bit) on Raspberry Pi 5

The Raspberry Pi 5 is a beast, but its native 64-bit architecture and 16k memory page size are completely incompatible with legacy 32-bit Windows programs like VARA. To fix this, we force the Pi into a stable 32-bit/4k environment and build our own engine (Box86) and gearbox (Wine 8.0) from scratch. No flakey automated scripts here—just a hand-picked, rock-solid setup.

Phase 1: Setting up the Workshop (OS & Basics)

  1. Flashing: Use the Raspberry Pi Imager to flash Raspberry Pi OS (32-bit) Bookworm to your SD card.
  2. Update the System: Boot up, open a terminal, and ensure everything is current:
    sudo apt update && sudo apt full-upgrade -y
  3. Adjust System Config (raspi-config):
    sudo raspi-config
    • Graphics Server: Under Advanced Options > Wayland, you must select X11 and reboot the system, otherwise the next steps won’t work! Then start raspi-config again. Real VNC Server do not work with Wayland.
    • Autologin: Under System Options > Boot / Auto Login, select Desktop Autologin.
    • Remote Access: Under Interface Options, enable VNC.
    • Exit & Reboot: Select Finish and reboot immediately. VNC will not work with X11 until you do.

Phase 2: Pouring the Foundation (Kernel & Memory)

After the reboot, we force the architecture to 32-bit/4k pages and expand the swap space for the build process.

Force 4k Pages & 32-bit:

sudo sed -i 's/$/ arm_64bit=0/' /boot/firmware/cmdline.txt
echo "kernel=kernel8.img" | sudo tee -a /boot/firmware/config.txt

Increase Swap Space (to 2GB):

sudo dphys-swapfile swapoff
sudo sed -i 's/CONF_SWAPSIZE=100/CONF_SWAPSIZE=2048/g' /etc/dphys-swapfile
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Install Build Tools:

sudo apt install -y cmake build-essential git

Reboot & Quality Check:

sudo reboot
IMPORTANT: After booting, type getconf PAGESIZE in the terminal. If it returns 4096, your foundation is perfectly level.

Phase 3: Building the Engine (Box86 Emulator)

We compile our own 32-bit translator, tailored specifically for this system.

cd ~
git clone https://github.com/ptitSeb/box86.git
cd box86
mkdir build; cd build
cmake .. -DRPI4=OFF -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j2
sudo make install
sudo systemctl restart systemd-binfmt

(Note: We use -j2 to limit CPU cores, ensuring we don’t run out of RAM during the build).

Engine Test: Type box86 -v. If you see a version number and date, the engine is running smoothly.

Phase 4: Installing the Gearbox (Wine 8.0 Portable)

We avoid newer Wine 9.x versions as they currently crash on the Pi 5. We use the stable 8.0 “Portable” version installed directly in our home directory.

Load Required Libraries:

sudo apt install -y libx11-6 libfreetype6 libasound2 libgl1-mesa-glx

Download & Unpack Wine 8.0 (32-bit):

cd ~
wget https://github.com/Kron4ek/Wine-Builds/releases/download/8.0/wine-8.0-x86.tar.xz
tar -xf wine-8.0-x86.tar.xz
rm wine-8.0-x86.tar.xz

Turn the Key (Initialization):

WINEARCH=win32 ~/wine-8.0-x86/bin/winecfg
  • Note: If Wine asks to download Mono or Gecko, click Install.
  • In the configuration window, set the Windows Version to Windows 10 (bottom right) and click OK. Ignore any “fixme” errors in the terminal.

Part 2: Interior Construction – Installing VARA HF on the Pi 5

With our foundation set, the Box86 engine humming, and our Wine 8.0 (32-bit) gearbox ready, it’s time to install the actual modem: VARA HF. Since VARA was written in Visual Basic 6 and has a small bug regarding CPU queries on ARM processors, we need to prep our workbench before running the installer.

1. Gathering Materials and Special Tools

First, we fetch the installer and the necessary tools to unpack legacy Windows packages under Linux.

Download VARA: Open Chromium on your Pi, download the latest VARA HF ZIP file (e.g., from EA5HVK), and save it to /home/pi/Downloads.

Unzip the Files:

cd ~/Downloads
unzip VARA*.zip

Install the Unpacking Tool (cabextract):

sudo apt install -y cabextract

2. Applying the Primer (Visual Basic 6 Runtime)

Without this “primer,” VARA lacks the components to draw its interface, causing the setup to fail silently. We use winetricks to add the missing pieces.

Get Winetricks ready:

cd ~
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks

Install the VB6 Runtime:

(This command downloads the official Microsoft package. Simply click through any confirmation windows that appear).

env WINE=~/wine-8.0-x86/bin/wine WINEARCH=win32 ./winetricks vb6run

3. Installing VARA HF

Now the site is prepped, and we can launch the actual setup.

Check the exact filename:

cd ~/Downloads
ls

(Note the exact name, e.g., VARA_HF_setup.exe).

Run the Installer: (Replace the placeholder with your filename):

WINEARCH=win32 ~/wine-8.0-x86/bin/wine YOUR_FILENAME_HERE.exe

Follow the Setup:

  • Click through the Windows setup as usual.
  • The Golden Rule: In the very last window, UNCHECK the box “Launch VARA” before clicking “Finish”! We must disable a specific sensor first.

4. Preventing the Crash (Disabling pdh.dll)

VARA has a minor CPU usage display. This specific query is incompatible with the Pi 5’s ARM architecture and will crash the program immediately. We simply “disconnect” this sensor in the registry.

Disable the Sensor:

WINEARCH=win32 ~/wine-8.0-x86/bin/wine reg add "HKCU\Software\Wine\DllOverrides" /v pdh /t REG_SZ /d "" /f

(The terminal should confirm with “The operation completed successfully”).

5. Final Inspection (First Start)

The system is ready. Let’s turn the key.

cd ~
WINEARCH=win32 ~/wine-8.0-x86/bin/wine ~/.wine/drive_c/VARA/VARA.exe

The VARA interface should now open cleanly and without errors on your screen!

Part 3: The Radio Interface – Hamlib, Pat & PTT Control

VARA HF is now running. Now we close the loop: Radio <-> Hamlib <-> Pat <-> VARA HF. Since VARA cannot control your radio directly under Linux, we use Hamlib as the translation office and Pat as our command center.

1. Setting up the Translation Office (Hamlib)

We install the control library so the Pi learns how to communicate with amateur radio transceivers.

Install Hamlib:

sudo apt install -y libhamlib-utils

Check Model Number and Port:

Search the list for your device (e.g., Elecraft):

rigctl -l

(The Elecraft KX2 uses model number 2044).

Check which port your interface (e.g., LiNK500) is assigned to:

ls -l /dev/serial/by-id

(Note the port, usually /dev/ttyUSB1 for CAT control).

Start the Hamlib Server (rigctld):

IMPORTANT for KX2/LiNK500: To prevent the radio from immediately keying the PTT upon startup, we must disable RTS and DTR:
rigctld -m 2044 -r /dev/ttyUSB1 -s 38400 --set-conf=dtr_state=OFF,rts_state=OFF &

Function Test (Query Frequency):

Ask for the current frequency to confirm the connection:

rigctl -m 2 f

2. Building the Command Center (Pat)

Pat is the application that manages your Winlink emails and controls both the VARA modem and the PTT.

Download and Install Pat:

cd ~/Downloads
wget https://github.com/la5nta/pat/releases/download/v0.16.0/pat_0.16.0_linux_armhf.deb
sudo dpkg -i pat_0.16.0_linux_armhf.deb

3. Configuration (The Heart of the System)

The first time you run pat configure, it creates a config file and opens the editor. Enter your data and hardware links here.

Open Config File:

pat configure

Adjust Entries:

Find the corresponding lines and fill them in exactly as shown (pay attention to the commas at the end of the lines!):

A) Your Basic Data:

"mycall": "YOURCALL",
"secure_login_password": "YOURWINLINKPASSWORD",
"locator": "YOURLOCATOR",

B) Radio Connection (hamlib_rigs):

We name the connection “KX2” and point it to the Hamlib server:

"hamlib_rigs": {
  "KX2": {
    "address": "localhost:4532",
    "network": "tcp"
  }
},

C) VARA Modem Control (varahf):

Link Pat to VARA and tell it that the rig “KX2” should handle the PTT:

"varahf": {
  "addr": "localhost:8300",
  "bandwidth": 2300,
  "rig": "KX2",
  "ptt_ctrl": true
},

Save with Ctrl+O (Enter) and exit with Ctrl+X.

4. The “Powerday” Test Run

For your first successful connection, strictly follow this startup sequence:

  • 1. Hamlib Server: rigctld -m 2044 -r /dev/ttyUSB1 -s 38400 --set-conf=dtr_state=OFF,rts_state=OFF &
  • 2. VARA HF: WINEARCH=win32 ~/wine-8.0-x86/bin/wine ~/.wine/drive_c/VARA/VARA.exe
  • 3. Pat Interface: pat http

Connect: Open your browser (http://localhost:8080), select VARA HF, enter a target station (e.g., HB9ZF), and click Connect.

Part 4: One-Click Mission Control – Automation with Desktop Scripts

Once the technical setup is rock-solid, the next logical step for any efficient operator is automation. You don’t want to type five different commands into the terminal every time you want to get on the air. We are going to build two “Main Switches” for your desktop: one for a clean Start and one for a safe Shutdown.

1. The Start Switch (Winlink_Start.sh)

This script handles the entire “Pre-Flight Check” for you. It initializes the Hamlib server, launches VARA HF via Wine, starts the Pat engine in the background, and finally opens your dashboard in the browser.

How to create the file:

  1. Open a terminal and create the file on your desktop:
    nano ~/Desktop/Winlink_Start.sh
  2. Copy and paste the following content:
    #!/bin/bash
    # 1. Start Hamlib Server
    rigctld -m 2044 -r /dev/ttyUSB1 -s 38400 --set-conf=dtr_state=OFF,rts_state=OFF &
    sleep 2
    
    # 2. Launch VARA HF via Wine
    WINEARCH=win32 ~/wine-8.0-x86/bin/wine ~/.wine/drive_c/VARA/VARA.exe &
    sleep 5
    
    # 3. Start Pat Winlink
    pat http &
    sleep 3
    
    # 4. Open Browser with Pat Dashboard
    chromium-browser http://localhost:8080
  3. Save with Ctrl+O, then Enter, and exit with Ctrl+X.
  4. Make the script executable:
    chmod +x ~/Desktop/Winlink_Start.sh

2. The Stop Switch (Winlink_Stop.sh)

When you are done, you want to leave your “workshop” clean. This script kills all running processes simultaneously, ensuring no “zombie” processes keep blocking your serial ports.

How to create the file:

  1. Create the file on your desktop:
    nano ~/Desktop/Winlink_Stop.sh
  2. Copy and paste the following content:
    #!/bin/bash
    # Terminate all Winlink processes
    pkill pat
    pkill rigctld
    wineserver -k
    pkill VARA.exe
    
    echo "Winlink station successfully shut down."
    sleep 2
  3. Save with Ctrl+O, then Enter, and exit with Ctrl+X.
  4. Make the script executable:
    chmod +x ~/Desktop/Winlink_Stop.sh

3. Pro-Tip: Managing Desktop Icons

On the Raspberry Pi desktop, you can simply double-click these .sh files. When prompted, select “Execute in Terminal.”

Note: You can also right-click the file on the desktop, go to Properties > Permissions, and ensure “Execute” is checked to make launching even smoother.

OPTIONAL: The Ultimate Backup – Installing ARDOP and LiNK500 TNC

A true professional never goes to a job site without backup tools. If the VARA network is out of reach, an ARDOP gateway or a Robust Packet Radio (RPR) connection via your LiNK500 TNC is your life insurance. Here is how we add these two native Linux tools to your existing setup for maximum redundancy.

A) Adding the ARDOP Modem

ARDOP runs natively on Linux—no Wine or emulator required. We just drop the executable straight into our toolbox.

1. Get the ARDOP Tool:

cd ~/Downloads
wget https://www.cantab.net/users/john.wiseman/Downloads/Beta/piardopc
chmod +x piardopc
sudo mv piardopc /usr/local/bin/ardopc

2. Find your Soundcard:

ARDOP needs to know exactly where your LiNK500 audio interface is located.

aplay -l

(Look for “USB Audio”. If it says card 1: ... device 0:, your card ID is 1,0).

3. Configure Pat for ARDOP:

pat configure

Find the "ardop" section and update it (make sure ptt_ctrl is set to true!):

"ardop": {
  "addr": "localhost:8515",
  "rig": "KX2",
  "ptt_ctrl": true,
  "beacon_interval": 0,
  "cwid_dir": ""
},

Save with Ctrl+O (Enter) and exit with Ctrl+X.

B) Adding the LiNK500 TNC (AX.25 Packet Radio)

Unlike VARA or ARDOP, AX.25 is built directly into the Linux engine (the kernel). We just need to attach your USB port to the system.

1. Install the Special Tools:

sudo apt install -y ax25-tools ax25-apps

2. Configure the Port (axports):

sudo nano /etc/ax25/axports

Scroll to the very bottom and add this single line (use spaces or tabs between the values):

link500    DL1GKK-10    9600    255    2    LiNK500 RPR KISS

Save with Ctrl+O (Enter) and exit with Ctrl+X.

3. Configure Pat for AX.25:

pat configure

Find the "ax25" section and enter our defined port name:

"ax25": {
  "port": "link500",
  "beacon": {
    "every": 0,
    "message": "",
    "destination": "IDENT"
  }
},

Save with Ctrl+O (Enter) and exit with Ctrl+X.

C) Updating the Automation Scripts

We want these tools to start automatically alongside everything else. Let’s add them to your Main Switches.

In Winlink_Start.sh:

Add these lines above the Pat startup (adjust plughw:1,0 if your soundcard ID from step A2 was different):

# 0. Attach KISS TNC (LiNK500)
sudo kissattach /dev/ttyACM0 link500 10.1.1.1 &
sleep 2

# 2.5 Start ARDOP (plughw:1,0 means Card 1, Device 0)
ardopc 8515 plughw:1,0 plughw:1,0 &
sleep 2

In Winlink_Stop.sh:

Add these lines to gracefully kill the background processes during shutdown:

pkill ardopc
sudo pkill kissattach
Mission Accomplished: Now, when you open the Pat browser dashboard, you can seamlessly switch between VARA HF, ARDOP, and AX.25 via the dropdown menu. Maximum redundancy achieved!

Disclaimer: This setup was developed in collaboration with Gemini AI. While we’ve worked hard to make this guide as “bulletproof” as possible, tech is always evolving—errors may occur, or specific functions might need a bit of extra tweaking.

The solution? Don’t hesitate to ask Gemini yourself if you get stuck. Good luck with your build!