Raspberry Pi Winlink client over 2m VHF using Pat/wlk2-go + Direwolf + ax25 (not working yet)

Some rough notes on getting this combination working. This is my first attempt in getting the Pat / wlk2-go Winlink client working on a Raspberry Pi. I’m using:

  • Direwolf as a packet soundcard modem
  • ax25 as the connection between the Pat Winlink client and Direwolf
  • a Rigblaster Advantage, as a USB soundcard interface between the Raspberry Pi and a 2m transceiver (an Icom ID-880H)

I already have Direwolf and ax25 networking configured from using my Pi as a Packet radio client (search for my previous blog posts on Direwolf and you’ll find my notes for installing and configuring). Following the instructions in the Pat wiki here, I added a new ax25 interface as a new line to the end of my /etc/ax25/axports files:

wl2k KK6DCT 0 255 7 2m winlink

The wl2k alias for the new port I think is the default that Pat looks for to connect.

Note: I already have Direwolf configured with a 1200 port for VHF packet so I reused this as my first test, but if you configure a 300 port for HF and then connect the Rigblaster to an HF radio, I think the setup will be much the same (I haven’t tried this yet, but this will be my next test).

Next I installed golang on the pi with:

sudo apt-get install golang

and then installed Pat with:

go get github.com/la5nta/pat

go get failed initially with $GOPATH not set. So I created go-workspace in my home dir, and then did

export GOPATH="$HOME/goworkspace"

and added this export to my .bashrc so it will be set next time I log on too.

Now the go get started downloading to goworkspace, but it seemed to hang before it completed. Alternatively, you can download a prebuild .deb file from the Pat github releases page and install with (I used this approach instead):

sudo dpkg -i pat_0.1.5_linux_armhf.deb

pat configure – opens an editor for the config file. I added my callsign in mycall, my winlink password.

To add an alias in the configuration for a connection via ax25, I added a connection to KG6SJT-10, which is my closes Winlink gateway on 2m:

“connect_aliases”: {
“KG6SJT-10”: “ax25:///KG6SJT-10”,
“telnet”: “telnet://{mycall}:CMSTelnet@server.winlink.org:8772/wl2k”
}

pat http – starts the web interface

From the web gui at localhost:8080 you can select the Connect menu item, select the alias added in the config above, but this blew up Pat when I tried it. Time to log a ticket:

2016/09/07 00:20:53 Connecting to KG6SJT-10 (ax25)…
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x76f3d774]

runtime stack:
runtime.throw(0x5d0948, 0x2a)
/opt/go/src/runtime/panic.go:547 +0x78
runtime.sigpanic()
/opt/go/src/runtime/sigpanic_unix.go:12 +0x44

goroutine 53 [syscall, locked to thread]:
runtime.cgocall(0x457ff0, 0x10c6b7e4, 0x0)
/opt/go/src/runtime/cgocall.go:123 +0x11c fp=0x10c6b7c4 sp=0x10c6b7ac
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25._Cfunc_ax25_aton_entry(0x0, 0x10ed00b0, 0x0)
??:0 +0x38 fp=0x10c6b7e0 sp=0x10c6b7c4
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25.(*ax25Addr).setPort(0x10ed00a0, 0x10b5a250, 0x4, 0x0, 0x0)
/home/martinhpedersen/go/src/github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25/ax25_linux.go:361 +0x64 fp=0x10c6b7f0 sp=0x10c6b7e0
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25.DialAX25Timeout(0x10b5a250, 0x4, 0x10b5a158, 0x6, 0x10d107cd, 0x9, 0x7a358200, 0xa, 0xcb8e4, 0x0, …)
/home/martinhpedersen/go/src/github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25/ax25_linux.go:136 +0x16c fp=0x10c6b984 sp=0x10c6b7f0
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25.Dialer.DialURL(0x7a358200, 0xa, 0x10d108d0, 0x0, 0x0, 0x0, 0x0)
/home/martinhpedersen/go/src/github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25/ax25.go:114 +0x278 fp=0x10c6ba8c sp=0x10c6b984
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/ax25.(*Dialer).DialURL(0x7c39f8, 0x10d108d0, 0x0, 0x0, 0x0, 0x0)
<autogenerated>:1 +0xb8 fp=0x10c6baac sp=0x10c6ba8c
github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport.DialURL(0x10d108d0, 0x0, 0x0, 0x0, 0x0)
/home/martinhpedersen/go/src/github.com/la5nta/pat/vendor/github.com/la5nta/wl2k-go/transport/dial.go:29 +0xbc fp=0x10c6bad4 sp=0x10c6baac
main.Connect(0x10d107c5, 0x11, 0x0)
/home/martinhpedersen/go/src/github.com/la5nta/pat/connect.go:108 +0x7b4 fp=0x10c6bc5c sp=0x10c6bad4
main.ConnectHandler(0x76457918, 0x10c1b200, 0x10bf8230)
/home/martinhpedersen/go/src/github.com/la5nta/pat/http.go:357 +0x68 fp=0x10c6bca8 sp=0x10c6bc5c
net/http.HandlerFunc.ServeHTTP(0x6208b4, 0x76457918, 0x10c1b200, 0x10bf8230)
/opt/go/src/net/http/server.go:1618 +0x34 fp=0x10c6bcb8 sp=0x10c6bca8
github.com/la5nta/pat/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0x10a114a0, 0x76457918, 0x10c1b200, 0x10bf8230)
/home/martinhpedersen/go/src/github.com/la5nta/pat/vendor/github.com/gorilla/mux/mux.go:107 +0x250 fp=0x10c6bd44 sp=0x10c6bcb8
net/http.(*ServeMux).ServeHTTP(0x10a0ea80, 0x76457918, 0x10c1b200, 0x10bf8230)
/opt/go/src/net/http/server.go:1910 +0x164 fp=0x10c6bd70 sp=0x10c6bd44
net/http.serverHandler.ServeHTTP(0x10a75680, 0x76457918, 0x10c1b200, 0x10bf8230)
/opt/go/src/net/http/server.go:2081 +0x190 fp=0x10c6bda0 sp=0x10c6bd70
net/http.(*conn).serve(0x10b841c0)
/opt/go/src/net/http/server.go:1472 +0xee4 fp=0x10c6bfcc sp=0x10c6bda0
runtime.goexit()
/opt/go/src/runtime/asm_arm.s:990 +0x4 fp=0x10c6bfcc sp=0x10c6bfcc
created by net/http.(*Server).Serve
/opt/go/src/net/http/server.go:2137 +0x3bc

Raspberry Pi with Adafruit PiTFT screen

Just followed the steps in the tutorial to get the modified kernel installed with support for Adafruit’s PiTFT and it all worked great.

What I’m going to be using it for is to monitor status output from Direwolf as it receives/sends packets, so will be running it in text mode, and ideally I want to get Direwolf and LinBPQ starting together at boot, and outputing to the console.

I’ve almost got the startup script working (following suggestions here), but I might take a look to see if I can redirect output to one of the virtual terminals and have that output to the screen (like discussed here). Some more things to take a look at 🙂

fbtext – this might be useful too.

Linbpq: configure via web page before bbs and chat apps start

It’s not immediately obvious from the docs, but after installing and creating a bpq32.cfg file for pilinbpq BPQ32 on the Pi (or Linux in general probably), after you’ve started pilinbpq running, you need to hit the admin web pages to configure the last few params before the services are accessible.

For example, if you telnet into your node locally and then type bbs or chat, you’ll see the error: “bbs application is not running”.

Hit the admin web pages for both bbs and chat, and complete the blank fields in the config. For me these where the applicationID and Streams values. The Id matches the id value of the app in the bpq32.cfg file. Streams is I think number of concurrent clients. Save values, restart, and you should be good.

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!