APRS microModem

24 February 2017

I was looking for a home for some recently purchased Arduino Nanos when I came across a project for an APRS Modem created by 
Mark Qvist in Denmark (http://unsigned.io. Mark's design is built around just about any flavor of Arduino. In addition to a schematic, Mark provides the firmware for a KISS mode modem. The hardware is super simple to build, but you have to tweak the design to interface with your particular radio, especially the PTT circuit. Coming from the Arduino, the PTT signal is a HIGH so I had to add a transistor to reverse it to a LOW required by my Yaesu FT-2500M 2 meter transceiver.


https://sites.google.com/a/wt4y.com/radio/aprdmicromodem/APRSmicroModemSchematic.jpg

R1 - 1k, R2 - 2.2k, R3 - 3.9k, R4 8.2k, R5 - 270, R6 - 100k, R7 - 1k, R8 - 270, R9, R10 - 100k, R11 - 10k, R12 - 470*
C1 - 100nf, C2 - 4.7uf, C3 - 1mf non-polarized (I used a .1mf, worked just fine)
Q1 - generic NPN transistor (2n2222 etc.)
D1 - Red LED (indicates transmit out)
D2 - Green LED (indicates received data)
* Note: R12 not needed if PTT and Mic Out lines are combined for many HT's such as Yaesu, Icom and Alinco. Research your particular radio for PTT and Microphone Input requirements.

Here's the completed hardware, the APRSmicroModem on the left, a Raspberry Pi in the center and a 5 volt power supply on the right.  Note the external USB WiFi required because the Pi's internal WiFi  doesn't work so good inside an aluminum box. I had problems with a too low voltage on the Arduino because the power was coming from the USB connection. The ribbon cable connects 5 volts and ground in parallel from the power supply to the Raspberry Pi and the Arduino.
https://sites.google.com/a/wt4y.com/radio/aprdmicromodem/APRSmicroModemHardware.jpg

Now you have to flash the firmware for the Arduino to turn it into a KISS mode modem. To do this, I used a Linux program called "avrdude". Since I intended to interface the modem with a Raspberry Pi, I used the Pi to flash the image.

Initially I used a full Raspian with desktop image so I could run a GUI based APRS client called Xastir. I found Xastir to be exceeding slow, so I downloaded Raspian Lite (no desktop) and installed APRX, a command line client. More about that later.

To install avrdude, from a Terminal window on the Pi, run sudo apt-get install avrdude. 
Download the pre-compiled firmware image from Mark's repository.
sudo wget https://github.com/markqvist/MicroAPRS/blob/master/precompiled/microaprs-5v-kiss-latest.hex
Plug the Arduino into a Raspberry Pi USB port. Now you need to find out what USB port is connected to the Arduino.
The command dmesg | grep ttyUSB* will return the port number you will need for flashing the firmware. In my case, the command returned ttyUSB0.
From the same directory where the firmware image was downloaded, issue the following command to flash the firmware:
avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 57600 -F -U flash:w:microaprs-5v-kiss-latest.hex
Note: baud rate for Nano is 57600, I think Uno is 115200. If the flash was successful, you will no longer have an Arduino. You will now have an AVR microprocessor with an APRS KISS mode modem firmware. If you want your Arduino back, you will need to find the boot loader for your Arduino on the Internet and flash the image back.

Now it's time to install the APRS client on the Raspberry Pi. If you want the GUI client Xastir, you will need a Raspberry Pi running the desktop version of Raspian.

The following directions are for APRX, a command line only client.
I run commands as root (not recommended) so if you get errors, precede the commands with sudo.
Check for latest version at: http://thelifeofkenneth.com/aprx/. When these instructions were created the latest version is 2.9.0.

This will download it:

wget http://thelifeofkenneth.com/aprx/debs/aprx_2.9.0_raspi.deb

Now install it:
dpkg -i aprx_2.9.0_raspi.deb
Edit the file /etc/default/aprx so the client starts when the Pi is restarted:
nano /etc/default/aprx
Change the file so that the configuration reads: STARTAPRX="yes" and DAEMON_OPTS=""
Save the file and issue the following commands:

update-rc.d aprx defaults 84

/etc/init.d/aprx start

The manual you will need to read and understand to configure the client is at: http://thelifeofkenneth.com/aprx/aprx-manual.pdf
The configuration file is /etc/aprx.conf
Here is my configuration for a Tx/Rx iGate. Read the manual if you want something else like a Rx only iGate. You must change the values highlighted in yellow. See the notes at the end.

mycall YourCallSign myloc lat xxxx.xxN lon xxxxx.xxW <aprsis> passcode xxxx server noam.aprs2.net heartbeat-timeout 1m </aprsis> <logging> pidfile /var/run/aprx.pid rflog /var/log/aprx/aprx-rf.log aprxlog /var/log/aprx/aprx.log erlangfile /var/run/aprx.state </logging> <interface> serial-device /dev/ttyUSB0 9600 8n1 KISS tx-ok true </interface> <digipeater> transmitter $mycall <source> source $mycall </source> </digipeater> <beacon> beaconmode both cycle-size 15m beacon symbol "I&" $myloc comment "PHG70966/ RxTx iGate Nicholson, GA" </beacon>

Notes:
  • Obviously, use your call sign.
  • To understand how APRS reads the latitude and longitude, see the following: http://ember2ash.com/lat.htm. Make sure the value for longitude is 5 digits before the decimal point, even if you have to precede it with a zero.
  • If you don't know your APRS passcode, go here and generate yours: http://apps.magicbug.co.uk/passcode/
  • You can leave the server value at noam.aprs2.net if you live in North America.
  • Make sure the correct USB port is listed for serial-device.
  • The beacon you transmit can be anything you want. The optional "PHG" (Power Height Gain) code will advertise the characteristics of your antenna. To calculate your very own PHG, go to: http://www.aprsfl.net/phgr.php. Unless you live in Nicholson, GA, you should change this also.
The red LED will turn on when transmitting and the Green LED will turn on as the modem decodes received packets. Make sue the volume control is turned up high enough, but not too high that you over-drive the modem. After a few seconds of operation, you should be able to find yourself on the map at: http://aprs.fi/. You may have to search for your call sign.

Note: If you really really want to run a Raspberry Pi desktop with a GUI APRS client, here are some brief instructions:
Get the latest Raspian image at: https://www.raspberrypi.org/downloads/raspbian/
You will want "RASPBIAN JESSIE WITH PIXEL"
Download and unzip the file.
Write the image to your SD card using Win32 Disk Imager
A very nice fellow has written a script to run about 100 commands that install Xastir. To get it, from a terminal windows run:
sudo wget http://www.175moonlight.com/xastir/debian7-8-xastir-git-build.sh then run it with the command: ./debian7-8-xastir-git-build.sh
(run as the Pi user, not root) Good luck.