21
May
2020
Using DireWolf with Xastir instead of soundmodem
11:40

Using DireWolf with Xastir instead of soundmodem

21 May 2020 11:40

The standard soundmodem program decodes only strong Packet and APRS signals on frequency 144.800, skipping weak transmissions. Therefore, I decided to replace the Soundmodem with a more modern DireWolf packet modem and configure it according to the instructions https://elafargue.github.io/aprs-box/direwolf/#configuring-direwolf.

Installing a new version of DireWolf 1.5 1.6

In Linux Mint and Debian 10, the latest version 1.4 from April 2017 is not available. The more recent 1.5 from October 2018 has
improved AX.25 error correction tools, so I decided to install version 1.5 1.6.

In Debian, you need to perform a preparatory action - add a local user to the sudoers group (if not done previously).

su -
usermod -aG sudo username
exit

(where username is the name of your user account)
To apply the new permissions, you must end the current user session (log out and log in).

logout

then enter your username and password.

We update the package cache:

sudo apt-get update

Installed dependencies:

sudo apt install libudev-dev libasound2-dev

Installation git, C++ compiler gcc and utilities make:

sudo apt install git gcc make

Note: Without hamlib support, Dire Wolf will not work with PTT over CAT.
Before compiling Dire Wolf, you need to download the sources of hamlib 4, compile and install hamlib
from here:https://sourceforge.net/projects/hamlib/files/hamlib/

Instructions:

git clone https://github.com/Hamlib/Hamlib.git
cd Hamlib
sh bootstrap
./configure
make
make check

sudo make install

The first version of the instructions is designed for hamlib 3.3, but in 2021 the 4th version was released. Compiled under hamlib 3.3, the direwolf modem will work. But in 2021, it is advisable to switch to the more recent hamlib 4.0 (recompile the library - see instructions above). The difference between version 4.0 and 3.3 is in the numbering of transceiver models. For example, for Yaesu FT-857 the code was 122, now it is 1022. Then, you need to correct the digital code of the radio station model in the direwolf.conf configuration file (see below).

Clone GIT, compile and install DireWolf

git clone http://github.com/wb2osz/direwolf

Compiling the direwolf project:

cd direwolf
make

During compilation, the messages on the screen should display the text "This includes support for hamlib."

sudo make install

Update from 11/01/2021 - starting from version 1.6, the DireWolf compilation order has been changed!

sudo apt-get install cmake
git clone http://github.com/wb2osz/direwolf
cd ~
git checkout dev
mkdir build && cd build
cmake ..
make -j4
sudo make install
make install-conf

Configuring DireWolf in the AGWPE engine configuration for use with Xastir

  1. Installed an additional package of utilities for sound settings:

sudo apt install alsa-utils

  1. I looked at what sound cards are connected

aplay -l

List of PLAYBACK Hardware Devices
card 0: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
Subdevices: 1/1
Subdevice#0: subdevice#0
card 0: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
Subdevices: 1/1
Subdevice#0: subdevice#0

  1. Connected the earphone to the sound card and checked for sound

for built-in sound card.

speaker-test -Dplughw:0,0 -c2

(plughw:0,0 - sound card number 0, device number 0)

or in case of an external sound card

speaker-test -Dplughw:1,0 -c2

(plughw:0,0 - sound card number 1, device number 0)

or default device:

speaker-test -Ddefault -c2

(default - default sound device).

One of three options should work.

In the headphones I heard hissing (white noise) with some stereo effect.

If you don’t hear the noise, you need to find the name plughw:1,0, etc., based on the output of aplay -l

!Comment. in the initial installation I took direwolf.conf

From the resource

https://github.com/elafargue/aprs-box/blob/master/config/etc/direwolf/direwolf.conf

and saved it in Downloads.
But the instructions for the program itself advise that when installing for the first time, create a configuration file using the command make install-conf.

In the second installation option I ran the specified command make install-conf to create direwolf.conf.

  1. Copied the direwolf.conf configuration file to the global /etc directory

su -
cd /etc`**
mkdir direwolf
exit
sudo cp ~/direwolf/direwolf.conf /etc/direwolf/direwolf.conf

  1. Opened the DireWolf configuration file for editing

su -
nano /etc/direwolf/direwolf.conf

  1. Corrected the name of the sound card in the configuration file.

Name "ADEVICE pasym0" changed to:

"ADEVICE - plughw:0.0 » from point No. 3

Note: For built-in sound card, you should try the default option first:
ADEVICE default default

Attention: the first parameter is Input, the second Output. Here, in this example, the input of the sound "ADEVICE -" is set incorrectly, because It is not the sound card for sound input that is specified, but stdout. See comments in the direwolf.conf file from the developer. The correct line is ADEVICE look at the end of the article.

  1. I corrected the call sign just in case (although this is not necessary - since Xastir controls everything).

    MYCALL RA1AHQ-0

  2. In the PTT section, I removed the comment from the “PTT” line and corrected the COM port for performing transmission, transmission via HamLib CAT commands, where 122 is the HamLib model code for the Yaesu FT-857 transceiver for version 1.5

    PTT RIG 122 /dev/ttyUSB0

In the latest hamlib version 4.x, the transceiver codes have been changed - Yaesu FT-857 became No. 1022:

see HamLib wiki/Supported-Radios

PTT RIG 1022 /dev/ttyUSB0

Note: The radio station code (here 1022) must match the model number from the command output rigctl --list

10.Commented out the lines for Raspberry PI (I have a desktop PC)

#PTT GPIO 60

and this (temporarily, for the testing period):

#IGTXLIMITIGTXLIMIT 6 10

11.Leave the default ports unchanged

AGWPORT 8000

KISSPORT 8001

12.I comment on all the lines about APRStt GATEWAY

#TTPOINT

#TTVECTOR

#TTGRID

#TTUTM

#TTCORRAL

#TTMACRO

13.Saved direwolf.conf

14.Launched xastir

15.Added a new interface to the "Interfaces" menu "Networked AGWPE » with address localhost.
default port 8000

Saved the settings CRTL+O, CTRL+X.

16.Launched direwolf with the following command:
(Since the configuration file has been created, there is no need to pass command line parameters such as type of operation, transmission speed. We only specify the configuration file direwolf.conf, which we configured earlier).

direwolf -c /etc/direwolf/direwolf.conf -d n 1

where the "-d n" key means displaying debug information when the KISS network client is running.

Output of version without PTT support (incorrect)

Dire Wolf version 1.5
Includes optional support for: cm108-ptt

(missed)

Note: PTT not configured for channel 0. (Ignore this if using VOX.)

The output of the version with PTT support should be like this:

Dire Wolf version 1.5
Includes optional support for: hamlib cm108-ptt

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, E+, 44100 sample rate.
Ready to accept AGW client application 0 on port 8000 ...
Ready to accept KISS TCP client application 0 on port 8001 ...

17.Launched Xastir

(If it doesn’t start from the shortcut, I advise you to read the article about Xastir APRS - it tells you how to grant permissions.
For testing purposes, if you don’t want to read the article, you can use the “crude” solution to run as sudo xastir).

18.B Xastir interface started "Networked AGWPE" - switched to the state UP

The output in the Driewolf window has changed, the following lines have been added:

!!!Attached to AGW client application 0...
!!!
!!!Ready to accept AGW client application 1 on port 8000 ...

19.I put on my headphones and checked the transmission:Xastir - Interfaces - Transmit now!

The sound is clear and uninterrupted!!

20.In the terminal window and Direwolf looked for any errors:

There are no errors either!!!

[0L] RA1AHQ>APX210,WIDE2-2:=6000.00N/03000.00Ex

Setup completed successfully!


Solving the problem with enabling PTT transmission when using hamlib.

Ready to accept AGW client application 1 on port 8000 ...
Error sending rig_set_ptt command for channel 0 PTT
Communication timed out
[0L] RA1AHQ-1>APX216,WIDE2-2:=6000.00N/03000.00Ex
Transmit timing error: PTT is on 207 mSec too long.
Error sending rig_set_ptt command for channel 0 PTT
Communication timed out

Solution: in the Yaesu transceiver in menu 019, increase the CAT speed from 4800 to 38400bps.

PTT is now working. The station appeared on the APRS map.

map

All that remains is to set up the reception (there isn't one). ;-)

Direwolf's messages show that the input is taken from stdin, which is incorrect:
Audio input device for receive: stdin (channel 0)
and it should be plughw:1.0 (channel 0)

Final editing of the configuration file:

ADEVICE plughw:1.0 plughw:1.0

or for the built-in sound card:

ADEVICE default default

The result is positive, and the input and output are now taken from the desired sound card:
after setup

Now both reception and transmission works.
I attach the configuration file: direwolf.zip

All that remains is to adjust the Line In volume level using the commands su -,alsamixer.

Setting the optimal reception and transmission levels

Setting the optimal reception level

If the reception signal level is high, DireWolf will issue a warning.
level

The level needs to be reduced.
If there is a CAT interface with level adjustment (knobs), you can use them. I used AlsaMixer:

Enter the alsamixer command in the console:

sudo alsamixer

The volume mixer alsamixer has opened with a text, pseudo-graphical interface.

Pressed F6 - Select Sound Card, selected the sound card "USB Audio Device"

Pressed F4 - Capture (adjusting the recording level from the line input)

Reduced the Mic level from 70 to 6 (gain -6dB).
lvl

Pressed ESC

Launched DireWolf again:

direwolf -c /etc/direwolf/direwolf.conf -d n

I raised the interface in Xastir:

Menu "Interface" - "Interface Control" - (select the entry corresponding to DireWolf) - button "Start"
The interface should go to the UP state.
Close button

After adjusting the reception level, the errors in the Dire Wolf window completely disappear:
DireWolf works

Setting the optimal transmission level

The transmission volume is adjusted using the system level control (the graphic “slider” of the volume control next to the clock).

First, I set the power to 25 W and the volume control to 20%. On the control radio station during the command "Interface" - "Transmit Now"
monitored the volume and purity of the signal. On the APRS digital repeater installed 5 km from me, I heard response packets, and on ARPS.FI I monitored the time change,
when was station RA1AHQ-1 last heard. Then, by selecting the transmission level, gradually reducing the output power, I achieved the best response from my Digi or i-gate signal.

The final adjustment of the APRS transmit volume level was made at 5 W.

Possible errors

  1. If the error "Audio output data underrun." occurs during transmission,
    try using a different sound card (see speaker-test -Ddefault -c2), with appropriate changes to the direwolf.conf configuration file.
  2. If during reception the message “Audio input level is too low. Increase so most stations are around 50.” - adjust the reception sensitivity using alsamixer - F4 (input - recording level) - F6 (select sound card).
    Since the sensitivity of all cards is different.
  3. After each completion of the command “direwolf -c /etc/direwolf/direwolf.conf -d n”, do not forget to raise the interface in Xastir - Interface - Interface control and test Interfaces - Transmit Now.
  4. The digital repeater may not respond to our sendings (for example, it is out of range or disabled) - it is useless to check the passage of the packet by ear, by “echo” from DIGI. RX-Only gateways (nodes that broadcast packets received from the air to the Internet) work much more reliably. RX-Only gateways transmit information on a dynamic site with real-time APRS information: https://aprs.fi. That is, after the transmission, you need to look at your call sign on the APRS.FI card, and not wait for a response from the APRS repeater.

&nbsp

Links to DireWolf pages on the Internet:


Date of last change: 11/01/2021, corrections 04/16/2025.



Related publications