Updated 14 Sept 2018
Charles S. Schuman, K4GBBThe Raspberry Pi was developed as an educational tool to provide a platform for students to learn Linux and programing. It's Size and price make this credit card sized computer a great choice for Packet Radio Remote Sites and other HAM Radio applications. The SoC, System on Chip, uses an ARM11 architecture. There are a great number of people “playing” with this device and having great success with it.
I started writing this page from notes that I have collected from the various resources. It was too much like re-inventing the wheel. So, I set the notes aside and collected links. The various resources do a super job for both the Advanced and the Beginner. The page contains notes and comments specific to the Ax.25 service. The basic Raspberry Pi stuff will be referenced and linked.
This page is the mainly for setting up the Ax.25 Service and is CLI, Command Line Interface, orientated.
More information on setting up the File System and Ax.25 Service may be found on
My How-To page for installing RMS on a X86 system.
Go to the Linux RMS Gate page for installing RMS Gate on Raspberry Pi.
You might also be interested in PAT a cross platform Winlink client written in GO.
For the Hardware setup You will need :
The first time you power up a New Raspbian “wheezy” SD card should have a Keyboard connected.
This is so that you can interact with the Configuration Menu.
You may re-run the config menu at any time by issuing the command sudo raspi-config.
It is important to shutdown the system with the halt or shutdown command BEFORE removing the power.
Powering down the RPi with the OS running can cause problems if the system was in the process of writing to the SD card.
Watch the Green LED when you shutdown. It will flash 5 times in sequence to indicated that the shutdown is compete and it is safe to power down the board.
At this point you may remove the Keyboard, Monitor and Mouse and access the RPi host via SSH.
Log on and switch to the root User.
The SUDO SU command allows you to adopt root privileges.
sudo su
Once you have the system configured and running you should :
apt-get update
apt-get dist-upgrade
Set the IP address to Static.
# Logging SyslogFacility AUTH LogLevel INFO PermitRootLogin yesSave the change. Restart ssh with the cmd.
service ssh restart
passwd
Log out of the User pi session and Log in as root using the newly assigned password.
usermod -l myname pi
usermod -m -d /home/myname myname
Where myname is the new User name
The TNC-Pi may be configured to be attached to the Raspberry's single serial port or attached to the I2C buss. Attaching the TNC-Pi to the I2C buss allows the use of several TNC-Pis. For more information on TNC-Pi setups go to TNC-Pi configuration.
You may also connect the TNC-X directly to the Raspberry's single port.
Use Caution Here!
Remove Jumpers TNC-X JP5 1 - 2 (TxD) TNC-X JP5 3 - 4 (RxD) TNC-X JP4 (Power) Connect (wire) between TNC-X RPi JP5 - 1 TxD ------ J1 - 10 RxD JP5 - 3 RxD ------ J1 - 8 TxD JP5 - 7 Gnd ------ J1 - 6 Gnd JP4 - 2 5VDC ----- J1 - 2 5V
Configure the Raspberry as you would if you were using aTNC-Pi setup for a serial port.
The first step is to install the tools that will allow us to compile the programs and utilities that we need.
Build support is the GC Compiler and the compiler support libraries.
You can download the Install Script and run it as root or execute commands one at a time.
wget http://k4gbb.no-ip.info/docs/scripts/InstAX25.sh
We are going to execute all of the following as root.
First we need to update the package list and the upgrade the distribution.
apt-get update && apt-get dist-upgrade
Next get the Compiler Package and the development Libraries for Ax.25.
apt-get install build-essential libax25-dev libx11-dev zlib1g-dev libncurses5-dev autoconf autogen libtool
We now have the tools to compile our ax.25 sources.
The basic Ax.25 support packages are :
The Raspbian Ax.25 support packages do not include the latest updates. They are often a year behind the development curve. It is best to compile from the source when installing the AX.25 Service. I use an “Unofficial” version that is somewhat cutting edge. You may choose to use files from the "Official" Ax.25 archive, which are more up-to-date than the .DEB packages.
IMPORTANT NOTE
If you use the Unofficial source, check to be sure that there are no libax25 files installed in the /usr/lib/ directory. If they are - move them! The new RT Lib files will be placed in /usr/local/lib/.
mkdir /usr/lib/ax25lib
mv /usr/lib/libax25* /usr/lib/ax25lib/
The Debian policy for Ax.25 file locations would have ax25 binary files placed in /usr/sbin/ or bin, configuration files in /etc/ax25, and data files in /var/ax25.
I find that these file locations are already heavily populated and finding the needed file in the crowded directory is sometimes difficult. Most developers agree and have moved the binary files to /usr/local/sbin, the configuration files to /usr/local/etc/ax25 and the data files to /usr/local/var/ax25.
To make sure the two policies are compatible I placed everything in the /usr/local/..... directories and symlinked the Debian locations.
/etc/ax25/ >
/usr/local/etc/ax25/
/var/ax25/ >
/usr/local/var/ax25/
mkdir /usr/local/etc && mkdir /usr/local/etc/ax25
mkdir /usr/local/var && mkdir /usr/local/var/ax25
ln -s /usr/local/etc/ax25 /etc/ax25
ln -s /usr/local/var/ax25 /var/ax25
We will be working out of the /usr/local/src/ax25/ directory.
Enter the following commands from the command line as root.
mkdir /usr/local/src/ax25 && cd /usr/local/src/ax25
To download and unpack the AX.25 source files
execute the following steps via the command line as root.
wget https://github.com/ve7fet/linuxax25/archive/master.zip
unzip master.zip
Enter the following commands from the command line as root.
cd /usr/local/src/ax25/linuxax25-master/libax25/
./autogen.sh
./configure
make
make install
Enable the new Run Time Library files so that the ax25 apps and ax25 tools may use the new library functions.
echo "/usr/local/lib" >> /etc/ld.so.conf && /sbin/ldconfig
cd /usr/local/src/ax25/linuxax25-master/ax25apps/
./autogen.sh
./configure
make
make install
cd /usr/local/src/ax25/linuxax25-master/ax25tools/
./autogen.sh
./configure
make
make install
Set permissions for /usr/local/sbin/.
cd
/usr/local/sbin
chmod 2755 *
The AX.25 modules (drivers) ax25, rose, mkiss, 6pack, netrom, etc .. are already installed, but need to be loaded into RAM.
modprobe
ax25
modprobe rose
modprobe mkiss
You can preload the ax25 and mkiss modules by adding them to the /etc/modules file.
The Command lsmod will display the list of modules modules that are loaded.
Ax25 is now installed.
cd /etc/init.d
wget -qt3 http://k4gbb.no-ip.info/docs/scripts/ax25 && chmod 755 ax25
cd /usr/local/etc/ax25
wget -qt3 http://k4gbb.no-ip.info/docs/rpi/ax25-up.pi && mv ax25-up.pi ax25-up
wget -qt3 http://k4gbb.no-ip.info/docs/scripts/ax25-down && chmod 755 ax25-*
wget -qt3 http://k4gbb.no-ip.info/docs/rpi/axports
wget -qt3 http://k4gbb.no-ip.info/docs/rpi/ax25d.conf
touch nrports
touch rsports
cd /usr/local/sbin/
wget -qt3 http://k4gbb.no-ip.info/docs/rpi/calibrate_pi && mv calibrate_pi calibrate
Create or Edit /etc/ax25/axports.
See man axports for file description.
DO NOT leave any blank lines in the file.
Example :
# /etc/ax25/axports
# Port Callsign Baud PacLen MaxFram Description
0 W3EGP-1 19200 256 7 1200 baud - 145.030 MHz
# End /etc/ax25/axports
Change the call and baud rate to match your TNC.
Create or Edit /etc/ax25/ax25d.conf..
See man ax25d.conf for file description.
EXAMPLE :
# /etc/ax25/ax25d.conf
[w3egp-10 via 0 ]
NOCALL * * * * * * L
default * * * * * * - rmsgw /usr/local/bin/rmsgw rmsgw -P 0 %U
# End /etc/ax25/ax25d.conf
The Hot Plug setup of some of the earlier Raspberian FS creates sockets that are unattached and cause the system to run out of sockets. Later images have corrected the problem. If your system shows a series of unattached rose or ax sockets edit /etc/default/ifplugd
Change HOTPLUG_INTERFACES="all"
to HOTPLUG_INTERFACES="wlan0"
If you are using the TNC-PI you will have to edit /etc/ax25/ax25-up and change the device from /dev/ttyUSB0 to /dev/ttyAMA0 by moving the # character
/usr/local/sbin/kissattach /dev/ttyAMA0 0 44.128.1.1 >/tmp/ax25-config.tmp # /usr/local/sbin/kissattach /dev/ttyUSB0 0 44.128.1.1 >/tmp/ax25-config.tmp
Ax.25 is a System Service and should be treated as a major component of the system. In order to accomplish this there must be a script that exercises control at Boot-up and Shutdown. Jump to Starting AX25 for a more complete explanation of the /etc/init.d/ax25 file and how to set it up.
The ax25 start-up is accomplished with the command:
service ax25 start
If the start/stop commands executed without an error you have an operational Ax.25 system. You will want to test the setup and troubleshot any problems before installing the RMS Gate software.
Other options are ax25 [stop] [restart] [status]
To configure AX25 to run at start up enter the following command as root.
update-rc.d ax25 defaults
Start the ax25 service
The Calibrate utility will send full frames (256 chars) to the TNC and allow you to set the audio Txd level.
Download the Calibrate file and place it in the /usr/local/sbin/ directory.
Change the permissions so that it is executable.
Don't try to use the one from a X86 system. Execute the utility.
cd /usr/local/sbin
wget http://k4gbb.no-ip.info/docs/rpi/calibrate_pi
mv calibrate_pi calibrate
chmod 2755 /usr/local/sbin/calibrate
calibrate <port-name>
The console should display the message to "press Enter to stop" and the PTT LED on the TNC should lite.
The syntax is:
call <Port_name> -s <MYcall> <call-ssid> <path>
call 0 -s n4tpo k4gbb-10 v k4gbb-3
Use ~.to exit.
The USB Hubs on the Raspberry are Version 1.1.
There have been problems with certain Powered hubs and USB devices.
The ethernet port is actually a USB device.
One of the problems experienced is a locked up Ethernet port.
If you experience locks ups try running the port at half duplex by adding the following two line to /boot/config.txt
# eth0 to halfduplex
smsc95xx.turbo_mode=N
It slows the port somewhat, but not enough to effect the packet thru-put.
I have found is that when a USB interface loses it's power it drops the Device's Hardware Id. When the USB is powered back up the system assigns a new Device ID. As a result the ax25 port is no longer associated with the hardware device. The same goes for other USB to Serial adapters.
We need to reference the port interface with a constant ID and link it to the hardware ID, /dev/ttyUSB(x), even if that Id changes. This is called Constant Device Enumeration. To do this we will write a Udev rule.
udevadm info -an /dev/ttyUSB0
You will get a rather long output.
Due to a Bug in the Rasberrian OS it WILL lock up the System after it displays the list.
Look for a section that list the adaptor for the TNC-X It should look something like this:
looking at parent device '/devices/pci0000:00/0000:00:1f.2/usb1/1-1': KERNELS=="1-1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{configuration}=="" ATTRS{bNumInterfaces}==" 1" ATTRS{bConfigurationValue}=="1" ATTRS{bmAttributes}=="80" ATTRS{bMaxPower}=="100mA" ATTRS{urbnum}=="1280557415" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ATTRS{bcdDevice}=="0600" ATTRS{bDeviceClass}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bNumConfigurations}=="1" ATTRS{bMaxPacketSize0}=="8" ATTRS{speed}=="12" ATTRS{busnum}=="1" ATTRS{devnum}=="2" ATTRS{version}==" 2.00" ATTRS{maxchild}=="0" ATTRS{quirks}=="0x0" ATTRS{authorized}=="1" ATTRS{manufacturer}=="Coastal ChipWorks" ATTRS{product}=="TNC-X by W2FS" ATTRS{serial}=="FTTAEGI2"
Note the ATTRS{serial}=="FTTAEGI2" line and copy the string of characters behind the == ("FTTAEGI2").
Create a Udev rule file named - /etc/udev/rules.d/99-usb-serial.rules
Paste the following two lines into that file.
#Device #1 - Coastal ChipWorks TNC-X by W2FS - 1-port USB to serial adapter (FTDI-based) SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FTTAEGI2", SYMLINK+="tncx", RUN+="/etc/init.d/ax25 restart"
Edit the ATTRS{serial}== part of second line so that the ATTRS{serial}=="FTTAEGI2" part of the text reflects the serial that you copied down in the first step.
Save the file..
The RUN+="...." in this example reinitializes the ax25 service. There is no need to restart udev. It will pickup the new rule as soon as you save the file. However, it will not execute the RUN command/script until you cycle the TNC power. That is easily done by removing the USB cable and reconnecting it.
Edit the Port file or the kissattach statement that creates the port for the TNC-X.
Change the /dev/ttyUSB(x) to /dev/tncx
Example:
/usr/local/sbin/kissattach /dev/ttyUSB0 0
to
/usr/local/sbin/kissattach /dev/tncx 0
ls -l /dev/tncx
The /dev/tncx file should be a link to /dev/ttyUSB(x).
Check the transmit function with the Calibrate command to insure that the PTT led lites.