1. Basic setup

This page will describe how to set up a basic packet radio system on a Linux distribution. The procedure described on this page is the same for both a node (server) as well as the client. For the node I use a Rasbperry Pi 4 with an interface that uses the GPIO pins to trigger PTT and a USB soundcard. As a client I already have my TS-2000 setup with audio I/O and PTT, so only the Linux system that controls it needs to be modified. Here I will describe how to setup a RPi node step-by-step. You can skip step 0-10 if you already have a working Linux system, e.g. desktop computer.

 

0) Install a base system

Download a Raspberry Pi minimal distro and burn it to an SD disc. No desktop is needed and setting up and configuring can be done via ssh later on. For the first setup a monitor and keyboard hooked up to the RPi is necessary.

 

1) After booting login as user "pi" with password "raspberry", then create new user

sudo adduser hans
sudo usermod -a -G audio,dialout,gpio,sudo,video hans

These groups are needed for:
- "audio" (allow users to access the soundcard)
- "dialout" (allow serial port access - if needed)
- "gpio" (allow access to the GPIO pins)
- "sudo" (allow root access)
- "video" group (allow diagnostic permissions to the GPU)

 

2) Delete user pi for safety reasons

sudo userdel -r pi (--> deluser)

 

3) Do an initial setup

sudo raspi-config

Setup ssh ---------------------------> this needs to be modified

Network Options:
- Hostname --> "packetnode"
- Network interface names --> Enable Predictable Network interface names --> NO

Boot options --> "Console"

Localization options:
- Locale --> unselect "en_GB.UTF-8 UTF-8" --> select "en_US.UTF-8 UTF-8" --> when prompted select en_US.UTF-8
- Timezone --> Asia/Taipei
- Keyboard --> Generic 101
- WLAN country --> Taiwan

 

4) Setup a static IP address

sudo vim /etc/dhcpcd.conf --> add the following lines:  
   
interface wlan0
static ip_address=192.168.0.131/24
static routers=192.168.0.2
static domain_name_servers=192.168.0.2

 

5) Disable ip_v6

sudo nano /etc/sysctl.conf --> add the following lines to the end of the file
   
#Modified
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

 

Now reboot the system and you can either login via ssh using the fixed IP address or the keyboard/monitor connected to the RPi.
   

6) Remove some unwanted services

sudo dpkg -r avahi-daemon libnss-mdns

 

7) Remove some unwanted stuff

sudo systemctl disable nfs-client.target
sudo apt autoremove

 

8) Disable the bluetooth interface

nano /boot/config.txt --> add the following to the end: dtoverlay=pi3-disable-bt

sudo systemctl disable hciuart.service
sudo systemctl disable bluealsa.service
sudo systemctl disable bluetooth.service

 

9) Update the RPi firmware on the dedicated EEPROM:

sudo apt install rpi-eeprom
sudo rpi-eeprom-update --> This will tell you if you need to do any updates or not
sudo rpi-eeprom-update -a --> If you do need to do an update, run this.

 

10) Update the systemctl

sudo apt autoremove
sudo apt update && sudo apt upgrade

 

11) Install some packages used for compiling software

sudo apt install build-essential autoconf automake libtool checkinstall git mc

 

12) Install the main ax.25 components. Ax.25 is the data link layer sitting on top of the hardware layer (ref. OSI)

sudo apt install libax25 ax25-apps ax25-tools

 

13) Compile and install Direwolf, the modem/TNC stack. ---------------------------------> this needs better wording

sudo apt install cmake libasound2-dev libudev-dev
git clone https://github.com/wb2osz/direwolf.git
cd direwolf
mkdir build && cd build
cmake ..
make -j4
sudo make install

 

14) RPi GPIO pins for PTT/DCD/Shutdown button

If you don't use the GPIO pins for PTT, DCD then just skip this part. It is simply a reminder of how things are connected to the RPi, and necessary for writing a working Direwolf configuration file.

Rpi pin37 (Broadcom GPIO 26) --> connect this to the PTT circuit
Rpi pin33 (Broadcom GPIO 13) -->  connect this to the DCD LED
Rpi pin18 (Broadcom GPIO 24) --> connect to 10k resistor, then one side of a momentary switch for a Pi Shutdown button
Rpi pin20 GND

 

15) Create a Direwolf config file in your home directory. This is my version

#############################################################
#               FIRST AUDIO DEVICE PROPERTIES               #
#               (Channel 0 + 1 if in stereo)                #
#############################################################

ARATE 48000
ADEVICE plughw:2,0
ACHANNELS 1

CHANNEL 0

MYCALL BX2ABT
MODEM 1200
FULLDUP OFF
PTT GPIO 26
DCD GPIO 13
AGWPORT 8000
KISSPORT 8001

#############################################################
#           FIXED POSITION BEACONING PROPERTIES              #
#############################################################

PBEACON delay=0 every=30 overlay=S symbol="digi" lat=24^53.25N long=121^16.13E power=10 height=180 gain=0 comment=" Packet BBS de BX2ABT"
CBEACON dest="MORSE-6" info="Packet BBS de BX2ABT"

 

16) Modify /etc/ax25/axports

sudo nano /etc/ax25/axports

add the following line: vhfout    BX2ABT-1    19200    255    4    144.620 MHz (1200  bps)

From the man page:

axports  is an ASCII file that contains information about each of the physical AX.25 ports that are to be used.  When dealing with an AX.25 utility such as call, it takes an argument that is the port name.  This port name is a reference to the line within axports, which has that name as its first argument.  The information on each line contains enough information to bind the command to a particular physical AX.25 interface, this binding is done by matching the callsign on the line in axports with the callsign of the port set by kissattach.

name: is the unique identifier of the port.  This is the name given as the port argument of many of the AX.25 support programs.

callsign: the call sign of the physical interface to bind to. The SSID needs to be unique for internal routing. Applications will not use this SSID, unless you assign them to an application in another config file.

speed: This is the DTE or "Data terminal equipment" speed. In my case I use Direwolf, so this is an emulated port, but speed still matters, e.g. when using compression.

paclen: is the default maximum packet size for this interface. For pure ax.25 this is 255

window: the default window size for this interface.

description: a free format description of this interface, this field extends to the end of the line.

 

16) Testing for output

sudo direwolf -c direwolf-packet.conf -p -t 0 &
sudo kissattach /tmp/kisstnc vhfdrop 0.0.0.0
sudo kissparms -c 1 -p 1

beacon -s -c bx2abt-8 bx2abt-1 vhfout "Hello World"

Use another setup to check if the beacons are sent out correctly, e.g. use an SDR in combination with GQRX and its build-in AFSK1200 decoder.

 

17) A good idea to backup the SD card now so you don't have to worry when you mess up in the future.

sudo fdisk -l
sudo dd bs=4M if=/dev/sdc of=rpi-packet01.img

 

18) Connecting to another station

If you have two setups or you know of a local packet node you can now connect to another station.

axcall vhfout BX2ABT

Axcall is the program you use to connect to another station, then the name of your radio interface, in my case vhfout for the only interface, then the call sign of the station you want to connect to.

To end the connection hold down the Ctrl-key and then tap ] . You will get a menu from where you can end the connection.

Alternatively use the axctl program.

axctl vhfdrop BX2ABT BX2ABT-8

If you are not sure to which node you are connected use the netstat command.

netstat -a -A ax25