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

516 lines
14 KiB
Markdown
Raw Normal View History

2024-02-17 02:21:44 +01:00
---
2024-03-30 18:59:38 +01:00
title: Packet radio, VARA (FM+HF), Mobilinkd, Digirig and the SignaLink USB on Linux
2024-02-17 02:21:44 +01:00
summary: >
2024-03-23 19:47:43 +01:00
Some basic configuration of my HF and VHF/UHF rigs to participate in the
Winlink world...
2024-03-30 22:31:07 +01:00
date: 2024-03-30T22:28:25+0100
2024-12-17 14:48:35 +01:00
lastmod: 2024-12-17T13:48:35+0000
2024-03-30 22:31:07 +01:00
coverCaption: An example, a session to OE7XKG-10 on 144.950 MHz.
2024-02-17 02:21:44 +01:00
categories:
2024-09-29 01:48:06 +02:00
- amateur-radio
2024-02-17 02:21:44 +01:00
tags:
2024-12-17 14:48:35 +01:00
- packetradio
2024-09-29 01:48:06 +02:00
- vara fm
- vara hf
- winlink
- digirig
- mobilinkd
- signalink
- sdr
2024-02-17 02:21:44 +01:00
---
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
2024-02-24 22:30:29 +01:00
and I haven't got a single chance to get wine onto that) -- I will stay Linux for a while
I guess.
2024-02-17 02:21:44 +01:00
2024-03-02 10:56:42 +01:00
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.
2024-03-23 19:47:43 +01:00
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
2024-03-30 18:59:38 +01:00
also provides a USB soundcard to the computer (like the SignaLink USB)._
2024-03-23 19:47:43 +01:00
2024-02-17 02:21:44 +01:00
## 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:
2024-09-29 01:48:06 +02:00
```json
2024-02-17 02:21:44 +01:00
"hamlib_rigs": {
"my_rig": {
"address": "127.0.0.1:4532",
"network": "tcp"
}
},
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-03-23 19:47:43 +01:00
That part of the pat configuration makes sure that pat can transmit with the radio.
2024-02-17 02:21:44 +01:00
### Packet radio
Using <kbd>AX.25+agwpe</kbd> within pat in combination with Direwolf -- but
this combination felt a bit slow (which might only be my subjective opinion).
2024-03-23 19:47:43 +01:00
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)
2024-09-29 01:48:06 +02:00
```json
2024-02-17 02:21:44 +01:00
"ax25": {
"engine": "linux",
"rig": "",
"beacon": {
"every": 3600,
"message": "Winlink P2P",
"destination": "IDENT"
}
"agwpe": {
"addr": "127.0.0.1:8000",
"radio_port": 0
},
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
The <kbd>agwpe</kbd> section is used by Direwolf:
2024-09-29 01:48:06 +02:00
```console {hl_lines="8"}
2024-03-30 18:59:38 +01:00
$ direwolf -c /etc/direwolf/direwolf.conf -p
2024-02-17 02:21:44 +01:00
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
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
The `direwolf.conf` file looks like this (comments removed):
2024-09-29 01:48:06 +02:00
```squid
2024-02-17 02:21:44 +01:00
ADEVICE plughw:1,0
CHANNEL 0
MYCALL OE7DRT
MODEM 1200
PTT /dev/ttyUSB0 RTS DTR
AGWPORT 8000
KISSPORT 8001
IGTXLIMIT 6 10
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
Direwolf will warn you if the input audio level is way off; I adjust them
with the program `alsamixer` (<kbd>F6</kbd> to select the USB soundcard,
then <kbd>F5</kbd> to list all devices, disable _Auto Gain Control_ with <kbd>m</kbd>
(mute)).
2024-03-23 19:47:43 +01:00
Direwolf handles the PTT via the RTS line of the Digirig.
2024-02-17 02:21:44 +01:00
### VARA FM
The corresponding configuratoin in the pat config file:
2024-09-29 01:48:06 +02:00
```json
2024-02-17 02:21:44 +01:00
"varafm": {
"addr": "127.0.0.1:8300",
"bandwidth": 0,
"rig": "my_rig",
"ptt_ctrl": true
},
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-03-12 06:03:59 +01:00
Start `rigctld` with a <kbd>Dummy</kbd> model - just to use the USB port
of the Digirig for PTT:
2024-02-17 02:21:44 +01:00
2024-09-29 01:48:06 +02:00
```console
2024-02-17 02:21:44 +01:00
$ rigctld -m 1 -p /dev/ttyUSB0 -P RTS -s 9600 -vvvv
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
I start VARA FM by running a small script called `varafm.sh`:
2024-09-29 01:48:06 +02:00
```sh
2024-02-17 02:21:44 +01:00
#!/usr/bin/sh
# Start VARA via wine
WINEPREFIX=/home/dominic/.wine-winlink wine "C:\\VARA FM\\VARAFM.exe"
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
In VARA FM set the USB soundcard, adjust the volume in `alsamixer` and on your
radio, set <kbd>PTT</kbd> to <kbd>VOX</kbd> -- I tried to use <kbd>COM1</kbd> but
2024-03-12 06:03:59 +01:00
that crashed wine several times (that is why I set up _rigctl_ before).
2024-02-17 02:21:44 +01:00
If you need to stop rigctl: you can usually do that with
<kbd>CTRL</kbd> + <kbd>C</kbd> but this might not work. So either stop the running
pat process by hitting <kbd>CTRL</kbd> + <kbd>C</kbd> in the "pat terminal" or by
killing rigctld with `kill $(pgrep rigctld)`.
2024-03-12 06:03:59 +01:00
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.
2024-02-17 02:21:44 +01:00
### VARA HF
Back to the TX-500, the pat configuration looks like:
2024-09-29 01:48:06 +02:00
```json
2024-02-17 02:21:44 +01:00
"varahf": {
"addr": "127.0.0.1:8300",
"bandwidth": 2300,
"rig": "my_rig",
"ptt_ctrl": true
},
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
I start rigctld like:
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rigctld -m 2050 -r /dev/ttyUSB0 -d /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvv
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-03-23 19:47:43 +01:00
This is for the CAT protocol <kbd>Lab599</kbd>. If you use the older implementation
2024-04-28 11:14:37 +02:00
(<kbd>Kenwood TS-2000</kbd>) start rigctl with model <kbd>2014</kbd>:
2024-02-17 02:21:44 +01:00
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rigctld -m 2014 -r /dev/ttyUSB0 -d /dev/ttyUSB0 -p /dev/ttyUSB0 -P RTS -s 9600 -vvv
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
## Mobilinkd
2024-03-30 18:59:38 +01:00
{{< alert "circle-info" >}}
The Mobilinkd TNC4 is a KISS TNC and does not provide a USB soundcard -- I only use
the Mobilinkd in conjunction with packet radio.
{{< /alert >}}
2024-03-23 19:47:43 +01:00
2024-05-04 14:25:56 +02:00
### Winlink
2024-02-17 02:21:44 +01:00
I will use <kbd>AX.25+linux</kbd> 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 <kbd>TNC4 Mobilinkd</kbd> and select
_Connect with_ <kbd>Serial port</kbd>
That will create a serial port at `/dev/rfcomm0`.
2024-05-09 14:29:28 +02:00
You can also create _rfcomm0_ in the terminal (you need the package
<kbd>extra/bluez-deprecated-tools</kbd> for this):
2024-05-04 17:19:29 +02:00
2024-09-29 01:48:06 +02:00
- ```console
2024-05-04 17:19:29 +02:00
$ hcitool scan
Scanning ...
2024-09-29 01:48:06 +02:00
34:81:F4:AA:89:4F TNC4 Mobilinkd
2024-05-04 17:19:29 +02:00
$ sudo rfcomm connect 0 34:81:F4:AA:89:4F
Connected /dev/rfcomm0 to 34:81:F4:AA:89:4F on channel 1
Press CTRL-C for hangup
2024-09-29 01:48:06 +02:00
```
2024-05-04 17:19:29 +02:00
Leave that terminal window open, if you are finished with your operation hit
<kbd>CTRL</kbd>+<kbd>C</kbd> to disconnect the serial port.
2024-09-29 01:48:06 +02:00
- ```console
2024-05-04 17:19:29 +02:00
$ hcitool scan
Scanning ...
2024-09-29 01:48:06 +02:00
34:81:F4:AA:89:4F TNC4 Mobilinkd
2024-05-04 17:19:29 +02:00
$ sudo rfcomm bind 0 34:81:F4:AA:89:4F
2024-09-29 01:48:06 +02:00
```
2024-05-04 17:19:29 +02:00
You can work within this terminal but you have to release the port when you are
finished.
2024-09-29 01:48:06 +02:00
```console
2024-05-04 17:19:29 +02:00
$ sudo rfcomm release 0
2024-09-29 01:48:06 +02:00
```
2024-05-04 17:19:29 +02:00
2024-02-17 02:21:44 +01:00
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 <kbd>wl2k</kbd> in `/etc/ax25/axports`:
2024-09-29 01:48:06 +02:00
```squid
2024-02-17 02:21:44 +01:00
# /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
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
This needs also some configuration work in the pat configuration:
2024-09-29 01:48:06 +02:00
```json
2024-02-17 02:21:44 +01:00
"ax25_linux": {
"port": "wl2k"
},
"serial-tnc": {
"path": "/dev/rfcomm0",
"serial_baud": 9600,
"hbaud": 1200,
"type": "Kenwood",
"rig": ""
},
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
Now we can attach a KISS interface to the serial port:
2024-09-29 01:48:06 +02:00
```console
2024-02-17 02:21:44 +01:00
$ sudo kissattach /dev/rfcomm0 wl2k
AX.25 port wl2k bound to device ax0
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
Select your PacketRadio Gateway (CALLSIGN-10 usually) and connect using
<kbd>AX.25+linux</kbd>.
2024-03-30 18:59:38 +01:00
To de-attach the KISS interface we need to kill the process:
2024-02-17 02:21:44 +01:00
2024-09-29 01:48:06 +02:00
- ```console
2024-05-04 17:19:29 +02:00
$ sudo kill $(pgrep kissattach)
2024-09-29 01:48:06 +02:00
```
2024-05-04 17:19:29 +02:00
or
2024-09-29 01:48:06 +02:00
- ```console
2024-05-04 17:19:29 +02:00
$ sudo pkill kissattach
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-05-04 14:25:56 +02:00
### APRS with Xastir
Find the TNC4:
2024-09-29 01:48:06 +02:00
```console
2024-05-04 14:25:56 +02:00
$ hcitool scan
Scanning ...
34:81:F4:AA:89:4F TNC4 Mobilinkd
2024-09-29 01:48:06 +02:00
```
2024-05-04 14:25:56 +02:00
Create the serial port:
2024-09-29 01:48:06 +02:00
```console
2024-05-04 14:25:56 +02:00
$ sudo rfcomm bind 0 34:81:F4:AA:89:4F
2024-09-29 01:48:06 +02:00
```
2024-05-04 14:25:56 +02:00
We use `/dev/rfcomm0` in Xastir.
![Xastir Serial TNC settings](xastir-aprs.png)
To disconnect the device:
2024-09-29 01:48:06 +02:00
```console
2024-05-04 14:25:56 +02:00
$ sudo rfcomm release 0
2024-09-29 01:48:06 +02:00
```
2024-05-04 14:25:56 +02:00
2024-03-30 18:59:38 +01:00
## SignaLink USB
2024-03-23 19:47:43 +01:00
I haven't used this now for a while, but I wanted to include this in this list,
2024-03-30 18:59:38 +01:00
as it provides a USB soundcard to the computer just like the Digirig does -- but
it does not provide a serial interface to control the PTT.
### Packet radio
Start direwolf (using the same configuration as with the Digirig), it will
complain about not finding `/dev/ttyUSB0` for PTT control. I don't use this that
often and I don't use another USB device at the same time so I don't care about this.
If you have another device connected as `/dev/ttyUSB0` you should probably remove its
reference from the direwolf configuration file.
As mode I select <kbd>AX.25+agwpe</kbd> and I set the output volume of the
<kbd>PCM2906C Audio CODEC</kbd> to 100% -- the SignaLink USB will now control the PTT.
### VARA FM
Start VARA FM (I use my script mentioned above) and select the proper sound card.
The input volume level can be adjusted with the volume knob on the radio and the RX
knob on the SignaLink USB. The output volume level can be checked and adjusted with the
tune function withing the Soundcard menu from within VARA FM. You may also try the
Auto-tune function.
### VARA HF
I never tested this because I have no cable for the TX-500 and the SignaLink USB,
but as the Signalink only provides a soundcard you have to add another USB cable
for CAT control of the radio. You then start rigctld with the proper values for
that specific radio.
{{< alert "circle-info" >}}
That is the reason for the Digirig that combines these two functions
in one device.
{{< /alert >}}
2024-03-23 19:47:43 +01:00
2024-02-17 02:21:44 +01:00
## Some systemd unit-file examples
2024-03-12 06:03:59 +01:00
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
2024-03-23 19:47:43 +01:00
and I like the services started in a terminal window.
2024-02-17 02:21:44 +01:00
### pat
2024-09-29 01:48:06 +02:00
```systemd
2024-02-17 02:21:44 +01:00
[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
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
### rigctld
2024-09-29 01:48:06 +02:00
```systemd
2024-02-17 02:21:44 +01:00
[Unit]
Description="rigctld for TX-500 using Digirig"
After=network.target
Before=pat.service ardopc.service
[Service]
Type=simple
2024-03-23 19:47:43 +01:00
; -m 2050 for Lab599 TX-500 CAT protocol
2024-02-17 02:21:44 +01:00
; 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
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-03-23 19:47:43 +01:00
You can change the used protocol (<kbd>Kenwood TS-2000</kbd> or <kbd>Lab599 TX-500</kbd> for CAT control within
2024-02-17 02:21:44 +01:00
the menu on the TX-500 (last menu setting)).
### ardopc
2024-09-29 01:48:06 +02:00
```systemd
2024-02-17 02:21:44 +01:00
[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
2024-09-29 01:48:06 +02:00
```
2024-02-17 02:21:44 +01:00
2024-03-23 19:47:43 +01:00
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>.
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rtl_fm -M fm -f 144.8M -p 36 -s 24000 -g 42 - | direwolf -c sdr-1200bps.conf -r 24000 -D 1 -B 1200 -
2024-09-29 01:48:06 +02:00
```
2024-03-23 19:47:43 +01:00
The direwolf configuration:
2024-09-29 01:48:06 +02:00
```squid
2024-03-23 19:47:43 +01:00
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
2024-09-29 01:48:06 +02:00
```
2024-03-23 19:47:43 +01:00
#### With multimon-ng
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rtl_fm -f 144.8M -g 42 -s 22050 -l 20 - | multimon-ng -t raw -a AFSK1200 -
2024-09-29 01:48:06 +02:00
```
2024-03-23 19:47:43 +01:00
#### With sdrangel
Add a channel and select <kbd>Packet Demoulator</kbd>.
Once packet gets demodulated, add a feature and select APRS:
![Upper left portion of the whole SDRAngen window highlighting the 'Add feature' button](add-feat.png)
![Example view of the APRS feature window](aprs.png)
The APRS feature windows let you connect to APRS-IS (top right of the APRS window).
You can also add another feature called <kbd>Map</kbd> to display the received
APRS packets on a map.
![Cropped view of the map feature window](map.png)
2024-03-23 19:47:43 +01:00
### Packet radio
#### With direwolf
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rtl_fm -f 144.950M -M fm -s 200000 -r 32000 -g 35 | direwolf -n 1 -r 32000 -b 16 -t 0 -
2024-09-29 01:48:06 +02:00
```
2024-03-23 19:47:43 +01:00
2024-09-29 01:48:06 +02:00
```console
$ rtl_fm -M fm -f 144.950M -s 22050 | direwolf -n 1 -r 22050 -b 16 -
```
2024-03-23 19:47:43 +01:00
#### With sdrangel
Add a channel and select <kbd>Packet Demoulator</kbd>.
![An example of a decoded packet session](packet-session.png "A quick connection try at home
(the gateway is out of reach so we don't get an answer back)")
2024-03-23 19:47:43 +01:00
### VARA HF
We can only decode with VARA HF in monitor mode. It is possible that we can't decode anything.
2024-03-23 19:47:43 +01:00
### POCSAG
#### With multimon-ng
2024-09-29 01:48:06 +02:00
```console
2024-03-23 19:47:43 +01:00
$ rtl_fm -M fm -f 438.025M -s 22050 | multimon-ng -t raw -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -a FLEX -f alpha -
2024-09-29 01:48:06 +02:00
```
2024-03-23 19:47:43 +01:00
#### With sdrangel
![Settings of the main settings window](main.png)
Set the frequency to <kbd>438.025 MHz</kbd> (in Austria) and add a channel
(pink mark box). Select <kbd>Pager Demodulator</kbd> and start decoding
(click the Play button).
That will decode the set POCSAG modulation (defaults to 1200 baud).
2024-03-31 10:03:51 +02:00
[![Example of the decode in SDRAngel](pocsag-decode.png "Click the image to enlarge")](pocsag-decode.png)