Create a Receive-ONLY APRS iGate on a Raspberry Pi
Use a cheap SDR dongle and a Raspberry Pi to make a receive-only APRS iGate in an hour
This document was first created on Feb 9, 2021. It was last updated on Feb 13, 2021. Linux is pretty stable and these steps should not vary much for several years, but obviously there's no guarantee of that. I'm assuming the audience for this will include people with no Linux experience so please don't take the overly detailed steps and explanations in some sections as condescension on my part. Much credit and gratitude goes to the various resources I found online creating this. Anyway, I don't tend to write how-to documents often but I feel there's a need for this one so here goes. ~Reg Natarajan VA7ZEB
Table of Contents
Why Build An iGate?
APRS is a useful system, especially in emergencies in which the cellular system fails or when you're out of range of cellular service (or if you lose/break your phone for that matter). In such cases, APRS lets you send out emails, SMS texts and direct messages using ham radios. APRS also provides a location-reporting service that shows your position on some excellent web-based map front-ends like aprs.fi and aprsdirect.com. This could save your rear-end in an emergency where rescue people need to be sent to your exact location.
The challenge we have with APRS is that, for it to work, there need to be iGates everywhere and there aren't right now. In this document, I'm hoping to show people how to easily build and configure a cheap iGate that will contribute to the APRS system's infrastructure. If even a tiny percentage of ham radio operators did this, APRS would have remarkable coverage just about everywhere.
What Will You Get If You Follow These Steps?
You will get one of these.
It's a fully self-contained APRS receive-only iGate that will accept beacons from anyone on the standard APRS frequency of 144.390 and send them to APRS-IS where they will be displayed on pretty maps on Internet front-ends like aprs.fi and aprsdirect.com. It will also receive encoded APRS messages on 144.390 and relay them to APRS-IS so people in your area can use their radios to send emails and SMS texts to anyone.
It won't be huge or ugly. The only wiring it will have is the power cord, and you will be able to hide it just about anywhere. I'm going to hide mine in a flower pot on the balcony with the power cord nicely hidden along the railing. Obviously I'll need to get a bit creative to make sure water stays out but that's for another how-to that I doubt I'll ever write.
What you won't get is a bidirectional iGate that will send messages back to the radios in the field. While what would be nice, this is still 99% as useful and is vastly simpler, easier and cheaper to build and configure. Let us not make perfect the enemy of good.
Being frugal, we're going to make this happen using an inexpensive Raspberry Pi, an inexpensive SDR, an inexpensive antenna and a bunch of free software. We're going to build a Pi, install Raspbian (now called Raspberry Pi OS), then install Direwolf and the Linux drivers for the RTL-SDR. We're not going to use any other software at all. We're going to configure Direwolf to relay APRS beacons and messages to APRS-IS and to beacon the iGate itself at regular intervals. We're going to configure the iGate to be accessed from your home computer via VNC so that, after you hide it wherever you're going to hide it, you can still get to it and control it from your main PC. We're going to set it up so that it survives reboots and resumes operation without requiring any human action. We're going to set it up to update itself nightly with any new software upgrades and/or security patches and to reboot itself nightly to keep itself fresh. We'll even do a bit of hacker-proofing. It should take about an hour or two to do all of this (including the build of the Pi).
What You'll Need To Buy
These are the parts I purchased and used for this project in Feb of 2021. You can substitute equivalents for any or all of them. Please note that my links are to Amazon Canada because, obviously, I'm in Canada. All of these parts are easy to purchase in most countries.
You'll also need a reasonably fast Micro SD card and reader which most of us have lying around so I haven't bothered listing them below. You will obviously also need a monitor, keyboard and mouse, but you can just temporarily steal those from your home computer while working on this project. You won't need them for long.
Note that you don't need to do this on a Pi. While I haven't tried it, I see no reason this approach wouldn't work on any Debian-based Linux including Ubuntu or Mint. If you have an old computer lying around, use it. Keep in mind it probably won't hide as well as a Pi.
Raspberry Pi Case
MicroHDMI to HDMI
Build your Raspberry Pi
I'm not going to cover this part other than to say if it takes you more than 10 minutes, you're doing it wrong. Using the parts I listed above, I unscrewed the case (four screws), plopped the Raspberry Pi motherboard in, re-screwed the case, connected the fan and that was it. If you're not sure how to connect the fan, there's a good image here. If you have issues, YouTube is your friend.
Let's assume you've got yourself an assembled (but not booted) Raspberry Pi. Make sure your SDR dongle is plugged in to a USB slot on the Pi and your antenna is connected to the SMA female connector on the SDR dongle.
Create a Raspbian Micro SD-Card And Boot Your Pi
I know, I know, it's called Raspberry Pi OS, now. How catchy. I'll come around eventually. Whatever you choose to call it, you're going to need it.
To get it you're going to have to download and install the Raspberry Pi Imager on your home PC (preferably Windows) from this page. Choose Raspberry Pi OS (still 32 bit sadly), choose your SD card and hit Write. It's slow. Be patient.
When you're done, put your Micro SD card in your Pi, connect a monitor, keyboard and mouse, then give it power. Your Pi will boot up and you can start on the software part of your project.
IMPORTANT: For the next few steps, if you only have one monitor you're going to need it for your Pi so you might have trouble following the steps of this document. Not to worry. I have formatted this document so it works on most phones. Just load it on your phone and you can follow the next few steps from there.
Configure Your Pi on First Boot
When your Pi boots for the first time, it's going to ask you a bunch of questions. Your country, your language, etc. If you don't know those things, perhaps building an iGate shouldn't be your top priority. Choose a password you'll remember. Get it connected to Wifi. Let it do its software update. Let it restart. When it comes back, you should see a desktop that looks roughly like this.
IMPORTANT: I am told that newer versions of Raspberry Pi OS now prompt for a user name instead of defaulting to the name "pi". You can either choose the name "pi" and the instructions below will work as written, or if you choose another user name, just change any instances of the user name "pi" below to whatever you chose.
Set Up Your Pi For Remote Access
Don't skip this part. I know it's tempting to but you'll regret it. The whole idea of a tiny little iGate is that you can hide it somewhere and let it run headless (no monitor, keyboard or mouse). Well, if it ever needs attention (which it will, computers being what they are), it'll be much easier to fix whatever went wrong if you can just do it from your home PC rather than digging the Pi out of wherever you've hidden it, connecting a monitor, keyboard and mouse, only to click "ok" on whatever error is on the screen.
First, get your local IP address. There are many ways to do that but this is the method I generally use. If you prefer a different way, do that. If not, click on the terminal and then type ifconfig (and enter of course) in the black window that pops up.
The information displayed by ifconfig will contain your IP address. It will probably start with 192.168. It is definitely not the 127.0.0.1 loopback address. Jot your address down or remember it for future reference. You will need it shortly (and later every time you need to tend to your iGate so save it however you save things).
Note 1: You need your local IP, not your public IP. Don't use sites like whatismyip.com as those return your public IP.
Note 2: Technically this address could change since it's DHCP at this point. If you're worried about that, Google how to assign a static IP to a Raspberry Pi and do that. Personally, I find small DHCP networks to be quite stable when it comes to unnecessarily changing IP addresses and I just leave it as is.
Now tell your Pi to accept connections on VNC. Click the Raspberry at the top left, then Preferences, then Raspberry Pi Configuration.
On the resulting pop-up window, click Interfaces and put a tick in Enable on VNC. While you're in here, you might want to click System and change the computer name to something that suits you.
Click OK when you're done but don't reboot.
Now we need to specify a screen resolution. Normally your Pi will just detect the resolution of whatever monitor you have plugged in, but we want to run it without a monitor so if you don't specify a resolution, it will default to an unusably tiny rectangle to save resources.
Load up another terminal and type sudo raspi-config (and enter). Chose Display Options, then Resolution and choose something that suits you. I like to set it to 1280x1024 so that it is a nice usable window on my 1920x1080 screen but choose whatever you're comfortable with. Be sure you see the confirmation message that your resolution has been changed. Choose Finish but do not reboot.
Now it's time to put your Pi in its permanent home. Don't skip this as VNC will look funny if you leave your monitor connected (the monitor's native resolution will override whatever you set in the step above). You also need to be sure your Pi won't have issues running headless. We'll do the rest of the steps in this document from your home PC using the VNC you just configured. In your terminal window, type shutdown -h now and hit enter. Wait a minute and your Pi will shut down. Now, unplug the USB power from your Pi. With the power unplugged, now unplug the monitor, keyboard and mouse, and then move the Pi to wherever you plan to keep it permanently. Finally, plug only the USB power back in. At this point, your Pi is operating "headless", without a keyboard, mouse or monitor.
Finally, we need to go to your home PC and download/install VNC Viewer which you'll find on this page. Once installed, run it and create a New Connection. Enter the IP address you jotted down a few steps ago, give the connection a nice name, click Ok and then double click it to connect. You'll be prompted for a user/password. Enter pi as the user and whatever password you entered on initial setup. If you click "save password", you won't be prompted again on subsequent connections to your Pi.
You should now see your Pi as a window on your main computer's screen. From now on, whenever you need to work on your Pi, just load up VNC Viewer and double click the connection you saved. Again, all the remaining steps in this document will be done from inside a VNC window.
IMPORTANT: Your home PC needs to be on the same network as your Pi for this to work, otherwise you're going to have to get into forwarding ports on your router and opening ports on your firewall.
Install Direwolf and the Linux SDR Drivers
You should see your SDR dongle listed as follows.
Don't worry if you see a few lost bytes when you first run it. It should stabilize quickly and not show any more lost bytes. If you keep seeing significant numbers of lost bytes pop up on your screen after the first few seconds, you may have bad hardware. Once you're satisfied, type ctrl-c to terminate the program.
Configure your iGate
Copy/Paste the following command into a terminal window.
Copy/Paste the following brown text into the Nano editor. Note that lines starting with # are just comments that don't affect anything. You can paste them safely. They won't harm anything.
IMPORTANT: Change YOURCALLSIGN to your actual call sign. Change YOURPASSCODE to your actual passcode. If you don't have a passcode, get one here. Change your latitude and longitude to your actual coordinates (just right click on any point in Google Maps and it'll tell you the lat/long). If you're not in North America, change the IGSERVER to one of the alternatives listed below.
When you're done with your changes, type ctrl-x to exit and then y to save. Hit enter when it asks you to confirm the file name.
Create A Script To Run Your iGate
Copy/Paste the following command into a terminal window.
Type ctrl-x to exit and then y to save. Hit enter when it asks you to confirm the file name.
You also need to make the file executable. Copy/Paste the following command into your terminal.
chmod +x ~/igate.sh
Now, finally, you get to run your iGate! Copy/Paste the following command into your terminal.
After a 30 second pause, you should see this.
Test your iGate by beaconing some APRS with any APRS-capable radio. You should immediately see the packets in your iGate window. They should also show up almost immediately on aprs.fi.
AutoStart Your iGate Whenever Your Pi Boots
Type ctrl-x to exit and then y to save. Hit enter when it asks you to confirm the file name.
Test it. Reboot your Pi by typing reboot into your terminal window. VNC will disconnect, of course, but it should reconnect automatically as your Pi boots and your iGate should run automatically after 30 seconds.
Configure Automatic Software Updates
Configure Automatic Nightly Reboots (optional)
Type ctrl-x to exit and then y to save. It should say "crontab: installing new crontab".
Protect Against Hackers With fail2ban (optional)
You've done it. You've built, configured and tested your APRS receive-only iGate. Your final product should look like this.
Put it somewhere safe with as much exposure for the antenna as you can manage, test that VNC still works, and boast to all your ham friends about how cool you are, because you really are. APRS only works if people like you deploy iGates and you've done your bit for the community today.
Link your ham friends to your iGate on aprs.fi and I bet they'll be jealous of you. If they do happen to be jealous, please consider sharing this document with them. Let's get as many iGates out there as we can. I'd prefer that you link to my site because I intend (ok, hope) to keep this document updated here as much as possible, but I release everything I post here to the Public Domain so use it as you see fit.
Error reports, typo reports and bug reports are very welcome. Please email them to me at firstname.lastname@example.org.
I also belong to some of the large APRS and BC/Canada ham groups on Facebook. Those groups are great places to get individual advice and support from the community. You can find my FB profile here.
I hope this has helped you.