Embedded Linux APRS iGate Tutorial

Posted: August 4, 2015 in Amateur Radio, Engineering, News, Texas Instruments
Tags: , , , , , , ,

Panda APRSI know I have been bad at posting projects recently, but here is one I have done a few times now that is super easy to reproduce. With the super cheap embedded Linux platforms (Raspi, Beaglebone, etc.) and cheap TV dongles, it is really easy to make your own APRS iGate, just like the one in the photo above. This tutorial will give you the steps to get going with an APRS iGate. What is APRS you ask?

APRS stands for Automatic Packet Reporting System. It is a 1200 baud RF (mainly ham radio) packet system commonly used to record telemetry. Sometimes it is fun to log a trip or track a robot. APRS is a great tool for these sorts of problems. In the USA, APRS is commonly used on 144.39 MHz. It can be used between radios directly or can be used to log on the internet (via websites such as APRS.fi)  via an internet gateway or iGate.

To get started, follow me past the break. 

To get started, pick your favorite embedded Linux platform (I am using a Panda Board, but many will work). Install a Debian distro (Debian, Ubuntu, Raspbian, etc.). Ensure you have admin (aka sudoer) access.

Start by running the following commands in a bash shell (sometimes called a terminal) to install the required software. Some of the software on this list, such as “screen” and “htop” are not necessary for the install, but are generally helpful Linux tools. The package “build-essential” includes gcc and many of the common tools for software development. When done, reboot the system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install git cmake build-essential libusb-1.0 libusb-1.0-0-dev libpulse-dev libx11-dev libpulse-dev libx11-dev python-pkg-resources qtcreator libtool autoconf automake libfftw3-dev htop screen vim
sudo reboot

After you have the required packages, we will need to copy down a few libraries. Run the following commands to get the source that we will need to compile. This should only take a minute or two to pull down all the sources.

cd ~
git clone git://git.osmocom.org/rtl-sdr.git
git clone https://github.com/EliasOenal/multimonNG.git
git clone https://github.com/asdil12/kalibrate-rtl.git
git clone https://github.com/asdil12/pymultimonaprs.git

From this you can see we are using a few open source projects. rtl-sdr provides the driver for the TV dongle. multimonNG does the APRS decoding. kalibrate determines the calibration offset (we will discuss more in depth later). pymultimonaprs brings the whole thing together.

Let’s start by making the driver and installing the tools for the software defined radio (SDR) via the TV dongle. To do this we will move to that folder, create a build directory, build the code and install the driver. Once the driver is installed, we will need to make sure it we load the correct driver on boot.

cd rtl-sdr
mkdir build
cd build
sudo make install
sudo ldconfig
sudo vim /etc/modprobe.d/raspi-blacklist.conf 

You should now see a file open in your terminal. You are using Vim, a text editor, and will need to edit this file. First, use the arrow keys to navigate to the end of the file. Then enter “i” (the letter i). This will allow you to insert text. At the end of the file, add the following text if it isnt already present.

blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist rtl_2830
blacklist rtl_2832
blacklist r820t

To save and exit the file, enter “:wq” (colon followed by the letters w and q). You should now be back at a terminal. Next let’s make multimonNG. Enter the following commands to move to that directory, make a build directory, and compile.

cd ~/multimonNG
mkdir build
cd build
qmake ../multimon-ng.pro
sudo make install

That should be it to make multimonNG. Next let’s do the same with kalibrate and then reboot again.

cd ~/kalibrate-rtl
git checkout arm_memory
sudo make install
sudo reboot

Following the reboot, we should have everything configured correctly to begin calibration of the SDR. Since these TV dongles are cheap, it takes some tuning to get them working correctly. We are going to run the “kal” command to try and calibrate the system against the GSM telephone network. For this we need to set our SDR to a high gain and estimate the error. For me, a gain of +49.6 dB and an error of 56 were required to get it to work. I ran the following command, and a similar gain and error should work for you. It will take a few minutes for it to detect all the available channels. Take this time to get a soda or let the dog out.

kal -s GSM900 -g 49.6 -e 56

You should see a list of GSM channels detected. Select the one with the highest signal strength. This will ensure the SDR has a good signal to calibrate against. For me in Gainesville, Florida, channel 29 was the best. Run the “kal” command again to get a specific error. Record this value as we will need it later. This too might take a few minutes. Probably time to let the dog back in.

kal -c 29 -g 49.6 -e 56

Now it’s time to bring the system together with pymultimonaprs. Running the following commands to install the python code and open up the configuration file. Note that “chmod” changes the characteristics of a file. For example, the option “+x” enables execution.

cd ~/pymultimonaprs
chmod a+x setup.py
./setup.py build
sudo ./setup.py install
sudo vim /etc/pymultimonaprs.json

You should now see long file with various fields you will need to update. Just like before, enter “i” (the letter i) to edit the file. Use the arrow keys to move around. You will need to set the exact error you recorded before, the frequency of 144.390 MHz (if in the USA), gain of SDR (like we did with “kal”), your longitude and latitude, callsign (you can search online for the numbering scheme, but YOURCALLSIGN-1 is good for an iGate), and APRS password. If you need to generate a password, see below. To save and exit the file, enter “:wq” (colon followed by the letters w and q).

Since I do a lot of APRS, I already have a password, but if you need to generate one, it is simple. From the terminal (you can open a new one if you have the pymultimonaprs.json file open in your current terminal). Type the following command with your FCC callsign where it says CALLSIGN.

python keygen.py CALLSIGN

Great, now you have your iGate configured. To start it type the following command.

pymultimonaprs -v

Congrats! The system should be up and running!

WP_20150713_001Now comes time to test. You might see packets coming through if you live in a populated area. Another option is to use a beacon. I have set up a quick beacon with an inexpensive 2 meter radio and Android phone running APRSdroid. You can see a picture of my beacon, right. For testing, I generally send a packet every few seconds. In practice, this can be taxing on the network and should be slowed down when deployed.

Packets should appear in your terminal as it is running. To see if your gate is properly added to the the network, you can go to http://apris.fi and search for your callsign. Since it logs your location, if you are not comfortable with it posting your exact location, you can edit your longitude or latitude to introduce a bit of error. (Although it is worth noting that the FCC database is public and looking up your callsign will reveal where you live.)

The range of you system will depend on the antenna you have, how high the system is, the terrain around your iGate, etc.

WP_20150804_002I have mine in a 2nd story apartment (of a 3 story building) running on a 2 meter portable J-Pole antenna. You can see what I am on running on the image, left. I get about 3 miles range with my beacon. If the transmitting station has more power, I get more range and have picked up aircraft and cars traveling. I had nearly 5 miles of signal from a car running 40 watts a few days ago. I also received a packet from an iGate in Ocala.

The system is far from ideal, but for a project costing under $75, I consider this a great success. I could improve the setup with a 50 ohm to 75 ohm matching network between the antenna and SDR. (The cheap SDRs are made for TV which uses 75 ohms.)  We do have a [sometimes] functioning 50 watt digipeater in town at W4DFU. The digipeater should add a good bit of range to my setup.

Hopefully you found this tutorial helpful and join the APRS network. It is a great “getting started” project for radio and embedded Linux.

  1. Keith Weisz says:

    Tony, Thanks much for the very good tutorial. I used it to setup my Pogoplug/rtl-sdr. W3ISZ 73

  2. Keith Weisz says:

    Andrew, I don’t know where I got “Tony”. Sorry. W3ISZ 73

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s