I’ve been developing iGates (internet gateways for amateur radio APRS messages) for a few years. The first version (now known as the Mk I) used the OLPC XO-1 and a radio. I built a bunch of these for people. I then tried using the XO-1 with the SDR (software defined radio) in place of the radio. The SDR is a USB device which receives a broad spectrum of radio waves and it is up to software to pick out the useful stuff. It worked but not very well. As the OLPC computers started to become scarce (or expensive) I redesigned the iGate to use a Raspberry Pi – hence the piGate (now known as the Mk II). These still used a radio. My ultimate goal was a very low power, inexpensive iGate. I finally have it!
I introduce the rpiGateSDR Mk III (a title coined by the recipient of the first of these to escape into the wild).
The new model using all new software. This resolved the performance problems and hard to source older SDR (with an E4000 chip). Additionally, a new generation of SDR (with an R820T2 chip) came on the market last year with slightly better noise filtering and marginally getter reception.
DISCAIMER: If you are not comfortable with basic Linux commands and you don’t know if you have an SSH nor where to find one, then this project probably isn’t for you.
Assuming you are still reading, let’s get to the project!
Here is my shopping list (with several options):
- Raspberry Pi 3 (you can also use a Raspberry Pi 2 if you already have one)
- case (the truly adventurous could 3D print a case that will hide everything)
- 5V power adapter
… or get the above as a starter kit
+ plus +
- micro SD card
- HDMI cable (optional but helpful)
… or get all of the above as an even more complete starter kit
+ plus +
- USB SDR (recommended newer R820T2 chip)
– or –
- USB nano SDR
… or get everything above as an uber kit (originally designed for the Stratux ADSB project but all of the parts are the same for the iGate)
+ plus +
- antenna BNC adapter or 1 antenna SO239 adapter
Depending on what pieces you need, the above can run to $85. If you need everything, I’d suggest the uber kit and the appropriate antenna adapter/pigtail will connect the iGate to your antenna.
That reminds me, you will need a good antenna. There are many options but I suggest a J-Pole. I picked one up from KB9VBR. There are now a few vendors selling on eBay or elsewhere on the internet for similar or less money. If you are need something a bit more flexible, you will lose a little efficiency but a Slim Jim J-Pole is a good option.
For the truly adventurous (or cheap), you can build this iGate with parts from AliExpress and save up to 50% and waiting 3 weeks for stuff to come from China. This uses the $15 Orange Pi PC and a $7 knockoff SDR which still uses the R820T2 chip.
OK, that’s all of the parts. Now what do you do with them?
The piGateSDR Mk III consists of Raspbian, the rtlsdr library, and DireWolf. There are instructions for manually creating the iGate on GitHub. To that work, I added a web server for monitoring the traffic and made the whole system read-only so it will be resilient to power failures.
I’ll assume you don’t want to be bothered with that and just want to download a complete image. (It tuned out the image was not compatible with an RPi1 or an OPiPC, or …. well, you get the idea, not to mention I continue to tweak the code so the image is no longer current or available.)
Once you have downloaded the compressed image (approximately 380MB), unzip the file. Write it to a microSD card which is at least 4GB. (On Windows computers, I use Win32 Disk Imager).
The only things you MUST change are in the /etc/direwolf.conf file. You need to change your callsign, APRS passcode, and the latitude / longitude of the location where the iGate has been installed.
Here is what the direworlf configuration file looks like:
# # Configuration for SDR read-only IGate. # LOGDIR /var/log/direwolf # We might not have an audio output device so set to null. # We will override the input half on the command line. ADEVICE null null CHANNEL 0 MYCALL N0CALL-0 # First you need to specify the name of a Tier 2 server. # The current preferred way is to use one of these regional rotate addresses: # noam.aprs2.net - for North America # soam.aprs2.net - for South America # euro.aprs2.net - for Europe and Africa # asia.aprs2.net - for Asia # aunz.aprs2.net - for Oceania IGSERVER rotate.aprs.net # You also need to specify your login name and passcode. # Contact the author if you can't figure out how to generate the passcode. IGLOGIN N0CALL-0 000000 # That's all you need for a receive only IGate which relays # messages from the local radio channel to the global servers. PBEACON sendto=IG delay=0:30 every=15:00 symbol="igate" overlay=R lat=00.000000 long=-00.000000 COMMENT="optional message text here | DireWolf 1.3 on RPi+SDR"
You will first need to find the IP address of the Raspberry Pi. You can use a number of techniques. I use an App on my smartphone called Fing. You can also find it by looking at the device list of your router. (On my old Actiontec, it is listed under Gateway Utilization as LAN Device Session Log).
WARNING: The image is very unsecure. The root account password is ‘root’. I strongly suggest you change it.
You will need to SSH into the Raspberry Pi to make a few changes.
The image is distributed as small as possible, the initial partition has been minimized. The first task is to expand the micro SD card. You will you need to make the SD card writeable using the ‘rpi-rw’ command. Next, use the ‘raspi-config’ command to start the configuration tool and choose the ‘expand filesystem’ option. When you finish it will prompt you to reboot. Once it reboots, you will need to log in again and use the ‘rpi-rw’ command again since the pigatesdr always starts in read-only mode.
PITA ALERT: After the reboot from expanding the filesystem, use the command ‘df’ and look at ‘/dev/root’ and the value for ‘Use%’. If it still shows 100%, then you need to use the command ‘resize2fs /dev/mmcblk0p2’ to force the expansion of the filesystem and then reboot again.
At this point, you should be connected to the raspberry pi via an SSH connection, logged in as ‘root’ and enabled the SD card for edits using the command ‘rpi-rw’.
Stop the iGate program using the command ‘/etc/init.d/direwolf stop’ and you should see the message “Stopping direwolf”.
You need to edit the iGate configuration. Use the command ‘nano /etc/direwolf.conf’ (here is a nano editor cheat sheet). Time to make this iGate your own:
- change MYCALL to replace N0CALL-0 with your callsign followed by a suffix (this needs to be changed in two places(
- change IGLOGIN N0CALL-0 000000 to your callsign and suffix and your passcode (use this passcode generator)
- change PBEACON ‘lat=’ and ‘long=’ values to be the location where the piGateSDR is physically installed
- change PBEACON to edit or remove the ‘optional message text here’ (some examples include: the URL for an associated website, a frequency that gets monitored, or the name of a club or group which maintains the iGate)
You may wish to determine any error in your SDR. Most SDR’s have a small amount of error which can be compensated using a PPM (parts per million) correction. To test your SDR, use the command ‘rtl_test –p’ and let it run for at least two minutes. IT will average the error and give you a PPM value for your dongle.
You need to edit ‘/usr/sbin/direwolf.sh’ (seen below) and change the value of ‘20’ following the ‘-p’ option to use your specific PPM value.
root@pigatesdr:~##! /bin/sh mkdir -p /var/log/direwolf rtl_fm -f 144.39M -p 20 -o 4 - 2>/var/log/direwolf/rtl_fm.log | direwolf -c /etc/direwolf.conf -t 0 -n 1 -r 24000 -b 16 - 2> /var/log/direwolf/error.log 1>/var/log/direwolf/output.log &
Once you are finished, return the SD card to read-only using the ‘rpi-ro’ command.
Now reboot using the ‘reboot’ command and you are ready to start gating APRS messages!
FYI: the piGateSDR has a built-in web server which you can reach by entering its IP address into a web browser on your network.
One last thing – if you want to have a static IP address, I recommend you use the DHCP reservation feature of your router rather than attempt to change the network settings on the Raspberry Pi. This way, the piGateSDR will be accessible even if you move it to a different network.
UPDATE (04-Jun-2016): I found an issue with logging. When the iGate runs more than a couple days without a re-boot, the RAM disk used for logging overflows and the iGate will stop working correctly. I’ve changed the log rotation schedule to retain less log data. I will update the image link above. When the new link is ready, I’ll add a new update notice here.