Revisiting Packet Radio on a Raspberry Pi using Direwolf

It’s been a few years since I last played with Packet Radio on a Raspberry Pi, but I have been playing with the uz7ho soundcard software recently and have some packet APRS via the International Space Station.

Looking back at the Direwolf and ax25 setup I was playing with before, I couldn’t actually remember what the order of commands was to get things started up, despite still having it all still configured and installed on the same Pi that I used before. Assuming ax25 and Direwolf are installed and configured (see here and here), the steps to get ax25 up and running and connected are:

  • Start direwolf with: “direwolf -t 0 -p”
  • Note the /dev/pts/x value it returns on startup
  • Run: “sudo kissattach /dev/pts/1 1” (where /dev/pts/1 matches the same value from direwolf startup)
  • The second 1 is the network name from your axports file, like:

1 KK6DCT-5 19200 255 2 2m packet

Ensure direwolf.conf has the same callsign-ssid value, in my example here, KK6DCT-5

Ensure alsamixer has volume around 3/4 for your audio card

To find what audio card device you’re using, use: “axplay -l”. With a Signalink, this shows up as:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: CODEC [USB Audio CODEC], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

The Signalink is card 1, subdevice 0, so the corresponding config in direwolf.conf for this device is:

ADEVICE  plughw:1,0

To summarize:

  1. Start direwolf, grab the /dev/pts/x value
  2. Start kissattach with the same /dev/pts/x value
  3. Now you should be able to “call 1 nodename” and get a packet connection out via Direwolf to your radio.

Packet Radio on Debian 9 with Direwolf and ax25

I’ve played around with Packet and Direwolf on the Raspberry Pi quite a bit, but every time I try and getting it working on Linux on a desktop I run into some differences in the config. From past attempts, I followed most of the steps I had followed before here.

The following steps are with a USB Rigblaster Plug n Play, connected to the dataport on my Icom 880h radio .

I installed and compiled Direwolf from source as before, and started it up with:

$ direwolf -t 0 -p
Dire Wolf version 1.5
Reading config file direwolf.conf
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 TCP client application 0 on port 8001 …
Virtual KISS TNC is available on /dev/pts/1
Created symlink /tmp/kisstnc -> /dev/pts/1

I installed the ax25 apps as in the previous article, and then added 1 line to /etc/ax25/ports:

1    KK6DCT-1    1200    255 2   2m packet

I then started kissattach:

$ sudo kissattach /dev/pts/1 1

/dev/pts/1 is the value from when Direwolf started, and port 1 is the line I added to the ports file.

From here I can connect to the local ag6qo-1 BBS, via the BERR37 node:

axcall 1 ag6qo-1 via berr37

Packet Radio with Debian Hamradio Pure Blend

I stumbled across this concept of ‘Debian Pure Blends‘ a couple of days back. These are Debian distros that are configured with software preinstalled for a specific purpose, like graphic design, and astronomy. The Ham Radio distro caught my eye as it’s preconfigured with ax25 and Direwolf for Packet Radio.

The trouble is, while it has these included in the distro so you get them out of the box, it doesn’t seem they’re configured, and worse, the ax25 support doesn’t appear to work with Direwolf.

Here’s a few notes of my experimenting:

Direwolf uses a direwolf.conf file in your home directory which you customize with your callsign and setup to connect with your soundcard input and output. There doesn’t seem to be a copy of this file anywhere on the filesystem. The file is usually created if you’re building/installing from source by running ‘make install-conf’. I searched my fresh Debian install and couldn’t find a copy of direwolf.conf anywhere, so already being familiar with Direwolf, I decided to uninstall the pre-installed version (apt-get remove direwolf) and build/install from source unstead. See my previous notes on how to do this.

Immediately ran into the libasound library missing:

/usr/bin/ld: cannot find -lasound
 collect2: error: ld returned 1 exit status
 Makefile.linux:257: recipe for target 'fsk_fast_filter.h' failed
 make: *** [fsk_fast_filter.h] Error 1

This is fixed by installing libasound:

apt-get install libasound2-dev


Edit /etc/ax25/axports and add a line like this:
1 YOURCALL-1 1200 255 2 2m packet

Starting up direwolf for the first time:

 kev@kh-debian:/etc/ax25$ direwolf -t 0 -p
 Dire Wolf version 1.3

Reading config file /home/kev/direwolf.conf
 Audio device for both receive and transmit: default (channel 0)
 Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, E+, 44100 sample rate.
 ERROR can't open device /dev/ttyUSB0 for channel 0 PTT control.
 Permission denied
 Note: PTT not configured for channel 0. (Ignore this if using VOX.)
 Ready to accept KISS client application on port 8001 ...
 Ready to accept AGW client application 0 on port 8000 ...
 Virtual KISS TNC is available on /dev/pts/1
 WARNING - Dire Wolf will hang eventually if nothing is reading from it.
 Created symlink /tmp/kisstnc -> /dev/pts/1

Looks like /dev/ttyUSB0 cannot be opened for my PTT on my Rigblaster Plug n Play.

Following instructions from here, as root, I did:

usermod -a -G dialout kev

and then logged out and logged back in again. That fixed that issue.

The input volume was low, so I bumped up the mic slider in the top right to about half way, and now the input volume is better:

KG6SJT-10 audio level = 43(20/19) [NONE] |||||||__
 [0.3] KG6SJT-10>ID:Network Node (YCARES)
 Unknown message type N, motorcycle


Next up, starting Direwolf and then starting up my ax25 stack with kissattach and mkiss (which I’ve covered before here), I was getting a Permission Denied error:

kev@kh-debian:~$ sudo kissattach /dev/ptmx 1
AX.25 port 1 bound to device ax0
Awaiting client connects on

Followed by:

kev@kh-debian:~$ sudo mkiss /tmp/kisstnc /dev/pts/4
 mkiss: open: Permission denied

I posted a question about this on the Direwolf group on Yahoo Groups here. Since it looks like mkiss is getting permission denied accessing /tmp/kisstnc from Direwolf, I started Direwolf with a sudo and this avoided this error. Direwolf shouldn’t need to run with sudo permissions so something’s not quite right, but this did allow me to get up and running, and then I could ‘axcall 1 kberr’ to make a connection to nearest packet node.

To get to this point I could have installed a vanilla version of Debian, Direwolf from source, and ax25, and I probably would have got to the same point in about the same about of time, but when I have time I’ll take a look at the other apps that get preinstalled.

Tuning Direwolf packet parameters for use with HT radios

Direwolf has a  number of tuneable properties – by default after installing and configuring the basics, your callsign etc, it normally ‘just works’. I’ve been experimenting setting up Direwolf and PiLinBPQ as a BBS on a Raspberry Pi, and using axcall or LinPac on another Pi with Direwolf to call into the BBS. I have a Rigblaster and Yaesu FT60 HT on one Pi, and a SignaLink and Wouxun HT on the other radio.

The problem I ran into was that either Pi seems to work ok to call into a Packet node nearby, but calling from one Pi to the other was pretty unreliable in terms of not decoding packets, and the number of retries before a packet would get received and decoded. I tried a number of options, and feedback in the Yahoo Groups Direwolf group give me some suggestions to try. The tuning parameters are all covered in the excellent Direwolf docs.

Possible problems with using HTs for packet could include a combination of these factors:

  • Receive audio too loud into Direwolf (aim for around 50)
  • Receive audio not loud enough – adjust soundcard volume (Rigblaster/Signalink) and alsamixer levels
  • The radio doesn’t transition quick enough between transmit and receive (can be fixed by adding DWAIT)
  • Latency from the soundcard audio either in receive or transmit – can be fixed by adding TXDELAY for delay at the start of the transmission, and/or TXTAIL for a delay at the end

The settings I finally wound up with on both Pis that worked for me are: