A guide to setting up an APRS receive only iGate using a Raspberry Pi and an RTL-SDR dongle

I originally bought a Raspberry Pi back in October 2012 but as I didn’t have a specific purpose in mind for it, I quickly sold it again.  A few months ago I decided to play around with a Pi again and bought the latest model. Since then I’ve found a few uses including an ADS-B aircraft tracker and an adblocker for my whole house. In fact I’ve become quite fond of these little devices and now have a small fleet of them!

I’ve been looking at other things I can do and I tried a NOAA weather satellite receiver which, although it worked wasn’t particularly great with the aerial I used and I really didn’t need to put another antenna up outside.  I also looked at a 137MHz ship tracker but the less said about that, the better.

One thing I thought might be interesting to try was a receive only APRS iGate using a Raspberry Pi and cheap RTL-SDR dongle so I’ve set one up and it’s working really well.

I found everything I needed in two guides which are both very well written although there’s more in them than you need so I’m going to reproduce exactly what I did here.
Please note – I am not claiming originality for these instructions, I’m simply following what’s already available out there on the internet.  My two source documents are Raspberry Pi SDR IGate and Raspberry Pi Packet TNC.  I thoroughly recommend you download them both as they go into a lot more detail than just listing the commands.  It’s also worth grabbing the full Dire Wolf user guide.

If you want a pre-built image for this setup which only requires you to edit a maximum of three files, see my more recent blog entry here.

You will need a Raspberry Pi and an SDR dongle.  I’ve been using an RTL-SDR R820T2 RTL2832U 1PPM TCXO SMA Software Defined Radio (Dongle Only) device which is the latest model, complete with TCXO.
I have this running successfully on the smallest and cheapest Raspberry Pi currently available – The Raspberry Pi Zero.  I bought my Zero from Pimoroni along with a three port USB/Ethernet interface which ironically costs more than double the price of the actual Raspberry Pi Zero.  Typically the CPU usage sits around 30-35% on the Zero.

First download install your operating system.  I used the full latest version of Raspbian Jessie from here and the installation guide from here.  Because we’re going to be doing this install entirely by command line, before you plug the card into your Raspberry Pi, you’ll need to create a file called ‘ssh’ on the card to enable remote access.  In my case, on my Mac I simply right clicked on the mounted SD card, selected Services/New Terminal at Folder and then at the prompt typed the command
sudo touch ssh
I was then asked for my password, this created the file and I moved the SD card into my Raspberry Pi.

You will need to know what IP address your Raspberry Pi has on the network.  I do this by looking at my router and checking what devices have connected and then set up a DHCP reservation so each particular Raspberry Pi I own will always have the same address each time it reboots.

The next thing to do is some basic housekeeping which I do on all new installations.  Open up a terminal/dos prompt or whatever client software you’re going to use to connect to the Raspberry Pi and log in.  In my case, the Raspberry Pi is on so I use the command
ssh pi@
The default password is raspberry, one of the first things to do is change that via the Raspberry Pi configuration utility which you run now using sudo raspi-config

This is what you see when you open the config utility.

The Raspberry Pi software configuration tool

The Raspberry Pi software configuration tool

Select option 1, select OK and you’ll be returned to the screen above.
Select option 2 and following the prompts, change your password.
Select option 3 and first choose Desktop / CLI and then Desktop Autologin.  This is important because without this, the iGate will not be able to start automatically when you reboot the Raspberry Pi.
Select option 4 and configure your Timezone and Wi-fi country.  I generally don’t bother with Locale and Keyboard Layout.
Select option 7 and then choose Hostname.  Give your Raspberry Pi a name other than the default.

Once all these changes are done, use the tab key to move down to <Finish> and hit enter.  You’ll be prompted to reboot the Raspberry Pi.

The next thing to do is to make sure the Raspberry Pi software is fully up to date.  Issue the following commands:
sudo apt-get update
sudo apt-get dist-upgrade

Depending on which model Raspberry Pi you have and how old the image is, this may take some time to complete.
Then remove the Wolfram engine using the following three commands:
sudo apt-get purge wolfram-engine
sudo apt-get clean
sudo apt-get autoremove

Once this is all complete, reboot the Raspberry Pi and you’re ready for to start the actual installation.
sudo reboot now

Remove pulseaudio and reboot.
sudo apt-get remove --purge pulseaudio
sudo apt-get autoremove
rm -rf /home/pi/.pulse
sudo reboot now

Log back in and install the sound library.
sudo apt-get install libasound2-dev

Download the Dire Wolf source code.
cd ~
git clone https://www.github.com/wb2osz/direwolf

Compile and install Dire Wolf.
cd ~/direwolf
sudo make install
make install-rpi
make install-conf


This will fail with the following error because you haven’t configured any audio devices.

Now it’s time to install the software for the RTL-SDR dongle.
sudo apt-get update
sudo apt-get install cmake build-essential libusb-1.0-0-dev
cd ~
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
sudo make install
sudo ldconfig

Now you need to complete the final configuration.  Use the APRS Passcode Generator at Magicbug to get your own passcode.
cd ~
sudo nano sdr.conf

On line eight, change the xxx to your callsign and required SSID.  I use -10 as my SSID so this line reads MYCALL G6NHU-10
In the section below, edit the line starting with IGSERVER to be the correct one for your region.  I’m in Europe so my line reads IGSERVER euro.aprs2.net
Scroll further down and you’ll find a line that starts with IGLOGIN.  Change the xxx to be the same as the callsign you entered above (including SSID) and then change the numbers 123456 to the passcode you obtained from the APRS Passcode Generator.

You now need to add an extra line at the bottom of the file.
PBEACON sendto=IG delay=0:30 every=15:00 symbol="igate" overlay=R lat=xx.xxxxxx long=yyy.yyyyyy COMMENT="zz iGate | DireWolf 1.3 on RPi+RTL-SDR"

Note that although it’s spanned over two lines above, you should enter this as one continual line in your file. Replace xx.xxxxxx with your latitude, yyy.yyyyyy with your longitude and zz with your callsign (including SSID). Be aware that there is a space between the lat and long values.

sudo reboot now
If you don’t reboot, you’re going to get errors.
It’s now time to test this.
Enter the following command (144.800 is the APRS frequency in the UK, change as required).
rtl_fm -f 144.80M - | direwolf -c sdr.conf -r 24000 -D 1 -

If all is well, you should see something like this.

Initial test of the Raspberry Pi and RTL-SDR Dongle APRS RX only iGate

Initial test of the Raspberry Pi and RTL-SDR Dongle APRS RX only iGate

You can see that it’s started up successfully, connected to euro.aprs2.net and I’ve already received an APRS packet from M0SDJ-9 relayed through MB7UH.  The magenta text shows that my own beacon has been sent to the internet and I can check that by searching for G6NHU-10 on aprs.fi.

If you’re using a Mac and connecting to your Raspberry Pi via the terminal you may notice the screen flashes badly.  You can fix this easily and quickly by going into the terminal Preferences/Profiles and make sure the box “Allow blinking text” is not ticked.

The last thing to do is to set everything to start automatically when you restart the Raspberry Pi.  To do this, edit dw-start.sh
cd ~
sudo nano dw-start.sh

Scroll down and look for this line

Edit it to remove the hash at the start and change the frequency to whatever is appropriate in your area.  In the UK, APRS is on 144.800 MHz so my line looks like this

Save the file and then run the following command to make the script executable.
sudo chmod +x dw-start.sh

Finally, add a line to cron which will run once a minute to check whether Dire Wolf is running and if not, it will restart it.
crontab -e

If this is the first time you’ve edited the crontab, you’ll get a prompt asking which editor to use – Just hit enter to select nano as the default.

Scroll down to the bottom and paste the following line.
* * * * * /home/pi/dw-start.sh >/dev/null 2>&1

Reboot your Raspberry Pi and once it’s restarted, it will automatically connect to the APRS network and operate as a receive only iGate. Nothing will be echoed to the display while it’s running like this so you can check the status on aprs.fi.

I hope this guide is straightforward enough to follow – It looks more complicated than it actually is, it’s really quite simple just to follow all the steps through.

This entry was posted in Amateur radio, APRS, Data, FM, Raspberry Pi, VHF and tagged , , , , , , . Bookmark the permalink.

19 Responses to A guide to setting up an APRS receive only iGate using a Raspberry Pi and an RTL-SDR dongle

  1. I have previously had a bash at Pi APRS
    But I found the dongle rather deaf and frequency unstable. I had plans to try and improve it, but that never happened…
    I also experimented with bandwidth options in rtl_fm which seemed to reduce noise, as we only need a spot frequency.
    Seeing your walk through and options for a much better £20 dongle I am going to give this another go! Thanks!

  2. g6nhu says:

    Hi Nicolas,
    The newer dongles with the 820T2 chipset seem a lot better, the TCXO versions are much more stable and I’ve not had to adjust the frequency of mine at all. I’m receiving stations over fifty miles away using a collinear at about 30′ AGL so it doesn’t seem deaf either.
    I’ll be interested to know how you get on if you try this with a newer dongle.
    73 Keith.

  3. Just been installing… Your instructions worked fine. I wanted to do it from scratch again as it reminds me what is where, and any other issues I hit along the way get understood. I used the Jess-Lite image as a basis I only had to enable SSH(!) as this is now disabled by default and install Git as this is not included in the Lite install. The shortcuts to the desktop failed – as there is no desktop!
    All seems fine. Started with an old dongle but will order a new one. Hopefully the beacon for M3NQG (my brothers station) will show up on aprs.fi shortly

  4. g6nhu says:

    I’m pleased it’s working for you but that does raise an interesting question – If Jessie Lite doesn’t come with a desktop, how are you able to set the startup options in raspi-config to select Desktop Autologin? Without that, the script to start on reboot doesn’t work – Or at least it doesn’t on the full Jessie install.
    With my downloadable image, I’ve removed a lot of stuff to make extra space so that there’s plenty of space left, even on a 4Gb card.

  5. That is the issue I have just had… Jessie Lite is probably just making things hard for myself, as this Pi is only going to be “single task”. I have set auto login for console.

    You are absolutely right the startup script relies on X being installed. If not the script cannot start a window to run the direwolf task in.

    I amended the startup script
    # Adjust for your particular situation: gnome-terminal, xterm, etc.
    bash -c ‘rtl_fm -f 144.80M – | direwolf -c sdr.conf -r 24000 -D 1 -‘

    I doubt this is optimal, but it does at least beacon.

    All shows up on APRS.fi Next step is to see if I can get a packet through with my current RTL and local Kenwood D7!

    • Collin - KE0IYN says:

      The smartest way to do this, and what I’ve done on mine (and it seems to work just fine) was to adjust the script to be:

      screen -dm -S direwolf bash -c ‘rtl_fm -f 144.80M – | direwolf -c sdr.conf -r 24000 -D 1 -‘

      It requires screen to be installed on the system, but then it’ll automatically start it in a session that you can attach to later (via screen -r direwolf) to view its behavior, but doesn’t require any of that display stuff.

  6. I adjusted the rtl_fm config with -p38 then sent test packets from my D7 which where plotted. Now I just need a better RTL dongle and get everything setup back at it’s old home!
    Do you know what the “Official” iGate symbol is?

  7. g6nhu says:

    Excellent glad you’ve got that all working.
    Regarding the symbol, what I’ve set in the config file is correct for an RX only iGate.

  8. Thanks! It will be properly up and running soon.

  9. NooElec-NESDR-SMArt Dongle arrived to today. Now all setup and running as M3NQG-10

  10. I ordered another NooElec-NESDR-SMArt Dongle took awhile to arrive, but yesterday I setup M1HOG-10 to further test the dongle/antenna options. All configured fine.
    It seems using the RTL_FM software you can reduce the bandwidth to 12k – which I guess might be some improvement and set the gain manually?
    I wonder if you had any further thoughts on how to optimise the Packet RX?

  11. Hi,
    Well, if I find any further improvements I will let you know. Always keen to improve the station..
    Thanks again for the write up!

  12. Andy G7UHN says:

    Keith, thanks for a nice clear guide. Thanks to your page I set this up within a couple of minutes on a BeagleBone Black that I was already using for RTL-SDR duties (all I had to do was install and configure direwolf, missing out the “make install-rpi” line). Great stuff, 73

  13. Grover K7TP says:

    Seems to work mostly but I am getting a ‘Connect to Igate … failed.’
    I do see that it tries to send but is not being received happily at the other end apparently.

  14. Grover K7TP says:

    I am getting this error which I don’t understand:

    Reading config file sdr.conf
    Audio input device for receive: stdin (channel 0)
    Audio out device for transmit: null (channel 0)
    Found 1 device(s):
    Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, E+, 24000 sample rate.
    Note: PTT not configured for channel 0. (Ignore this if using VOX.)
    Bind failed with error: 98
    Address already in use
    Some other application is probably already using port 8000.
    Try using a different port number with AGWPORT in the configuration file.
    Bind failed with error: 98
    Address already in use
    Some other application is probably already using port 8001.
    Try using a different port number with KISSPORT in the configuration file.
    Use -p command line option to enable KISS pseudo terminal.
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    • g6nhu says:

      Grover, that looks as though you’ve already started the application, as though you’ve edited crontab and then tried to run it manually as well. It’s one or the other, not both.

Leave a Reply

Your email address will not be published. Required fields are marked *