oe7drt-website/content/posts/2024/packetradio-vara-mobilinkd-and-digirig-on-linux/index.md

10 KiB

title summary date lastmod categories tags draft
Packet radio, VARA (FM+HF), Mobilinkd, Digirig and the SignalinkUSB on Linux Some basic configuration of my HF and VHF/UHF rigs to participate in the Winlink world... 2024-02-13T22:05:30+01:00 2024-03-23T18:47:43+0000
amateur-radio
packet radio
vara fm
vara hf
true

Out of curiosity I began another "research-session" because it is really time to get that Winlink back on my Linux laptop (I used OpenBSD on this machine for some months now and I haven't got a single chance to get wine onto that) -- I will stay Linux for a while I guess.

I've been using a Surface 2 Go for some time (well, a really short time) but ditched it again because I wasn't really satisfied with its performance.

There are several different devices and software solutions to send winlink messages and I won't cover all of them. The following examples exist because I own the necessary devices and I already have the software to work with them.

I would choose the Digirig as my favourite device because it just works every time and it also provides a USB soundcard to the computer (like the Signalink).

Digirig

The Digirig gets controlled with rigctld -- I use different models for the HF and the FM rig -- but the rig configuration is the same for both:

  "hamlib_rigs": {
    "my_rig": {
      "address": "127.0.0.1:4532",
      "network": "tcp"
    }
  },

That part of the pat configuration makes sure that pat can transmit with the radio.

Packet radio

Using AX.25+agwpe within pat in combination with Direwolf -- but this combination felt a bit slow (which might only be my subjective opinion).

Someone might want to tune direwolf for better throughput or more reliable connections, but I'm not a direwolf expert and I rarely use it in favour of VARA FM.

Besides that, I never used packetradio on HF yet. (300bps)

  "ax25": {
    "engine": "linux",
    "rig": "",
    "beacon": {
      "every": 3600,
      "message": "Winlink P2P",
      "destination": "IDENT"
    }
  "agwpe": {
    "addr": "127.0.0.1:8000",
    "radio_port": 0
  },

The agwpe section is used by Direwolf:

% direwolf -c /etc/direwolf/direwolf.conf -p
Dire Wolf version 1.7
Includes optional support for:  gpsd hamlib cm108-ptt dns-sd

Reading config file /etc/direwolf/direwolf.conf
Audio device for both receive and transmit: plughw:1,0  (channel 0)
Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, A+, 44100 sample rate.
Ready to accept AGW client application 0 on port 8000 ...
Ready to accept KISS TCP client application 0 on port 8001 ...
DNS-SD: Avahi: Failed to create Avahi client: Daemon not running
Virtual KISS TNC is available on /dev/pts/8
Created symlink /tmp/kisstnc -> /dev/pts/8

The direwolf.conf file looks like this (comments removed):

ADEVICE  plughw:1,0
CHANNEL 0
MYCALL OE7DRT
MODEM 1200
PTT /dev/ttyUSB0 RTS DTR
AGWPORT 8000
KISSPORT 8001
IGTXLIMIT 6 10

Direwolf will warn you if the input audio level is way off; I adjust them with the program alsamixer (F6 to select the USB soundcard, then F5 to list all devices, disable Auto Gain Control with m (mute)).

Direwolf handles the PTT via the RTS line of the Digirig.

VARA FM

The corresponding configuratoin in the pat config file:

  "varafm": {
    "addr": "127.0.0.1:8300",
    "bandwidth": 0,
    "rig": "my_rig",
    "ptt_ctrl": true
  },

Start rigctld with a Dummy model - just to use the USB port of the Digirig for PTT:

$ rigctld -m 1 -p /dev/ttyUSB0 -P RTS -s 9600 -vvvv

I start VARA FM by running a small script called varafm.sh:

#!/usr/bin/sh
# Start VARA via wine

WINEPREFIX=/home/dominic/.wine-winlink wine "C:\\VARA FM\\VARAFM.exe"

In VARA FM set the USB soundcard, adjust the volume in alsamixer and on your radio, set PTT to VOX -- I tried to use COM1 but that crashed wine several times (that is why I set up rigctl before).

If you need to stop rigctl: you can usually do that with CTRL + C but this might not work. So either stop the running pat process by hitting CTRL + C in the "pat terminal" or by killing rigctld with kill $(pgrep rigctld).

I also adjust the volumes while connecting to keep the ALC (DIG gain on the TX-500) correct and also the input volume in VARA FM.

VARA HF

Back to the TX-500, the pat configuration looks like:

  "varahf": {
    "addr": "127.0.0.1:8300",
    "bandwidth": 2300,
    "rig": "my_rig",
    "ptt_ctrl": true
  },

I start rigctld like:

$ rigctld -m 2050 -r /dev/ttyUSB0 -d /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvv

This is for the CAT protocol Lab599. If you use the older implementation (Kenwood TS-2000) start rigctl with the proper model:

$ rigctld -m 2014 -r /dev/ttyUSB0 -d /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvv

Mobilinkd

The Mobilinkd TNC4 is a KISS TNC and does not provide a USB soundcard.

I will use AX.25+linux in pat with the TNC4 paired via Bluetooth.

First of all, power on the TNC4 and pair it -- I use blueman-manager for this.

Then we need the serial port -- right click on TNC4 Mobilinkd and select Connect with Serial port

That will create a serial port at /dev/rfcomm0.

In order to use it in pat, we need to use kissattach on that serial device.

First we need to setup an AX.25 port called wl2k in /etc/ax25/axports:

# /etc/ax25/axports
#
# The format of this file is:
#
# name callsign speed paclen window description
#

#1	OH2BNS-1	1200	255	2	144.675 MHz (1200  bps)
#2	OH2BNS-9	38400	255	7	TNOS/Linux  (38400 bps)
wl2k  OE7DRT  1200  255 7 Winlink

This needs also some configuration work in the pat configuration:

  "ax25_linux": {
    "port": "wl2k"
  },
  "serial-tnc": {
    "path": "/dev/rfcomm0",
    "serial_baud": 9600,
    "hbaud": 1200,
    "type": "Kenwood",
    "rig": ""
  },

Now we can attach a KISS interface to the serial port:

$ sudo kissattach /dev/rfcomm0 wl2k
AX.25 port wl2k bound to device ax0

Select your PacketRadio Gateway (CALLSIGN-10 usually) and connect using AX.25+linux.

To de-attach the KISS interface we need to kill the process by:

$ sudo kill $(pgrep kissattach)

I haven't used this now for a while, but I wanted to include this in this list, as it provides a USB soundcard to the computer just like the Digirig does.

Some systemd unit-file examples

Put them into $HOME/.config/systemd/user. I created them at the beginning of my "Linux Winlink journey" but actually I only let pat start the webgui at boot - the other stuff I start with scripts or I search the command history (autocomplete) in my shell.

I don't even let pat listen to something because this is my main laptop and I like the services started in a terminal window.

pat

[Unit]
Description="pat winlink"
After=network.target rigctld.service ardopc.service
Wants=rigctld.service ardopc.service

[Service]
Type=simple
ExecStart=/home/dominic/bin/pat --listen "ardop,telnet" http
TimeoutSec=10

[Install]
WantedBy=default.target

rigctld

[Unit]
Description="rigctld for TX-500 using Digirig"
After=network.target
Before=pat.service ardopc.service

[Service]
Type=simple
; -m 2050 for Lab599 TX-500 CAT protocol
; ExecStart=/usr/bin/rigctld -m 2050 -r /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvvv
; -m 2014 for Kenwood TS-2000 CAT protocol
; ExecStart=/usr/bin/rigctld -m 2014 -r /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvvv
ExecStart=/usr/bin/rigctld -m 2014 -r /dev/ttyUSB0 -d /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvvv
TimeoutSec=10

[Install]
WantedBy=default.target

You can change the used protocol (Kenwood TS-2000 or Lab599 TX-500 for CAT control within the menu on the TX-500 (last menu setting)).

ardopc

[Unit]
Description="ardopc for TX-500 using Digirig"
After=network.target
Before=pat.service

[Service]
Type=simple
; ExecStart=/home/dominic/bin/ardopc 8515 hw:1,0 hw:1,0 -c /dev/ttyUSB0:9600 -p /dev/ttyUSB0:9600
ExecStart=/home/dominic/bin/ardopc 8515 plughw:1,0 plughw:1,0
TimeoutSec=10

[Install]
WantedBy=default.target

Maybe hw:… works better, but I had less trouble when using plughw:….

Decoding other stations

APRS

With direwolf

This also sends a beacon and the received stations to APRS-IS. You can watch it on https://aprs.fi.

$ rtl_fm -M fm -f 144.8M -p 36 -s 24000 -g 42 - | direwolf -c sdr-1200bps.conf -r 24000 -D 1 -B 1200 -

The direwolf configuration:

ACHANNELS 1
ADEVICE null null
CHANNEL 0

MYCALL {callsign}
IGLOGIN {callsign} {passcode}
IGSERVER rotate.aprs2.net

MODEM 1200

AGWPORT 8000
KISSPORT 8001

PBEACON sendto=IG delay=0:30 every=30:00 symbol="igate" overlay=R lat=X long=Y alt=in_meter comment="144.8MHz Receive-only gateway AFSK 1200bps"

IGTXLIMIT 6 10

With multimon-ng

$ rtl_fm -f 144.8M -g 42 -s 22050 -l 20 - | multimon-ng -t raw -a AFSK1200 -

With sdrangel

Packet radio

With direwolf

$ rtl_fm -f 144.950M -M fm -s 200000 -r 32000 -g 35 | direwolf -n 1 -r 32000 -b 16 -t 0 -
$ rtl_fm -M fm -f 144.950M -s 22050 | direwolf -n 1 -r 22050 -b 16 - 

With multimon-ng

With sdrangel

VARA HF

We can only decode with VARA HF in monitor mode.

POCSAG

With direwolf

With multimon-ng

$ rtl_fm -M fm -f 438.025M -s 22050 | multimon-ng -t raw -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -a FLEX -f alpha -

With sdrangel