On a more powerful hardware available (such as an Rpi-3/4 or a PC) it is possible to use direwolf as soft-modem instead of soundmodem. As the latter, direwolf implements the basic functions of a TNC Kiss, but it has also more powerful features if compared to the simpler soundmodem. It can operate as APRS GPS Tracker, Digipeater and Gateway with no additional software. It also has the ability to be used via TCP/IP, and not just through ax25 stack. The complete list of functions is available on the project’s GitHub page.
Direwolf is can be installed via apt-get, but being an active project, it is always preferable to download the sources and compile them by yourself, to use the most recent version.
Direwolf configuration file is a simple text file with a series of configuration instructions. This configuration is to use it just as TNC, that is equivalent to the one for soundmodem:
PTT GPIO 4 ACHANNELS 1 CHANNEL 0 MYCALL I8ZSE - 1 MODEM 1200
Direwolf supports various forms of PTT, all well documented in the manual. This one is to configure PTT for a Yaesu ft897 connected via CAT at 38400 bps:
PTT RIG 1023 /dev/ttyUSB0 38400
Direwolf has the ability to display a series of diagnostic information directly on stdout, and this is very useful for fine-tuning the configuration of the software. For this reason, I prefer to start it in an detatched terminal, so that it is always possible to read them if any need arises. To do it you need GNU screen, which if not already available in your system can be installed with apt-get install screen command. Screen is a terminal multiplexer, that is used to create terminals that operate in the background, even if the session from which they are launched is closed. It is possible to connect and disconnect that terminals at any time. So, to run direwolf I use this script:
echo "starting Direwolf..."
/usr/bin/screen -d -m -S direwolf /sbin/direwolf -p -c direwolf.conf -t 0
sleep 2
PTS=`ls -l /tmp/kisstnc | awk '{ print $11 }'`
/usr/sbin/kissattach $PTS ax0
# set kiss parameters
/usr/sbin/kissparms -c 1 -p ax0 -r 125 -t 250 -s 20 -f n -l 20
echo "... started"
On the second line /usr/bin/screen -d -m -S direwolf launches a new disconnected terminal named direwolf , and executes the command /usr/bin/direwolf -p -c direwolf.conf -t 0 in this new terminal, which launches direwolf loading direwolf.conf configuration file from current directory. Parameter -p instruct direwolf to create a pseudo-terminal for ax25 subsystem, while -t 0 disables text coloring.
Pseudo-terminal names are assigned dinamically, so direwold creates a symbolic link on /tmp/kisstnc to allow the code to identify it. On the fourth line device name is extracted from the link and assigned to PTS environment variable.
Just after kissattach connects this pseudo terminal to ax0 port, the one we had previously created; kissparms configure the timing parameters of afsk channel.
Direwolf can be run in user space, but requires the user to be allowed to manage audio devices (adding it to os group with same name). The user must be also allowed to use some commands with root privileges, and the simplest solution is to install direwolf as root and suid (chmod u+s) all required executables (direwolf, kissattach, kissparm, axlisten, axcall, etc).
Audio Levels
Both soundmodem and direwolf require an accurate setting of audio levels, both in transmission and reception. A first ‘coarse’ adjustment can be made using the interface trimmers, while a finer one can be done using alsa mixer, which can be recalled using alsamixer command :
Adjusting the transmission levels is quite simple, mainly because – even without a deviation meter – it is possible to listen to the modulation level on-the-air using a receiver. On rx side this can be tricky, but direwolf can help, since it reports audio level among all diagnostic informations, warning if it is too high or too low. So, even on slower raspberries it can be very useful to install it and use it just temporarily to fine tune input level. In this process it is advisable to disable automatic level control, if available, in order to have a more accurate result.
After configuring audio levels, remember to save them hitting alsactl store command. Otherwise settings will last till the first reboot.
To access detatched direwolf virtual terminal just run screen -r direwolf. To disconnect the terminal, keeping it operational in the background, just type in succession on the keyboard CTRL-a and then d.
Modem
Ax-25 protocol does not provide specifications about the type of modem to be used for connections. The most popular modulation used in VHF/UHF is afsk, with two tones at 1200 and 2200Hz. This was based on characteristics of the original TAPR TNC-2, based an AM7910 modem chip, non specifically designed for use in radio. The two tones are in fact defined in BELL202 standard, designed for telephone modems between 70s and 80s. It is today an inefficient and obsolete technology, and still using it today is definitely anachronistic, considering the development that modems have had in these decades.
Over time, various solutions has been designed to overcome this limitation. The most known is G3RUH, 9600bps speed, originally designed for use via satellite, but then also adopted for terrestrial connections. SuperVozelj, a multichannel node with high speed (38kbaud), has had a good diffusion in our area. Generally these are solutions that require a bandwidth that exceeds the one allocated to the voice, and – therefore – need dedicated hardware. Another way is use more advanced modulation technologies, that make it possible to better use all available audio bandwidth (about 2.2kHz) and therefore reach higher speeds using standard radio equipments. On the other hand, from my point of view for amateur radio use, speed is a secondary parameter, really useful only in emergency communications.
Direwolf has a specific document about the characteristics of supported kinds of modem, and also supports fx25 , an extension of the x25 protocol that implements forward error correction, a method of prevent transmission errors based on information redundancy. Even soundmodem has an interesting mode, newqps or Q15X25 , designed for use over HF, and that allows to break the speed ‘barrier’ of ancient Bell standards.
These are all areas of experimentation: staying anchored to the TNC-2 mode is extremely limiting.
Test
Once the levels have been adjusted, it is time to test our system. To do this there is a valuable tool: Stephen’s Test CD , done by WA8LMF, which contains radio traffic record in Los Angeles area, that can be used as a ‘source’, to test the decoding capability of our chain. For decode the signals linux has a special command, axlisten , which displays every message received on console. axcall it the command used to establish a connection with another packet radio station and, therefore, test the transmitting chain.
At this point packet radio layer of our raspberry is ready and running, and it is possible to install the applications.
I currently have two installed on my node.
LinFBB
F6FBB is a well known BBS application, incidentally it is the same – with minimal adjustments – that I used on my BBS packet in the first half of the 80’s. LinFBB is the porting for Linux. This one too can be installed via apt-get or compiling sources: the same considerations made just before for Direwolf apply. Fbb has many documents about its configuration over the internet. I want just to show my port.sys file, that is generally a bit cryptic. This file can be found in /etc/ax25/fbb/port.sys, or /usr/local/etc/fbb/port.sys:
I launch LinFBB in the boot process via /etc/rc.local, which in my case is:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. ## regen ssh keys on first boot [ -f /etc/ssh/ssh_host_rsa_key.pub ] || ssh-keygen -A /usr/sbin/soundmodem & sleep 5 /sbin/xfbbd -s -a -l /var/log/xfbbd.log & /usr/sbin/mheardd & exit 0
LinFBB runs in background, to access it you can connect the console with the command xfbbC -c -i <callsign>. Client connects to server via TCP on port 3386.
DxSpider beacon
On my node I have activated also a specialized beacon, to display spots that hamdley by DxCluster network, and more specifically my node dxcluster.i8zse.eu . For this purpose I wrote a small application. Beacon is normally inactive, but waiting for a command sent via a UI packet. The recognized commands are two: DXCLUSTER HELP, which sends an hot-to-use message, and DXCLUSTER <filter> that allows to set mode and band filters, starting at the same time beacon operations. Beacon for a predefined amount of time (currently 10 minutes) sends via UI all the spots that satisfy selected filters. After that time and in the absence of new commands, the beacon stops operations.
The software is downloadable from my github account.
Part 3