APRS Digi Project number 2 – The TNC-Pi

I had success creating a Digi/I-Gate with the TNC-X and a old used laptop. I wanted to install a few more, but did not have any more spare machines with low power draw (due to inverters used at repeater sites) so I figured I would try the TNC-Pi to do the same thing. John from Coastal Chipworks has created an excellent product, and has been great to deal with (especially his prompt shipping which was around the time the podcast HamNation was suggesting it’s users to purchase it as well for their Smoke and Solder segment on the show).

There are now 6 of these units burning in on my desk. Here is how I built all 6 of them:

Here are my steps for setting up the Pi once the TNC-Pi is built and mounted to the Pi. At this time it is not imperative that you have the radio interfaced to the TNC-Pi, but it will make it easier to test.

First step, prepping

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim

To use the serial port to connect the TNC-Pi to the Raspberry Pi, you will need to make a couple of changes to the Pi configuration. Edit the cmdline.txt file in the boot directory and make the following changes:
1. Remove the following: console=ttyAMA0, 115200
2. Remove the following: kgdboc=ttyAMA0, 115200

sudo vim /boot/cmdline.txt

Next, edit the inittab file in the /etc directory and remove the line that says:
T0:23:respawn:/sbin/getty –L ttyAMA0 115200 vt100
You will find it at the very bottom of the config file, or at least I did in my Raspbian installs.

sudo vim /etc/inittab

Next, you can run the easy config script to set up your pi…

sudo raspi-config

The raspi-config is a script used to correct the time zone, remove the auto-desktop start, an update, and a few other small things as you may wish. I recommend changing the hostname (under advanced) in order to make it unique. In my case, I use the callsign used by the modem. Either now, or once complete, change the password for the user “pi” to something other than “raspberry”. Your changes are effective immediately. Exit the tool once you are comfortable with the settings, then reboot your pi, and continue.

sudo reboot now

sudo apt-get install subversion
svn co http://repo.ham.fi/svn/aprx src
cd src/trunk
./configure && make clean all
sudo make install

cd ~

Second step, config…

Move the config file to a new location.

sudo mv /etc/aprx.conf /etc/aprx.conf.orig

You will need to edit the APRX config to your liking. You can see my example config here. I highly suggest that you read up on all the very interesting things you can do. I am hoping to add a temperature sensor to the telemetry portion by creating packets with a perl script. These crafted KISS frames will be read and broadcast by the aprx application if configured correctly.

If you are planning to use this as a digi; When creating your config I plead with you, please use viscous-delay feature. This setting alone will greatly delay the over saturation on the 2 meter APRS frequency we use.  If you are just operating as a fill-in digipeater this setting is most powerful as it will listen for the delay period (say 5s) for any packets being digi’s that match the last one heard. If it hears another station has digi’d the packet, then it is dropped from the buffer and not sent to the radio, instead it is sent only to APRS-IS (if you have it configured to do so).

Read more about the power of APRX at http://wiki.ham.fi/Aprx.en and specifically about viscous delay here.

HELPFUL LINK: The password for the APRS-IS server was gathered here: http://apps.magicbug.co.uk/passcode/

Third step, Starting up on boot.

Create an aprx bash script to start and stop as desired…This will be used during bootup too.

sudo vim /etc/init.d/aprx
#! /bin/sh
# /etc/init.d/aprx

case “$1″ in
start)
echo “Starting aprx”
/sbin/aprx
;;
stop)
echo “Stopping aprx”
killall aprx
;;
*)
echo “Usage: /etc/init.d/aprx {start|stop}”
exit 1
;;
esac

exit 0

I later modified mine with a restart option by separating a stop and a start with a 5sec sleep timer. NOTE: Be careful copying the script above as some browsers render the quotation marks as periods, so make sure that before you save the file you replace the periods with quotation marks as needed.

Then

sudo chmod 755 /etc/init.d/aprx
sudo update-rc.d aprx defaults

Play, reboot, test…

To test APRX, it’s config, and to understand what is happening, I suggest this command

aprx -vvv -ddd -i

Things I learned…If you get this error when running the software, you may need to reboot or ensure that you have followed the two steps that involve cmdline.txt and inittab

1376738047 TTY /dev/ttyAMA0 OPEN – fd=-1 – errno=13 (Permission denied) – FAILED, WAITING 30 SECS

If you have any questions, Issues, or whichever let me know. I can be emailed at <mycallsign>@<mycallsign>.ca and will happily provide any feedback.

The next step is to interface your radio to your TNC-Pi. Good luck!