APRS I-Gate/Digi with my new Raspberry Pi

Recently I picked up a Raspberry Pi computer and have been setting it up to take on the Digi/Igate duties for WI0LA-10.  For those of you who don’t know, the R-Pi is a $35 computer based on an ARM processor (similar to the processor used in smartphones).  It includes 2 USB ports, an ethernet jack, a HDMI video output (to plug into your HDTV), and an SD card slot.  The SD card serves in leiu of the hard drive.  This is how I set up my raspberry Pi Digipeater/I-gate.

First, all the various pieces of hardware.  I had everything I needed already on hand, but I’ll run down all the parts that make it all work.

For the purposes of this document, I will assume that you’ve gotten the radio and TNC talking to one another over serial (minicom is a good tool for this) – Setting that up is a little beyond the scope of my document, and there’s already plenty of good information on doing that is available elsewhere.  I’ll also assume you’ve put your KPC+ (or other TNC) into KISS mode.  I will be using the linux built-in AX.25 network support in the building of this system, which requires KISS mode.  If you’re starting from scratch, and not using a TNC you already own, you might be better off getting a pre-built TNC-X, as it should work great with this setup, and perhaps allow you to completely eliminate the USB-Serial adapter.  Also, all Linux commands are assumed to be entered as root.

First, we need to get our ax.25 userland applications installed onto the R-Pi:

apt-get install libax25 libax25-dev ax25-apps ax25-tools

Also, we need to get and comple the aprx digi/igate software – I’m using version 2.04 (svn 474) – there may be a newer version.


cd /usr/src
wget http://ham.zmailer.org/oh2mqk/aprx/aprx-2.04.svn474.tar.gz
tar xvf aprx-2.04.svn474.tar.gz
cd aprx-2.04.svn474/
./configure && make && make install

I like to run the AX.25 mheard daemon as well, so I can easily see what other stations my system is hearing.  For this to work correctly, we need to do the following:

mkdir /var/ax25/mheard/

The mheard daemon will create a file within this directory storing information about stations heard.  Without creating it first, that process will fail to function.

Prior to setting up the AX.25 stack, you must create the /etc/ax25/axports file.  It will look like the following:

packet  WI0LA-10        9600    128     2       144.390MHz 1200bps

The fields are as follows:  interface name, callsign, serial port speed, packet length, tx window, and a description of the interface.

Configuration of the /etc/aprx.conf file is next.  I usually make a backup of the original config file before editing it:


cp /etc/aprx.conf /etc/aprx.conf.orig
vi /etc/aprx.conf

Below is some of the various changes I made to the default aprx.conf.  It’s quite well-commented, and documentation is also available on the project’s web site listed above.  What I outline below should get you a functional configuration.


mycall  WI0LA-10
<aprsis>
server   noam.aprs2.net
</aprsis>
<logging>
pidfile /var/run/aprx.pid
rflog /var/log/aprx/aprx-rf.log
aprxlog /var/log/aprx/aprx.log
</logging>
<interface>
ax25-device $mycall
tx-ok true
</interface>
<beacon>
beaconmode both
cycle-size 10m
beacon symbol "/#" lat "3755.69N" lon "09523.32W" comment "IARC Digi/I-Gate Local Repeater 147.375 179.9Hz"
</beacon>
<digipeater>
transmitter $mycall
<source>
source $mycall
relay-type digipeated
</source>
</digipeater>

You should also create the directory for the aprx log files:

mkdir /var/log/aprx

Last, I create a simple shell script for starting up the AX.25 networking.  More enterprising users could probably integrate this into a bootscript to automatically start on boot, but this seems to work for me.  I call this script tnc_start:

#!/bin/bash
#Create the AX.25 interface
kissattach /dev/ttyUSB0 packet 44.122.1.59
#Set some optional parameters
#700ms txdelay (-t)
#200ms slottime (-s)
#persist of 32 (-r)
#100ms txtail (-l)
#half-duplex mode (-f)
kissparms -p packet -t 700 -s 200 -r 32 -l 100 -f n
#Start the aprx digipeater daemon
aprx
#Start the mheardd daemon
mheardd

And, that about does it!

One thing to note – aprx can interface directly with a KISS TNC (without the use of the Linux AX.25 stack), however, if you do utilize the Linux AX.25 support, you can also have other applications accessing the TNC at the same time.  For example, I can have aprx accessing the TNC, with the callsign-ssid of WI0LA-10 (our club call used for the digi & igate), and I could also run Xastir using my personal call KE0MD.  Both can transmit, both can receive, each doing it’s own thing, which is a hallmark of Linux.

Hope this information helps you, and if you find it useful, or have any corrections, feel free to let me know!

20 thoughts on “APRS I-Gate/Digi with my new Raspberry Pi”

    1. No particular reason, other than the fact I knew I already had a good USB-Serial converter on hand from my previous PC-driven digi, so I simply took the easy way out. Someone with knowledge could probably pull it off.

  1. I’m glad to hear you chose the KB9VBR J-Pole antenna for your Igate/digi. I need to rebuild the I-gate in our area and your post gave me some great tips for a reliable, low power solution. Have a great day, Michael.

  2. Thanks for the article. I got my RasPi running my igate in about 45 minutes. It would have gone faster if I wasn’t having so much fun with the RasPi!

    The only thing that you didn’t mention was to add the line “/etc/tnc_start” to the end of the /etc/rc.local file. Once I did that, it would boot and start the daemons automatically. Otherwise your instructions were GREAT!
    73
    Paul
    KC9RGZ

  3. When I attempt to install 2.04.svn474 or 2.06.svn514 i receive a notice that “makefile.in” seems to ignore datarootdir setting and a couple of lines later an assembler message that “Fatal Error cant create aprx.o : permission denied.

    I did use the sudo command.

    any ideas?

    Stan
    AA6I

  4. To fix the “permission denied” problem I had to login as “root” for it to work.

    These instructions are good for someone who knows Linux but leaves alot to be desired for someone new to Linux. Might I suggest that you get a friend who knows nothing about Linux to follow your instructions and make the proper changes so that a beginner can follow them. I’m still having problems. For one I don’t know what a shell script is or where to put it. Sounds like a dos batch file?

  5. Hello Jeremy, First, thank you for the writeup. I followed your directions but I seem to have a problem. I am using a TNC-x (USB) with the RPi and APRX. I can not seem to get the PTT to light up on the TNC. Not sure if it is a hardware or software issue. Any tips on setting up the TNC-X in the config? Would like to have a digi/tx igate. I can email you my configs if you like, maybe I goofed up something there. thank you

  6. Thx for you article. I took me less the an hour to set up my Pi with APRX to be used as my IGate (DL1THN-10). I did not use AX25 I connected the TNC direct to the USB Port via a USB/V.24 converter.
    If it is Ok to you I will (refering to your Webpage) do a short translation into the german language on my webpage.

  7. Jeremy, thanks for the writeup. Learning alot about the RPI and APRX. However I am having the same problem Bob (W5EVH) is having. I am using the serial usb port and a serial to usb adapter and get no PTT on the TNC. TNC is in KISS mode but not sure if more needs to be set up in my TNC? Any ideas? It would be great to get my TX-Igate working. Thanks

    Eric N7JYS

    1. For Eric, N7JYS and Bob, W5EVH

      Apologies for the delay in the reply – I’ve been neglecting my blog very badly! Hard to diagnose the problems remotely, but I can give you a couple of pointers. First off, assuming there’s decent APRS activity in your area, you can try the axlisten command to see if you are recieving data from the TNC – the resulting display will look like an older TNC with the monitor function on. For example, assuming you used my instructions and set the name of your AX.25 port in the axports file as “packet”, you would run the following:

      axlisten -p packet

      Once you validate you can hear traffic, you can do a lower-level test by using the “beacon” command, which will try to send a simple broadcast packet out. For example:

      beacon -s packet "Testing DE N9PH"

      If these work, but APRX doesn’t, then you have a configuration error in APRX. If these do not work, it’s either in the OS or the cabling between the TNC and the computer. Also, there’s often some visual indicator on the TNC when it’s receiving data from the computer, for example on my KPC-3’s, the lights on the front will flicker just before the TNC transmits.

  8. Thank you for the great instructions. I wonder if you have any ideas why aprx would not igate everything it hears?

    The mheard shows stations, my ht hears them. But aprx seems inconsistent in which packets it igates.

    1. In my initial testing using the PC versions of this software, I noticed this sometimes – the real problem I have is that there’s not much APRS traffic in my area. I’ve had the I-Gate down for a while, and I need to get it back online, and take my VX8-GR out and about to see how things are working again. There are some logs from APRX, maybe check those? Or contact the developer. The real problem is I haven’t found anything else – most Igates run JavAPRSrvr which is java stuff that I don’t like messing with.

  9. Does anyone here know where to find more info on AX.25 such as commands available? I have used Google but can’t find much.

    Thanks. Max

    1. Max, best thing I can tell you is read a copy of the old AX.25 HOWTO for Linux. It pretty much goes into detail on how things work.

  10. I am getting the error COULD NOT OPEN PIDFILE: ‘/var/run/aprx.pid’

    when I look I don’t have a ‘aprx.pid’ file ?

    Should this file been created ?

  11. One thing to note – aprx can interface directly with a KISS TNC (without the use of the Linux AX.25 stack), however, if you do utilize the Linux AX.25 support, you can also have other applications accessing the TNC at the same time. For example, I can have aprx accessing the TNC, with the callsign-ssid of WI0LA-10 (our club call used for the digi & igate), and I could also run Xastir using my personal call KE0MD. Both can transmit, both can receive, each doing it’s own thing, which is a hallmark of Linux.

  12. Hello I am following you instructions as I have a KPC 3+, a PI, VX8DR and a USB sieral interface FTDI chip set). I do not follow all of these commands yet but I am working on it . One this in your start script you use an IP address. Is that the IP of you PI as it is connected to an ISP at the time you wrote the articile? I am not digipeating just ARPS I gate only to start nor am I sending a beacon with GPS data to start.

    Thanks Scott KJ4ZZB

Leave a Reply

Your email address will not be published. Required fields are marked *

1 × two =