Doing Packet Radio With Linux

By Nico ZS6OI - 5 March 2009

If you want to have a packet radio station running completely on Linux this document is for you. This will not show you how to set up FBB but rather how to set up software on Debian Linux in order to receive FBB unproto headers, automatically download personal mail , bulletins and how to access these downloaded files using Linpac. We will use a soundcard as the modem. Maybe it is a good idea to put an extra soundcard in your PC. A cheap one will do. Do this before you install Linux, its just easier.

There are a lot of AX25 how-to documents on the Net but they are either outdated or incomplete as far as FBB interfacing is concerned.

Core system requirements may be anything from and upwards from a Pentium 3 with 256 MB RAM.

I will assume you installed Debian Linux 5 codename “Lenny”. Look at www.debian.com The kernel that installs with Debian is already set up for ax25 packet. There is no need to recompile it. When you install Debian, install everything except the “laptop” and the “mail server” option. Except of course if you really want it. Recent Ubuntu or Knoppix distributions should also work but the menus may look different.

TIP: For our purpose only the first  Debian DVD image is needed for installation and packet radio. Not sure how many of the smaller CD images are needed. One can guess at least the first 5 of them. If you have an Internet connection additional software can also be downloaded on the fly without the need of  big CD or DVD images.

I will also assume you have your radio connected to your PC's soundcard and the PC com port connected via the needed interface (see below) for the PTT.

Use “Synaptic Package Manager” - found under menu – System/Administration to install the following packages from the “Amateur Radio” section within the package manager.

ax25-apps , ax25mail-utils , ax25spyd , ax25-tools , ax25-xtools , soundmodem

If you do not have a “Amateur Radio” section make sure you added all your installation DVDs/CDs under the “Settings/Repositories” and then “third-party” tab of the package manager.

 

Close the package manager when finished.

 

Before we go on to Linpac lets get the ax25 part working.

First we must specify our ax25 port. With our simple setup we will only use 1 port with 1 radio. Open a Terminal window – Applications/Accessories/Terminal

At the prompt type: “sudo gedit /etc/ax25/axports “ - without the quotes and press enter . If you are asked for a password it will be that of the "root" user. Also known as the superuser. If you get a message saying that you are not in the sudoers file then open a "Root Terminal" window and type "gedit /etc/sudoer" . You will find a line like "root = ALL (ALL) ALL" Below this line create an identical line but with your username in the place of "root". Save the file and close the "Root Terminal". Also close the "Terminal" window you have been using. Open a new "Terminal" window.

Now back to the "axports" file. Edit and put your own call sign in so it looks like this below. Please note that all the lines beginning with a # is just a comment. This is true for all the config files.

 

# /etc/ax25/axports

#

# The format of this file is:

#

# name callsign speed paclen window description

#

sm0     ZS6OI           38400   255     2       438.025 MHz (1200  bps)

#sm1    ZR6AFJ          38400   255     2       old callsign

#2      OH2BNS-9        38400   255     7       TNOS/Linux  (38400 bps)

#end of file

To set up soundmodem look at this site: http://www.qbjnet.com/packet.html – Look at the paragraph “Using the Linux Soundmodem user space driver with kernel AX.25” Leave the IP addresses to their default values. Do not use any scripts described there, we will do our own.

After the configuration you can type “sudo soundmodem”

You should see the traffic on the channel listed on your screen. To stop it type “ctrl-c”. If the soundmodem starts transmitting a long string of “garbage” you must do the following to stop it.

First stop the soundmodem by typing “ctrl-c”.

Type “ ps -e | grep avahi” - this will show something like this:

 2158 ?        00:00:00 avahi-daemon

 2159 ?        00:00:00 avahi-daemon

Now type “sudo kill -9 2158” and “sudo kill -9 2159” - replacing the PID numbers with what you have.

To stop avahi from loading on next reboot do the following: From the “System” menu at the top of the desktop go to “Administration/Services”. Look for “Multicast DNS service discovery” and uncheck it. Say yes and click the “close” button.

You can also prevent avahi from starting by editing /etc/default/avahi-daemon.

The other process that might try to transmit on our ax25 port is the samba server. You do not want to kill it because it may be useful. In the web browser type this address: http://127.0.0.1:901/  Username will be “root” and password is whatever you set it to.

Click on the “Globals” button.

Then select “Advanced” on the next page and click the “Advanced” button.

In the “Base options” section type “eth0” in the “interface” field. If you have a wireless LAN type “wlan0” in this field. Without the quotes.

The next option is “bind interfaces only” - set that to “yes”.

Click on the “Commit Changes” button at the top.

Then click on the “Status” icon at the top. Click on the “Restart All” button on the next page.

After all of this your radio should not transmit when you start soundmodem.

You can try to connect to another station. Start soundmodem and open another terminal window.  In this new window type something like: “axcall sm0 zs0dld-8” On some Linux distros you must use “call” instead of “axcall”. In yet another terminal window you can type “sudo axlisten” to see all the ax25 traffic. If axlisten does not exist try listen.

If axcall does not get you anywhere you can type “ctrl-c” to abort.

You can follow the rest of this guide if you are able to connect to another station. If you are not able to do so please use Goolge to find possible solutions.

To do the automatic operation with FBB we must configure the ax25mail-utils. The configuration files for these utilities are not installed with the above process so we will create them.

Type “sudo gedit /etc/ax25/ulistd.conf” Paste the following into this file. Change the call signs to something that is relevant to your environment. Click the “save” button when you are done and close the editor.

# /etc/ax25/ulistd.conf

#

# ulistd Configuration File.

#

# List of BBS parametres, one line for each BBS

# <resp_time> <wait_time> <port> <callsign>[-SSID] [<digi>] [<digi>] ...

#

# resp_time - how long to wait for a BBS response after sending the request

#             [seconds] (recommended 15)

#             When set to 0 ulistd will work in passive mode. In this case

#             the script /var/ax25/complete_agent is called each time

#             the hole in the list is detected.

#

# wait_time - how long to wait for next frame from BBS after receiving some

#             frames before sending next request

#             [seconds] (recommended 10)

#             In passive mode this is the minimal intervel between two calls

#             of the script.

#

#15 10 p1 OK0PBX

15 10 sm0 ZS0DLD ZS0DLD-8

 #End of file

 

Type “sudo gedit /etc/ax25/axgetmail.conf” Paste the following into this file: Change for your call sign , BBS call sign and path. Click the “save” button when you are done and close the editor. You will also notice that the personal mail directory is set to LinPac/mail. This directory should not exist on your system at the moment so let’s create it manually for now. Make sure you are in your home directory by typing “cd” and press enter . Now type: “mkdir LinPac” Then type “cd  LinPac” and then “mkdir mail”.

# /etc/ax25/axgetmail.conf

#

# axgetmail Configuration File.

#

# The home directory. Personal mail will be stored to

# $HOME/HOMEDIR/bbs_call for each callsign with aliased login

#

HOMEDIR LinPac/mail

#

# The callsign for downloading bulletins (including SSID)

#

BLTCALL ZS6OI-9

#

# The SSID that will be added to user's callsign for downloading personal mail

#

PERSSID 9

#

# The group name to be set to message files

#

MAILGROUP mail

#

# Download settings for each BBS in folowing format:

#

# [bbs callsign]

# <port> <callsign>[-SSID] [<digi>] ...

# List of bulletins (one line each).

# Bulletin examples:

# INFO   - all messages for 'INFO'

# ALL@WW - messages for 'ALL' forwarded worldwide

# ALL@   - messages for 'ALL' without forward specification

# @LOCAL - all local messages

# @      - all messages without forward specification

#

# Use '*pers*' for downloading

# personal messages.

#

[ZS0DLD]

sm0 ZS0DLD ZS0DLD-8

WX-ZAF

ZS-VHF

TECH

LINUX

*pers*

# End of file

Now for axgetlist configuration.

Type “sudo gedit /etc/ax25/axgetlist.conf”. Click the “save” button when you are done and close the editor.

# /etc/ax25/axgetlist.conf

#

# axgetlist Configuration File.

#

# This file consists of paragraphs - one for each BBS. Each paragraph

# starts with [callsign].

#

############################################################################

# Start of the first paragraph

[ZS0DLD]

#

# My callsign (you can specify the SSID too)

#

MYCALL ZS6OI-10

#

# BBS callsign, add the SSID and the digipeaters if any

#

BBSCALL ZS0DLD ZS0DLD-8

#

# AX.25 port for connecting BBS

#

BBSPORT sm0

#

#

# BBS commands

# ------------

# Commands for obtaining list of all new messages (separated by ';')

# CAUTION: The list must be sorted by message number by _ascending_ order

#          (in case of F6FBB BBS use the LR command)

#

#CMD_LIST lc *;lr

CMD_LIST lr

#

# Commands for obtaining list of messages starting from a particular message

# number (separated by ';'). The $ character will be replaced with the

# message number.

# CAUTION: The list must be sorted by message number by _ascending_ order

#          (in case of F6FBB BBS use the LR $- command)

#

#CMD_LIST_FROM lc *;lr $-

CMD_LIST_FROM lr $-

#

# Commands for disconnect

#

CMD_DISC bye

#

# List format specifiaction

# -------------------------

#

# Number of lines between the list command and the first message line.

# (length of the list header)

#

HEADER_LINES 3

#

# The order of fields in the list

# You can use folowing words to specify the meaning of each field:

# <NUM>    - message number

# <FLAG>   - message flags (bulletin/private, local ...)

# <SIZE>   - message size

# <TO>     - destination callsign

# <BBS>    - destination BBS

# <FROM>   - source (sender) callsign

# <DATE>   - date

# <TIME>   - time

# <SUBJ>   - subject

# <OTHER>  - other (not interesting) field

#

# You can use \nnn to skip to a fixed position <nnn> from the line begining

# (line begining has position 0)

#

FORMAT <NUM> <FLAGS> \12 <SIZE> <TO>@<BBS> <FROM> <DATE>/<TIME> <SUBJ>

#

# Date format

# (d = day, m = month (numerical), y = year, M - month in words (e.g. Jan))

# Example: yymmdd (e.g. 020125)

#      or: dd-MMM-yyyy (e.g 25-Jan-2002)

#

DATEFMT mmdd

#

# Names of months (when MMM is used above)

#

MONTH 1 Jan

MONTH 2 Feb

MONTH 3 Mar

MONTH 4 Apr

MONTH 5 May

MONTH 6 Jun

MONTH 7 Jul

MONTH 8 Aug

MONTH 9 Sep

MONTH 10 Oct

MONTH 11 Nov

MONTH 12 Dec

#

# Which position of the FLAGS string contains the B/P flag

# (usually the first one - 1)

#

BPFPOS 1

#

# End of the fist paragraph

############################################################################

# Start of second paragraph (this is an example only)

#[OK0PAB]

#MYCALL OK2JBG

#BBSCALL CZ0PIG OK0NMA

#BBSPORT kiss

#CMD_LIST lc *;lr

#CMD_LIST_FROM lc *;lr $-

#CMD_DISC b

#HEADER_LINES 3

#FORMAT <NUM> <FLAGS> <SIZE> <TO>@<BBS> <FROM> <DATE>/<TIME> <SUBJ>

#DATEFMT ddmm

#BPFPOS 1

#

# End of paragraph

############################################################################

# End of axgetlist.conf

 

We can also configure ax25d. This program runs in the background and will do things when somebody connects to your station. For more info type “man ax25d” or use Google. You can use “man” for all Linux commands.

Type “sudo gedit /etc/ax25/ax25d.conf” . The following is some example to start from. Change at least my call sign to yours. Best not to use SSID 0 to 8 because we will use those for LinPac. Click the “save” button when you are done and close the editor.

# /etc/ax25/ax25d.conf

#

# ax25d Configuration File.

#

# AX.25 Ports begin with a '['.

#

[ZS6OI-10 VIA sm0]

NOCALL   * * * * * *  L

default  * * * * * *  - root  /usr/sbin/ttylinkd        ttylinkd

#

[ZS6OI-11 VIA sm0]

NOCALL   * * * * * *  L

default  * * * * * *  - root  /usr/sbin/axspawn         axspawn %U +

#

#

[ZS6OI-12 VIA sm0]

NOCALL   * * * * * *  L

default  * * * * * *  -  root  /usr/sbin/node    node

 

[ZS6OI-13 VIA sm0]

NOCALL  * * * * * *     L

default * * * * * *     - root /usr/local/fbbforward/bin/fbbforward fbbforward STDIO %u

#End of File

 

Let’s do a script to start all our ax25 stuff.

Type “gedit ax25” and paste the following into that file. Change my call sign, name, town to yours then save it. Close the editor.

#!/bin/sh

soundmodem /etc/ax25/soundmodem.conf -R -M >/dev/null 2>/dev/null&

sleep 1

/usr/sbin/ax25d

/usr/sbin/mheardd

/usr/sbin/beacon -c ZS6OI -t 1 sm0 ZS6OI - Nico - Daspoort - Debian Linux

/usr/sbin/ulistd -c ZS6OI -l -g

#End of File

 

Make sure you have aborted the soundmodem that we have started previously.

Now type “./ax25” and press enter.

All the above will run in the background. To see if they are running type “ps -e | grep ax25” . To get more info about “ps” and “grep” you can use “man ps” and “man grep”.

The daemon program ax25spyd should also be running. If it is not running then add it to the end of file above: “/usr/sbin/ax25spyd”

You can do “sudo axlisten” to see the traffic.

 

Linpac installation and configuration.

The version of Linpac that comes with Debian 5 seems to be buggy.

Get the source fixed for Debian 5 here

 

You do not need the following but for the record.........

The home page is here: http://linpac.sourceforge.net/ The original source LinPac-0.17pre3.tar.gz This source will compile under Debian 4 but not under Debian 5. The reason being that some c++ rules got more strict. This source also contain a bug (undesired feature) causing the outgoing mail list to crash. I fixed these problems in the source shown above. I also changed some colours on the mail list so old guys , like myself , can read it. LOL

Get the documentation, and read it, from here: http://linpac.sourceforge.net/documentation.php

 

 

The compressed source should download to your home directory. On the Desktop: double-click on your “Home” icon. Now look for the downloaded file and double-click on it. A new window will open. Take the directory in that new window with your mouse and drag it back to your home directory window. This will extract the sources to your home directory..

From a Terminal window do “cd LinPac-0.17pre3_n1”

 

Before we can compile the source we need to have all the necessary tools and files installed.

Type “sudo aptitude install gcc g++ libncurses5-dev libax25-dev automake”

I hope I remembered all of them. If you get compilation errors let me know please.

Now type “./configure”

If there are no errors then do:

Type “make”

If you have no errors you can do the following:

Type “sudo make install”

 

Edit the following file for your configuration. Best only to change the call signs.

“gedit /home/username/LinPac/macro/init.mac” - save it.

Start linpac by typing “linpac” at the command prompt and hit enter.

Type in “:mail” for the mail application.

To get out of linpac type "alt-x" - did you read the docs? 

Read the Linpac documentation.

 

Known issues:

When in the mail list. If you marked some header for download on the mail list and you then press "d" to download it, do not exit the mail list by pressing "Q" immediately. Rather go back to linpac by using a "F-channel" key other than the channel where you started the mail program from.

 

Alternatives:

There is also a program called linamc. This program does not need ax25mail-utils. It downloads the message headers with the FBB "lr" command. Unfortunately it scrambled my list of headers when I tried it. Had to get the whole lot again.

The advantage of ax25mail-utils is that it runs in the background  getting the headers and messages  as they become available without linpac even running.

 

This is how linpac looks.......