Configuring Xastir with RTL-SDR on Ubuntu Linux

Special Thanks go out to the authors of the following two blog posts without whom I would have had to have done most of this work by myself:

This post is mostly taking details from the above two sites, and merging them into a single, easy for me to find set of notes on how to get Xastir working with the RTL-SDR on a Debian/Ubuntu based Linux system. This will serve as the foundation of a future version that will be deployed on a Raspberry Pi3-B, configured with a 7" screen, and installed in my truck for mobile APRS tracking.

Here's a good screen capture of my Xastir map after running for about an hour.
Xastir Map

Blacklist Drivers:

cat << _EOF_ > /etc/modprobe.d/blacklist-rtlsdr.conf
blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist rtl_2830
blacklist rtl_2832
blacklist r820t
_EOF_

Install DVB-T dongle:

cd ~/src
sudo apt-get install git build-essential cmake libusb-1.0-0-dev
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DDETACH_KERNEL_DRIVER=ON -DEINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

Install MultiMon-ng Encoder/Decoder:
While your system is likely to have "multimon" in the software repo, you will need multimon-ng

cd ~/src
sudo apt-get install qt4-qmake libpulse-dev libx11-dev patch pulseaudio
git clone https://github.com/EliasOenal/multimonNG.git
cd multimonNG
mkdir build
cd build
qmake-qt4 ../multimon-ng.pro
make
sudo make install

Install RTL-SDR Kalibrate tool:

cd ~/src
sudo apt-get install libtool autoconf automake libfftw3-dev
git clone https://github.com/asdil12/kalibrate-rtl.git
cd kalibrate-rtl
./bootstrap
./configure
make
sudo make install

Run the Kalibrate tool (Take note of the PPM)
For me Channel 1 was the strongest. (In step 2, use the strongest channel)

kal -s GSM900
kal -c 1

Test APRS Reception:
The PPM value from the above step was about 50, so that's the value I'm using

rtl_fm -f 144390000 -s 22050 -p 50 -g 42.0 - |multimon-ng -a AFSK1200 -A -t raw -

If everything is working, you should see output similar to the following:

w9zeb@aprsstation:~/$ sudo rtl_fm -f 144390000 -s 22050 -p 50 -g 42.0 - |multimon-ng -a AFSK1200 -A -t raw -
multimon-ng (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
(C) 2012-2014 by Elias Oenal
available demodulators: POCSAG512 POCSAG1200 POCSAG2400 FLEX EAS UFSK1200 CLIPFSK FMSFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV SCOPE
Enabled demodulators: AFSK1200
Found 1 device(s):
0: Generic, RTL2832U, SN: 77771111153705700

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Tuner gain set to 42.10 dB.
Tuner error set to 50 ppm.
Tuned to 144643575 Hz.
Oversampling input by: 46x.
Oversampling output by: 1x.
Buffer size: 8.08ms
Exact sample rate is: 1014300.020041 Hz
Sampling at 1014300 S/s.
Output at 22050 Hz.
APRS: KF5JZT-2>S0QX8V,K5GJ*,WIDE1*,LAGRNG*,WIDE2*:`}Fl"vR/'"6!}|*A%,'s|!wnz!|3
APRS: W5ROX-3>APOT30,AUSWST*,WIDE1*,WIDE2-1:!3034.44N/09724.99W_009/000g000t079p000h70b10169T2WX
APRS: W5ROX-3>APOT30,AUSWST*,WIDE1*,LAGRNG*,WIDE2*:!3034.44N/09724.99W_009/000g000t079p000h70b10169T2WX
APRS: W5MF-7>S0PQ8Q,N5LUY-2*,LAGRNG*,WIDE2*:'{;il ;[/>"48}146.760MHz T103 -060Marty from Houston=
APRS: W5MF-7>S0PQ8Q,N5LUY-2*,AUSWST*,WIDE2*:'{;il ;[/>"48}146.760MHz T103 -060Marty from Houston=
APRS: NK5P-9>RYUQ2T,WA5GC*,WIDE1*,AUSWST*,WIDE2*:`~&xp!,k/`"6v}147.220MHz_%
APRS: KG5DWX-13>APN391,AUSWST*,WIDE2-1:@271617z3025.30N/09740.88W_000/000g000t084r000p000P000h76b10164.DsVP
APRS: KG5DWX-13>APN391,AUSWST*,LAGRNG*,WIDE2*:@271617z3025.30N/09740.88W_000/000g000t084r000p000P000h76b10164.DsVP
APRS: W5OEM-9>APRS,AUSWST*,WIDE1*:> Ver. 02SEP2006 - TCARES ARCHES System Online: www.tcares.org
APRS: KF5DMO>APTT4,AUSWST*,WIDE1*,WIDE2-1:>/TinyTrak4 Alpha

In order to feed the output from multimon-ng into xastir, you will also need the socat command:

sudo apt-get install socat

Now we're ready to fire up the RTL-SDR, with multimon-ng. We will redirect the output to the network on localhost:14580
Which is where we'll then point xastir to look for it's data.

w9zeb@aprsstation:~/$ sudo rtl_fm -f 144390000 -s 22050 -p 50 -g 42.0 - |multimon-ng -a AFSK1200 -A -t raw - | sed -u -r 's/.{6}//' | socat STDIN TCP-LISTEN:14580,reuseaddr,fork

Finally we need to launch xastir, and tell it how to find our APRS data. Launch xastir, and after the intial setup click: Interface --> Interface Control --> Add --> Internet Server Then select "Activate on Startup"
Deselect "Allow Transmitting (Your RTL-SDR is only a receiver afterall)" Set the host to "Localhost" Then click OK.
Finally you will need to select your new Internet server from the list, and click Start, or just click Start All.

Here's a "Potato Quality" photo of my Thinkpad X201i running Xastir, with a few stations plotted on the map.

Xastir-Thinkpad

There are several Weather stations in the area I can receive directly as well.
Weather Stations

If everything went well, you should start seeing stations appear on your map. Happy APRSing.