So you want to build an igate?

See the finished project...
It's arguably true that the APRS network has too many high-level digipeaters
and too few low-level fill-in digis and/or igates.
Building igates used to require either a "real" PC, or require you to
dig around in fairly old and creaky code to run a combination of
AX.25 in the kernel and perhaps java in user space.

No longer. With the appearance of
aprs4r,
a ground up implementation of a digipeater/igate combination
in Ruby, by a group of hams in Germany, with the Cisco/Linksys WRT
hardware family as a target platform, it is possible to build a simple
igate into an embedded router that can also provide WiFi linkage.
The WRT54G family has provisions on the circuit board for a serial
port (or two) - it is only necessary to solder in a connector and
provide level conversion.
This is well documented elsewhere: I outline a number of options
here.
With such a serial connection, you can hook up your favorite TNC
and radio and be on your way.

But recently, Scott N1VG of
Argent Data Systems
has released a version of his
OT1+
KISS Tracker/TNC that is built
using surface mount components, has direct TTL inputs (no
RS-232 converter onboard) and uses a 3.3v supply.
(He calls this the "RT" version.)
This struck me as a great combination for installing the
TNC inside the WRT - and indeed it is.
Follow along, and you can build one, too.

Install the TNC hardware

This cookbook is specifically for the
LinksysWRT54GL,
which is the currently
available version of the WRT54 family that runs Linux, and thus
can be reflashed with
OpenWRT.
The WRT54GL appears to be a rebranded version of the WRT54G v4.0
and/or WRT54GS v3.0.
This unit has 16MiB of RAM and 4MiB of flash, which is just barely
enough to run aprs4r with careful pruning.

An alternative is the WRT54G-TM, which appears to be
version of the GL branded for T-Mobile, that has double the memory
and flash. (Or, perhaps, it's an earlier version that didn't
have the extra flash/ram removed!)
Unfortunately, it ships with a non-standard bootloader; upgrading
requires some extra steps.
The most straightforward approach is described
here.
You can probably find a used one on ebay that has already been loaded
with DD-Wrt for about the same price as a new WRT54GL. Your choice!

The
WRTSL54GS
has a USB port already, so you could avoid all this hardware hackery
and hook up a
TNC-X directly, or use a USB->serial
adapter and an OpenTracker.
In addition, the CPU is a bit faster (266MHz) and there's lots of
memory: 32MiB RAM and 8 MiB Flash.
Stu W7IY has described how he did this
here.
Sadly, the boxes don't seem to be available new!

Another box that's been used is the DLink DSL-502T.
Some hams in ZL1 have deetailed information about building an
OpenWRT image for it
here.

There are older versions of the WRT that fall into this category
as well, but their board layout is different, and that matters in
how you build your internal TNC board.
(See
how VE1FIS did it.)
You might want to skip down and do the software part first .. or
pick up your soldering iron and build the board first. Up to you!

The photo to the right shows the GL's board layout.
The empty serial port is marked in red (JP2).
The pinout of JP2 on the Linksys PCB is as follows:

Your first task is to crack the case (this will void
your warranty!) as
detailed by Void Main.
Then solder in a 5x2 connector to JP2.
We'll be building a little board that plugs directly into this connector.

The board is quite simple: it has a connector on the underside that plugs
into JP2, SIP rails for the OT1+, and an LED to show activity.
Unfortunately, this location for the LED is obscured, but you'll
be able to see a colored glow through the vents. If you really care,
you can drill a hole through the case directly above it, or bring the
LED out on wire leads.
I also included a set of pins to allow me to select whether to
use serial port 0 or 1 (on some WRT versions, serial port 1 doesn't
work correctly) and provide a place to access the OT1's serial
connector directly.
More on that later.

I used CAT5 cable, with one pair removed, for the radio connector; on pair
for transmit audio, one pair for receive audio (each with a ground) and
the remaining pair is used for SQL and PTT.
If you wish, you can use the remaining pair to remote mount a bi-color LED.
This layout works great for the WRT54GL, where the board sticks out into the
empty space left in the case.
But if you're using, say, an early WRT54GS, you'll want to arrange the board
with the jacks on the LED side of the OT1+, so the whole thing will
still fit in the case!
Build carefully - I recommend soldering the OT1+ last, after checking the
board in the WRT to see that power and ground (at least) are where you
expect them.

After I built the first one, I decided to try making a PC board version -
mostly since I'd never done it before. It came out pretty well, with
no serious problems. I handed of the excess to Scott N1VG to
list in his store.
You can find the Eagle files for the board
here.
Note that I decided to remote mount the LED this time.

I bring the radio lines out to a DE9F on the side of the case, wired
to the Kantronics "standard", as described in the
OpenTracker Plus manual.

Now that the serial hardware is in place, you need to program the
OT1+ with the KISS firmware.
This is complicated by the fact that
there's no version of the otwincfg program for Linux, so I use
a windows laptop.
Now, the nice thing about this version of the OT1+ is that it uses
TTL levels on the serial port, instead of RS-232 - that makes it
easy to interface to the WRT.
But it means that it doesn't work directly with my laptop!
I connect with a CompSys RS232 adapter, in particular a
A232DBH3v,
which is a very convenient package.
(Another possibility is
this unit from alldav.com.)
The other end from the DE9 is connected to an 8-pin housing with four
pins that fits over the 8x1 SIP header on the board.
Remove the two serial port selection jumpers, install the adapter
header, and you have power, ground and serial direct to the OT1+.
Use Scott's otconfig.exe to load the 9600 baud KISS firmware.

Now the TNC is running; it's time to load OpenWRT and the aprs4r software.

Upgrade to X-wrt:

I prefer to install the X-Wrt distro, which provides a stable
Kamikaze build of OpenWRT as well as a nice web interface for managing
the hardware and network setup.
Once that's in place, I install aprs4r separately.
It's possible to install aprs4r as a complete download with Kamikaze,
but that doesn't include X-Wrt .. and X-Wrt has proven difficult
to load after the fact.

The native Kamikaze web interface (LuCI) is slowly getting usable, so
you might want to try using that; look
here.

Go to
the X-Wrt wiki
and follow the directions to choose and download a suitable kamikaze build.
The WRT54 is a Broadcom device (brcm) so you need to choose the kernel
carefully if you want wifi.

Connect your computer to one of the four LAN ethernet ports. The WRT54 will
be happy with a normal cable (crossover not needed).
Note that, depending on your OS, you may lose your network route to
the "outside world" at this point.
Also connect the WRT's WAN port to your local network, so you can
route packets through it.

Either get an address via DHCP or manually set the port to be on the
WRT's default network (192.168.1.x if you're working with a dead-stock WRT54).
That means you should choose 192.168.1.10, and be able to ping 192.168.1.1

Use a browser to connect to the router's console at http://x.y.z.1
(x.y.z depends on your network, 192.168.1.1 if you're upgrading a stock WRT54).
The default user/password is admin/admin.

Initial setup with LuCI instead of X-Wrt

Visit
Kamikaze installation
for help in choosing the appropriate Kamikaze download.
The WRT54 is a Broadcom device (brcm) so you need to choose the kernel
carefully if you want wifi.
Download the correct file from the
download directory -
whether to use a trx or bin file depends on what firmware
you currently have loaded.

Use one of the upgrade paths to load the new firmware; the
easiest is to use the firmware's "upgrade" webpage.

Wait for the Power light to stop flashing and the DMZ to go out.

The default IP address of a fresh Kamikaze load is 192.168.1.1;
configure your computer to use the IP address 192.168.1.2.

Initial aprs4r install

Note that the script may try to use ipkg, which has been replaced
by opkg; use vi to edit the script, changing the definition of
IPKG to /bin/opkg if necessary,
and also change the name of the repository configuration file from
/etc/ipkg.conf to /etc/opkg.conf.

If you are running on the WRT54GL, the default installation will not fit.
Micha DO5MC has kindly provided a version of the installation script
that doesn't load the web interface; use
http://www.aprs4r.org/download/openwrt-aprs4r-install-minimal.sh
instead.
This makes the configuration process (below) different.

This will take a while, as many packages are downloaded and configured.

Turn off X-Wrt

To save memory, turn off X-Wrt! This is a little unfortunate, but that's
the way things are. The easiest way to do this is

/etc/init.d/httpd stop/etc/init.d/httpd disable

If you need to do serious reconfiguration, you can start it with
/etc/init.d/httpd start for one time use.

Configure aprs4r with the web interface

At this point, you have two choices. If you loaded the aprs4r-web package,
you can use the web page configuration.
This is somewhat cleaner and avoids all kinds of syntax errors and
other problems - but it's also a little slow.
And, unfortunately, the web pages are all in German!

Here's an overview of how to use the web interface. At the end,
there's a more straightforward mechanism using a cookbook file
that you modify with vi, which is what you'll need
to use if you didn't load the aprs4r-web package.

Use a browser to connect to port 8085 on the router.

Choose "APRS4R-Webschnittstelle" - use "aprs4r"/"aprs4r" as the credentials

Select "Setup"

There are three available templates: fillin, wide, gateway; gateway is a good starting point for an igate.

Under "Profil anlegen", choose "gateway.yaml" from the dropdown box and press "Neu" to load the template.

Change the name in the "Profil speichern" to match the name of your igate and press "Speichern" (store).

Now you have a basic setup in /etc/aprs4r on the router;
you can edit by hand or edit with the web.
The following is how to use the website to do the basic setup.
(See also
APRS4RConfiguration).

Select "Devices" from the left sidebar.

The rf0 panel is the TNC connection; use the
online documentation to make it match your hardware.
Press "Uebernehmen" to update the settings.

The is0 panel is the APRS-IS connection; use the
online documentation to make it match your desires.
I think that a good starting point for North America is

This sets up the igate to log into the APRS-IS with a filter that
retrieves APRS messages for "local" stations, which we'll gateway to RF.

Select "Beacons" from the left sidebar.

Enable ("aktiviert") any beacons you deem interesting -
at least an RF beacon every 10 minutes to keep the
FCC happy, and probably an IS beacon to make sure you show
up on the APRS-IS maps.
See
my APRS overview page for some links that give more specifics
about paths and timing.

Under "Digipeater", you'll want to enable the rf0tois0 Gateway -
that's the igate! You can use a similar
setup to gate APRS messages from APRS-IS to RF,
but the message plugin does a better job:

Under "Misc", enable the message plugin.
The messages that are passed from IS to RF are controlled by
the filter string you supplied when setting up is0.

At the end of all this, you need to store the entire profile!
Go back the the "Setup" pane and click on "Speichern" under "Profile speichern".
I've stashed a basic fill-in digi/igate setup,
with a set of beacons including
a voice repeater object,
here;
you'll need to modify the call and lat/lon and such, and then you
can drop it into /etc/aprs4r/myprofile.yaml.
If you want to be a "high and wide" digi, you'll need to
change the configuration of the digipeater plugin by following
the
online documentation.

Start aprs4r

At this point, many things are configured, but nothing is actually running.
Choose 'Startup' from the sidebar. You want to turn on everything:

Manually start your profile now (the first "Starten")

Turn on the watchdog (the second "Starten")

Start aprs4r at boot time: choose "ja" for 'Start beim Booten' and "Watchdog".
I use a timeout of 300. Click 'Speichern'.

Configure and start aprs4r without the web interface

This is easier, but more error prone.

cd /etc/aprs4r
wget http://www.dimebank.com/cak/k6dbg/MYCALL.yaml

Use vi to edit MYCALL.yaml to match your
setup; there's a list at the top of the file that will help you along.
When you're done, save it in a new file myprofile.yaml.
Then:

The /etc/default/aprs4r file tells aprs4r's startup script
which profile to use, and how often the watchdog should check to make sure
that aprs4r ist still running.

Living with it

Now your igate is running, and the aprs4r system should come up cleanly
after reboot.
I recommend rebooting at this point ... and then you'll have to debug
and tweak.
Use http://aprs.fi to see how your
system looks on the map and if you're being at all effective.
Logs are in /var/log/aprs4r, and are very helpful;
you can stop and start the aprs4r system from the command line with
/etc/init.d/aprs4r.
After things are running, you may decide that you don't want to give
up the memory used by the webserver!
The free command will show you how much difference that makes.

Spend some time reading through the aprs4r web pages, and get familiar
with the options available via the
support pages.
I strongly suggest that you join the aprs4r-users
mailing list; it's very low traffic and really the best place to
get specific questions answered.

Depending on where and how you are deploying this, you may want
to enable access from the external network interface.
That's pretty easy to do with ssh/putty; see
this discussion
for a lot of details and further links.

Harry SM7PNV wrote to tell me that he has problems with the system
getting really slow after a while fixed this by rebooting regularly.
Indeed, I have the same problem - there seem to be memory leaks in the
Ruby code. I have added a crontab entry on all my boxes to reboot
regularly! In /etc/crontabs/root, add the following:

02 4 * * * reboot -f

which will cause a reboot every night at two minutes after four.

Special thanks to Jerry KB0QCL for encouraging me to put this page together.

Future work

The WRT54 serial header has two serial ports.
It wouldn't be much extra work to build a board that has two
TNCs on it (I'd put the 5x2 header in the middle) and build a
split-frequency digi.
Or, if you prefer to use external TNCs, just use two of the CompSys
ST232A adapters.
Either way, this would be a very nice package for areas that are
trying to deal with a congested channel on 144.39 MHz...
A little care is needed because /dev/tts/0 has console output
and a login process by default, but the required changes are pretty
well documented in the OpenWRT wiki: mostly you have to comment out
comment out following line in /etc/inittab:

ttyS0::askfirst:/bin/ash --login

though it's possible that the boot messages will confuse your TNC.
If that's the case, you may have to build your own kernel without console
support, using make kernel_menuconfig
in the OpenWrt build environment.
Happy hacking!