INTRODUCTION : the goal of this project is to provide a Raspberry Pi Linux system with a few AX.25 packet radio applications already installed in order to save Sysops a lot of time searching for, installing and configuring the packages. There are absolutely no special patch of the original Rasbian distro nor any application changes. All the software included are unmodified. However, having them pre installed makes things easier.

    LEGAL CONSIDERATION:
Using the preconfigured callsign F6XYZ for long term BBS, DX Spider or any other application
IS NOT ALLOWED !
It has been only set for preconfiguration of this distro.
You must change all F6XYZ callsigns as explained below before using this distro on
hamradio frequencies (HF, VHF, UHF...) or Internet.
New SD card image is still based on Wheezy distro. However 117 packages have been upgraded; firmware, raspi-config and applications have been updated. It will run on RaspBerry Pi models RPiv1, RPiv2 and RPiv3. 
This new RaspBian AX.25 distro replaces the one previously released in July 2014.
Firmware and kernel are 4.1.17 #843 Mon Feb 15 GMT 2016 ;

ATTENTION ! While Linux kernel AX.25 fatal issue that appeared in kernel 4.4.15 version has been finaly corrected there is still some bug that prevent AX.25 from disconnecting and accepting new connections.
See instructions at the end of this page if you get some connection issues.
 
Application versions are :  xastir 2.0.7; Ve7fet libax25 ; FPAC 4.0.3; LinFBB 7.0.8;
Two compressed SD card images are available for download :
One is an SD card image to be uncompressed by rar (http://www.win-rar.com) or 7-zip (see below) : RPi_AX.25_4.1.17.img.tar.bz2 (size 1.5 GB)
Second SD card image is to be uncompressed by new Linux unxz utility :  RPi_AX.25_4.1.17.img.xz (size 1.2 GB)

To start downloading click on one of the above link. A dialog box should appear. "Enregistrer le fichier" circle should be selected then click onto OK.
  • Or if a full new page in french is opened, click on "Valider et télécharger le fichier" area.
  • Or you could see nothing when you click on the link ! If you click again on the file link, a window will open with a message telling that too much slots are open. This means that the file is actually already downloading silently in the background. So be very  patient and do not close your browser. After a certain time (up to more than 10 hours !), depending on your Internet link speed, you should find the file in your download directory (C:/download/Firefox for example).
  • See below how to compute checksum to be sure it is has not been corrupted during download.
  • It includes an image of Raspberry Pi linux system with pre installed AX.25 saved on compressed archives to be downloaded and copied on a 8GB SD card.
  • The whole included development tools, source and binary applications software files take around 40% of an 8GB SD card.
  • You may also send an 8 GB, SD or micro SD card, to F6BVP. It will be returned to you for free with configured RPi Linux AX.25 software installed.
Included Linux system comprises:
  • Last Linux kernel available per this documentation date.
  • However, upgrading facility included in your Raspbian system will allow you to always get latest kernel and packages versions.
  • Usual hamradio interface modules drivers : ax25, rose, mkiss, 6pack, bpqether, netrom
  • Several examples of device types are initialized in default script /etc/ax25/ax25-up. List obtained running "ifconfig" command.
  • Other scripts named ax25-up-xxxxxxx are available in /etc/ax25
  • AX.25 ports names are declared as usual in /etc/ax25/axports
List of working applications when booting:
  • F6FBB BBS version 7.0.8.
  • AX.25 packet radio switch FPAC node (NetRom and ROSE protocols).
  • aprslist (APRS beacon and repeater).
  • Dx spots relay DX Cluster
  • Web server lighthttpd (/var/www/index.lighttpd.html)
  • watchdog (RPi reboots in case of Linux kernel failure)
  • beacon (AX.25 radio beacons)
  • mheardd daemon (client is mheard)
  • dxget (DX spots broadcast on AX.25 ports)
  • ax25ipd for AX.25 frames encapsulation into UDP/TCP Internet protocols frames or reversely encapsulated IP frames stripped into AX.25 frames.
  • ax25d : daemon redirecting incoming frames from peripheral devices to appropriate application software depending on protocols and ports.
  • xastir. This is an APRS graphic application to be started from graphic user interface men. 
All communication applications are already configured for using a TNC-Pi connected on RaspBerry Pi I/O connector.
HOWTO copy image file onto SD card
If you do not have a Linux computer, use a Windows system:
Or if you have a computer with a Linux system :
  • Compute md5 checksum with command : md5sum  RPi_AX.25_4.1.17.img.xz
  • It should match this value : 13c18eeb1b2013c46c7f96cbec753a41 (MD5) , 3ca3463b838a6f6154fea837160813f9d099d89a (SHA1)
  • For copying SD disk image under Linux retrieve SD disk device name using command "fdisk -l"  (the letter is an L no an I). SD device can be example /dev/sdd
  • For image file extraction use command  unxz RPi_AX.25_4.1.17.img.xz
  • Copy image file on an 8 Go card using command line "dd if=RPi_AX.25_4.1.17.img of=/dev/sdx bs=1M" (x to be replaced by the last letter of your SD device as found before)
Raspberry Pi set up :
  • Connect a keyboard, a video screen or a TV set through an HDMI cable, plus a connection to your Local Area Network via an Ethernet cable.
  • Power up RPi  with a smartphone micro USB power supply (5V and 700 mA or better 1000 mA).
  • At Linux prompt log in with user "pi" and password "raspberry". Then enter supervisor account with command "sudo su".
  • If you don't have a QWERTY keyboard (US), use nano editor to make changes in file /etc/default/keyboard for selecting your keyboard country model. Distributed model configuration is US keyboard with keys arranged like QWERTY. For example, with french AZERTY keyboard letters A and Q are reversed and so are letters W and Z. Replace XKBLAYOUT="gb" with "fr" for french keyboard model. You may find a list of other available countries shortcuts in this file : /usr/share/X11/xkb/rules/xorg.lst.
  • Second file you want to edit for a different keyboard is /usr/share/console-setup/keyboard  where you can change XKBLAYOUT=us by =fr. There are no "" here !
  • After both files have been changed you nee to execute the following three commands :
# dpkg-reconfigure keyboard-configuration      (and answer the questions)
# dpkg-reconfigure console-setup                   (optionally)
# service keyboard-setup restart
  • Later, keyboard customization for graphic mode (startx command from console) may also have to be performed optionaly (not sure...). See here.
  • Reboot your RPi via command "reboot" to make the new keyboard operational, login as above and continue configuration where you stopped here.
  • Execute command "ifconfig eth0" and notice the RPi MAC code on the line with HW: like HWaddr B8:27:EB:9E:15:06 in the example. You will need it later.
  • remember temporary local address attributed to your RPi by your LAN or ADSL router. Local Inet Addr is like 192.168.0.xxx as in this example. It is not the broadcast address 192.168.0.255 !
At boot up /etc/init.d/ax25 script is starting automatically  /etc/ax25/ax25-up batch initializing device interfaces and starting BBS, FPAC node etc... applications.
  • FPAC node will initiate by default a connection with FPAC network through F6BVP as first neighbour node. It will be completed as soon as you communicate your Internet IP or symbolic address to F6BVP.
  • The BBS will also try to exchange message forwarding with F6BVP-1 BBS by default.
  • APRS beacon repeater is active (modify your Latitude/Longitude coordinates in /etc/ax25/aprslist.conf)
  • DX Cluster is active (your call must be customized too. See below). Local client can be started by issuing 'clu' command.
  • Your Rpi web server is on line (default web page is /var/www/index.html)
  • To stop AX.25 applications, run /etc/ax25/ax25-down script
  • To restart AX.25 /etc/init.d/ax25 start
  • Dxget application can broadcasts DX spots on an AX.25 port (start with /etc/ax25/rc.dxget or uncomment line in /etc/ax25/ax25-up)
For next configuration steps you better get supervisor priviledges.
  • If not already supervisor, switch to su account by issuing "sudo su" command to acquire Super User priviledges.
  • Distributed Linux system image has been reduced to shorten transmission time. It is only using a part of the SD card. This will be changed in next step.
  • It is highly recommanded to run now command raspi-config and select option 1 "Expand Filesystem" to expand root partition to fill 8Gb SD card.
  • You also want to change User Password, option 2, execute Internationalisation Options 3, run Advanced Option A2 Hostname, etc..
  • Reboot the RPi via command line "reboot"
  • Configure the following ports redirection on your router or ADSL modem to your RPi IP adress : 80, 6300, 7300, 8000, 10092. Those external and internal port numbers must be the same. The following port numbers, 21, 22, 23, should also be redirected but external ones may have different numbers for security reasons. For example, route 32222 external port to your local RPi Inet Addr address internal port 22.
  • To access your RPi via Local Area Networdk or remotely via Internet you can use telnet or better ssh (using more secure protocol than telnet) applications to connect your ADSL IP adress given by your Internet Access Provider (or your symbolic address like f6xyz.no-ip.org or f6xyz.ddns.net ).
  • From a PC running Windows you may use TeraTerm Pro Web 3.1.3 you can download from http://www.ayera.com/teraterm/  In Menu setup configure ssh2/authentification with username "pi". Then in Menu Setup TCPIP enter RPi local IP adress and select Add, then enter your ADSL IP address and enter Add again. Configure also Setup, Terminal to validate options "Term size = Win size" and "Auto switch (VT<->Tek)". Save configuration with Save Setup. In Menu File New connection select the host name or IP number, then the protocol (telnet or more secure ssh). When asked for the "pi user" password enter "raspberry". For security reasons, you want to change pi user password after loging in.
  • a free implementation of Telnet and SSH for Windows, along with an xterm terminal emulator.
  • From a Linux computer, telnet and ssh applications are directly available. They will let you remotely access your RaspBerry Pi.
  • You may boot Rpi without video monitor, keyboard or mouse. In fact you can power up and boot your Rpi when it is only connected to external world via an Ethernet cable and then leave it alone !
Once you logged into your Rpi, a number of command shortcut are available :
  • monitor -chat   (to display AX.25 traffic on all ports. Exit with <Enter> , "c" parameter is for optional use of colors)
    st            (shortcut for netstat --ax25)
    ne           (shortcut for netstat --netrom and --rose protocols)
    bbs          (opens a BBS console client)
    fpac         (script to start an fpacnode client with local callsign ( it must be changed once for all with your own replacing f6bvp call)
    px           (lists all applications in memory, shortcut for ps -ax )
    df -h        (displays SD disk used and available free space)
  • fbblog      (lists BBS journal of present week)
  • fpaclog    (lists FPAC starting log file)
  • listen -chat (to display AX.25 traffic on all ports. Exit with CTL+C)
  • ALT+F5     Opens terminal 5 displaying Dx Spider service message (not a client for Dx spider)
  • ALT+F6     Opens terminal 6 displaying packet radio traffic on AX.25 ports.
  • In SU mode the alias  
    ll              (stands for ls -la to list current directory files)
  • all above "batches" located in /usr/local/bin may thus be called from any current Linux directory.
Notice : as opposed to Windows, under Linux you have several virtual terminals at your disposal simultaneously. To open a command line terminal use two keys combinations : ALT+F1, ALT+F2, ..., ALT+F5. ALT+F7 returns to Graphic User Interface if it has been started with startx command.
When in GUI you can switch to a command line terminal via three keys combination  CTL+ALT+Fn key (n, terminal number between 1 and 5).
Most amateur radio applications do not use or need GUI that is more CPU power demanding anyway.
  • To acces the RPi through the network (Telnet or SSH protocol) :
  • From a Windows PC with Teraterm Pro with SSH2 user "fpacuser" in lieu of "pi" and password "fpac" you get remote acces to FPAC node.
  • The same from a Linux computer, ssh fpacuser@192.168.0.xxx -p 10092 or ssh fpacuser@<IP address> -p 10092  (+ password fpac)
  • From a Linux computer the command telnet <RPi IP address>  6300 gives you acces to the BBS.
  • With ssh you can have access to your local RPi with ssh <local RPi IP address> -p 22
  • Connect Dx spots server Spider remotely via command telnet <RPi IP address>  7300 and via a local terminal with telnet localhost 7300      
  • Using a web browser like Mozilla, connecting RPi IP address either local or Internet address opens RPi example web page located in /var/www/index.htm
  • If you need to transfer files to or from your Rpi, use FTP protocol with SSH. Linux command is sftp <pi@<your RPi IP> and enter password "raspberry".
  • It is now time to achieve customization of hamradio applications in your Linux system with your personal informations.
  • You need to open a supervisor session with command "sudo su". For security reasons supervisor password should be later changed via command "passwd".
  • Then you would need to edit a number of files listed in this page. Fortunately, changing callsigns may be achieved quickly and through a simple command line.
  • Enter into directory /etc/ax25 with cd /etc/ax25 and execute the following commands, replacing  in this example F6BVP or f6bvp by your callsign (F6XYZ and f6xyz are the original distribution callsigns that you want to replace entering the following commands):
  • grep -rl F6XYZ * | xargs sed -i 's/F6XYZ/F6BVP/g'
  • grep -rl f6xyz * | xargs sed -i 's/f6xyz/f6bvp/g'
  • Last above command should be executed again after changing directory  cd /usr/local/bin
  • The same command should also be executed again after changing directory  cd /spider/connect
  • To customize other parameters in /etc/ax25/ *.conf files there is a simple editor : nano. For example "nano /etc/ax25/fbb.conf"
  • Another available editor is vim.tiny (more sophisticated).

HOW TO UPDATE AX.25 libraries, apps, tools and FPAC on your Raspbian system:
  • When this distro will be getting outdated by a month or so, or if you see messages on different lists saying that there are new versions for AX.25 code, FPAC or LinFBB then it is wise to update Linux itself with commands apt-get update and apt-get upgrade (answer Yes when asked for permission and be very patient).
  • Just to be sure that necessary development tools and other utilities have been already installed, execute the following command : 
apt-get install dh-autoreconf libncurses5-dev gftp host watchdog chkconfig
FPAC CONFIGURATION:
For your convenience the command source fpacdir is a shortcut for changing directory to fpac source directory. If you need to know your country DNIC number, check the complete list of DNIC countries numbers etc/itu.dnic in FPAC source directory.
- In file /etc/ax25/fpac.conf do not change FPAC SSID -8 and -9 as they are standard for FPAC nodes.
   
Change DNIC parameter with the one of your country (i.e. 3100 for USA).
   
Change Address = 194501 with your own 6 figures address. It may be inspired by your phone area number. Do not keep default Address (194501).

- Command fpac is used to start a local client (fpacnode) using the callsign written in the script. Please edit script /usr/local/bin/fpac and replace "f6bvp" with your own callsign ! Another script fpac.sh is used to initialize FPAC server. When started, it deletes fpaclog file in order to keep minimum space used on SD card. To read fpac log you may use fpaclog command.

  Check that Inetport number is the same as Socket udp in /etc/ax25/ax25ipd.conf. In the distribution it is 10092 and should not be changed  !
- Send a mail to F6BVP
and to your future adjacent node station Sysops to give your IP address (or symbolic address like f6xyz.org), your L2 and L3 callsigns and your ROSE address comprising DNIC number and rose Address with its 6 figures. This is mandatory in order to let your FPAC node and F6BVP nodes synchonize together.
- File /etc/ax25/fpac.nodes configures informations about neighbour FPAC nodes that will be directly connected to your node.
-
File /etc/ax25/ax25ipd.conf configures routes to IP address (or symbolic address) toward your adjacent nodes.

NetRom protocole configuration for Node, BBS and DX Cluster:
- In addition to native ROSE protocole, FPAC can use NetRom protocole. In /etc/ax25 directory there are files for configuring your node, cluster and BBS NetRom callsigns and alias.
Edit /etc/ax25/nrports files in order to set your own alias. For example, supposing your callsign is W4AAA replace XYZNET with AAANET, XYZBBS with AAABBS, XYZCLU with AAACLU.
Otherwise, same default alias will appear on NetRom tables for different callsigns, breaking down routing protocole.
- It is recommanded that NetRom callsigns for BBS should have no SSID, i.e. equivalent to SSID zero. This will help FPAC to choose the protocole you want to use based on callsign to connect. This NetRom BBS callsign setting without SSID is independant from AX.25 BBS callsign that must have an SSID different from zero, usually -1.
- /etc/ax25/nrbroadcast should be edited in order to reflect AX.25 device you want to use for broadcasting NetRom tables.
- File ax25d.conf should include NetRom ports entries to redirect NetRom frames to FPAC node.
- ax25d.conf should also include a NetRom port entry for Dx cluster Spider client.

BBS CONFIGURATION:
-
Don't forget to customize your Callsign and password in /etc/ax25/bbs/passwd.sys and /usr/local/bin/bbs local BBS client connect script.
- Send a mail to F6BVP
giving your BBS callsign-ssid,  IP address or symbolic address and telnet external port number routed to port 6300 (usually 6300, may be 23 in some cases when your BBS is behind a gateway not accepting port 6300 redirection...)
-
A quick way to go into FBB source directory is provided by command source fbbdir


Spider DX cluster CONFIGURATION:
- Log into your Raspberry Pi using sysop login.
- Customize cluster /spider/local/DXVars.pm). Keep callsigns in capital letters as requested. Preferably do not change Cluster SSID -3 (standard).
- After editing your SYSOP callsign, run script /spider/perl/create_sysop.pl
- rename file startup.txt startup
- execute script /spider/src/client  <sysop's alias callsign> (your spider callsign without ssid); and enter commands : set/spider f6bvp-3 and connect f6bvp-3
-
In order to receive DX network cluster spots from F6BVP, send a mail with your Spider callsign-ssid.
Cluster application is writing a lot of data taking a large disk space. In order to remove regularly old data in /spider/data/log, /spider/data/debug and /spider/data/spots a symbolic link has been created toward /NULL device and a script in /etc/cron.daily will clean up old cluster data automatically.
- script in /etc/cron.weekly/clear_log.sh must be executable (chmod a+x clear_log.sh) in order to clean up old log data and recover free space on SD disk.
Raspberry Pi serial connections

Distributed system is already completely configured to run a Terminal Node controler like the dedicated TNC-Pi through 2x13 (2x20 on B+ boards) connector bus. Here are two specific pages about Raspberry Pi serial connection.

http://elinux.org/RPi_Serial_Connection

http://www.hobbytronics.co.uk/raspberry-pi-serial-port

Terminal Node Controler TNC-Pi for AX.25 over radio
I wanted to start AX.25 over radio links with my Raspberry Pi.
I ordered and and assembled two TNC-Pi kits.
I had to remove the upper layer of nice looking Pibow box from Pimoroni in order to make room for inserting the TNC-Pi on the 2X13 pins connector.
This connector is a General Purpose Input Output interface handling more particularly I2c bus and serial port connection we may use for the TNC-PI.
I inserted a supplementary blue layer below the TNC-Pi to avoid unwanted shortcuts between solder on the lower face and USB plug.
 
I choosed to select serial port as I did not intend to use more than one TNC on that RPi. Thus I inserted a jumper at JP7 and also at JP3 and JP4. However, I mistakenly put JP3 and JP4 parallel to the chip and not parallel to the 2x13 pins connector as instructed. This lead to a strange behavior of the TNC-Pi. It was not responding to any command, but it was digipeating frames over the air ! Soon after I realized the mistake and oriented jumpers JP3 -JP4 correctly, the TNC worked then perfectly. Note : new TNC-Pi versions may not have same jumpers. See version specific notice.

Connecting TNC-Pi to my Icom radio was not a problem, for the 9 pin D-sub plug wiring is standard and I had already made a cable connecting a Kantronic TNC to my IC-290.

Distributed Raspbian AX.25 is already configured for using TNC-Pi via GPIO bus connector

In case of difficulties you want to read the TNC-Pi manual instruction carefully.

Kiss parameters has been aleady set once for all.  Serial connection is on /dev/ttyAMA0.

Device ttyAMA0 has been attached to ax25 port named vhfdrop declared in axports with speed 19200 bauds.

You probably want to consult Charley's K4GBB dedicated page for a complete description of TNC-Pi install and more specifically via i2c bus.
After configuring kiss parameters, do not forget to remove jumpers at JP3-JP4, only if using I2c bus. Keep them if using serial connection via GPIO 2x13 pins connector.

  • Once Pi TNC DB9 plug is connected to a Radio you can display AX.25 incoming traffic with listen -chat (or monitor -chat) command.
  • You may also see AX.25 traffic on console 5 (Alt+f5 keys) or Dx Spider cluster service messages on console 6 (pressing Alt and f6 keys simultaneously).
  • clu command will let you login to your DX Cluster as a user. enter your callsign without SSID (for example f6xyz for cluster f6xyz-3). Quit by typing  b (Bye).
  • xastir APRS application only runs on an X11 graphic context. First login into a console and type sudo startx. Or simply startx if you are logged as super user (root).
  • Click on lower left screen Menu, click on Other and on xastir.  xastir application window will open.
  • Configure your station parameters (CALL, Location longitude and latitude). 
  • Click on Interface control and Add AX25 TNC ax25 device name vhfdrop (or any other serial ax.25 interface you configured in /etc/ax25/axports),
  • then click on start
  • Click on View traffic, click on incoming data to watch APRS packets.
BACKUPS and upgrades
  • It is highly recommanded to perform regularly a backup copy of your SD card. For once it is corrupted it is very difficult to repair. See dd above.
  • Once a month or so you want to update RPi Linux packages with commands : "apt-get update" followed by "apt-get upgrade" after saving SD !
  • WARNING : In case of system library major version changes (rarely) you will need to recompile AX.25 library and all hamradio application programs.
  • The main symptom of the need to recompile AX.25 library or/and recompile an application is a dysfunction or a software abort with or without a memory segment violation message that did not occure before updating the system.
A more deeper ugrade of firmware, Linux kernel operating system and linux libraries can be achieved by the following three commands successively :
  • "apt-get update"
  • "rpi-update" that will update firmware and kernel.
  • "apt-get dist-upgrade". Use it rarely.
There is still an important issue in AX.25 Linux long term and stable kernel versions (4.10.x, 4.1.38, 4.4.48 and newer).
The issue let unconnected stations "sockets" remain
unclosed and prevents further connexions.
I
f you get some AX.25 or ROSE connection issues, then your kernel version is probably suffering from this bug.
You are invited to perform an "rpi-update" command that will do a kernel downgrade  !

# This script will install a well performing kernel for AX.25 and ROSE applications (kernel 4.1.21).
# It should be saved on a file named "downgrade.sh".
# execute command: chmod a+x downgrade.sh
# execute script using command: ./downgrade.sh
#
rpi-update dea25fa62132365c11087e51e416df656db28bf3
#




If you need help, please contact Bernard F6BVP via FBB list or via FPAC list or directly f6bvp@free.fr
You also may want to join these users lists : Fpac users list , xFBB list