Direwolf soundcard packet on Linux, with ax25 and LinPac

I’ve been playing around with Direwolf soundcard packet radio decoder on Linux. On Windows I use the packet terminal app that comes with the UZ7 soundcard modem, which you can connect to Direwolf’s AGW port over a network. The only comparable app on Linux that I’ve found seems to be LinPac.

Linpac connects over an ax25 port. To get LinPac to connect to Direwolf there’s a few steps to jump through.

Install Direwolf

Download the source from: https://home.comcast.net/~wb2osz/site/?/home/

(or after Oct 8 2015, https://github.com/wb2osz/direwolf)

Install libasound2-dev:

sudo apt-get install libasound2-dev

Compile Direwolf:

make
sudo make install

If you get this error when compiling Direwolf then you missed the libasound-dev step:

audio.c:80:28: fatal error: alsa/asoundlib.h: No such file or directory
#include <alsa/asoundlib.h>

Copy the supplied direwolf.conf file (from the downloaded source) to your home dir. To find out what input and output sound devices you have, run

aplay - l

and

arecord -l

You’ll see something like this:

**** List of CAPTURE Hardware Devices ****

card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

card 0: NVidia [HDA NVidia], device 2: ALC1200 Alt Analog [ALC1200 Alt Analog]

  Subdevices: 1/1

  Subdevice #0: subdevice #0

Get the device numbers for the soundcard you are using and edit direwolf.conf. For device 0 subdevice 0, edit this line and set 0,0:

ADEVICE  plughw:0,0

Using a Rigblaster Plug and Play on Ubuntu 14.04, it was automatically recognized and showed up per the docs on /dev/ttyUSB0. Direwolf will use this for PTT on your radio. I uncommented this line to enable this:

PTT /dev/ttyUSB0 RTS

To give my current user access to ttyUSB0 (and avoid running with sudo) I had to add my user to the dialout group (per post here):

sudo usermod -a -G dialout $USER

Start up alsamixer and make sure the mic inputs and outputs are not muted (M), and the volume levels are around 3/4.

Install the ax25 network suport:

sudo apt-get install libax25 ax25-apps ax25-tools

To enable an ax25port, edit /etc/ax25/axports, I added a line like this:

1 KK6DCT-1 1200 255 2 2m packet

The first column is the port name. Start up direwolf with the -p option to enable a KISS port, you’ll see something like this (-t 0 t0 suppress the colors):

kev@kevs-ubuntu:~$ direwolf -t 0 -p
Dire Wolf version 1.2
Audio device for both receive and transmit: plughw:0,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 client application on port 8001 ...
Virtual KISS TNC is available on /dev/pts/0
WARNING - Dire Wolf will hang eventually if nothing is reading from it.
Created symlink /tmp/kisstnc -> /dev/pts/0

Note the /dev/pts/X value, and use this with a kissattach command to connect Direwolf to ax25:

sudo /usr/sbin/kissattach /dev/pts/0 1 44.56.4.118

The 1 value following /dev/pts/0 is the port number from the axports file.

Per the Direwolf PDF doc, if you see this error:

kissattach: Error setting line discipline: TIOCSETD: Device or resource busy
Are you sure you have enabled MKISS support in the kernel
or, if you made it a module, that the module is loaded?

Then try this instead:

sudo /usr/sbin/kissattach /dev/pts/ptmx 1 44.56.4.118

Install LinPac

Download the LinPac source. Build and install:

./configure
make
make install

The first time you startup LinPac it creates a LinPac dir in your home folder. Edit macro/init.mac in this folder and change the port value to match the port name from your axports change (1 in the above example):

;; Default port
port 1

Start LinPac with:

linpac -m

(I’m not sure what the -m option is for, I found this in a post online, but without it I get errors on startup about ax25 port not found).

Connect to a node with :c nodename

Done!

6 Replies to “Direwolf soundcard packet on Linux, with ax25 and LinPac”

  1. Dear mates, I need your help — I got the tool installed but in the first run the tool wants to get root privileges — because running is done not in sudo mode, this breaks than the first run. Doing differnetly, running as root, on the other hand produces the LinPac folder in the home directory of the normal user.
    What is the indented way to achieve a correct installation. Thanks a lot and kind regards,
    Stephan

    1. I noticed the same too, it shouldn’t need to be run as root, but if you don’t, it doesn’t work. You could try opening a ticket/question with the developer and see what they recommend?

  2. Attempting soundcard packet using article posted on September 12, 2015 by kevin
    Direwolf soundcard packet on Linux, with ax25 and LinPac

    I did OK installing Dire Wolf 1.5 and LinPac 0.25. Adding to the ‘axports’ file ‘1 KM3D 1200 255 2 2m packet’ was not problem, but I ran into trouble enabling an ax25 port – it is not ‘persistent’. After rebooting, the direwolf/linpac link is gone.

    I used the command: ‘sudo /usr/sbin/kissattach /dev/pts/X Y 192.168.0.199’ and successfully the first time, where X is the /dev/pts/# (1 -as collected from direwolf) and Y is the /etc/ax25/axports file entry number (also my number 1 entry).

    When I started ‘linpac -m’ I attempted ‘:c WA3XYZ’ with no radio connected to see if there was sound card output. There was audio, with direwolf screen text ‘Data fram from KISS client application, port 2, total length=18’ and some hexidecimal values followed, and then a number of text lines, ‘Audio output data underrun.’ along with some very short ‘belches’ of audio … and then several RETRY attempts (set in direwolf.conf at 5).

    After using ‘Alt-X’ to close LinPac I rebooted the computer. After restarting direwolf (still OK at /dev/pts/1), checking in ‘/dev/pts/’ I found 0,1,2,3, and ptmx. Starting LinPac and then entering ‘:c WA3XYZ’ shows link failure.

    Entering: ‘sudo /usr/sbin/kissattach /dev/pts/1 1 192.168.0.199’ again results in
    ‘AX.25 port 1 bound to device ax0’

    – – – after which I have linpac and direwolf talking with each other again.

    I did read somewhere that the IP address in the kissattach statement was optional, but have found no references to its use. I am using the same computer for both direwolf and linpac so I used an internal address. ‘It is still dark in the cave’ and any light appreciated!

  3. Thanks, Kevin – reading more told me about the 44.0.0.0 IP’s and that the IP address is optional now in the kissattach parameters. I tried with both no IP and internal IP addresses with the same result (see above). My first concern is that kissattach permits linpac to talk with direwolf on the same machine, and I don’t want it to be necessary for me to ‘sudo kissattach’ before every time I start linpac.

    I did notice that my ax0 link disappears when linpac is exited with either the ‘Alt-X’ or ‘:SY’ command.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.