Building a Raspberry Pi internet watchdog

I wasn’t sure whether to post this or not as it’s not specifically amateur radio – But there’s a small amount of electronics involved so I figured it might be of interest.

A few days ago while Susan and I were out, I received a text from my son saying “I thought you’d like to know that the wifi isn’t working”.  What this actually meant was that our home internet connection had gone down. I recently changed my ISP and had been warned that for the first couple of weeks, there might be an occasional interruption to the service.  I know the router should automatically connect but sometimes that doesn’t happen.

I spoke to David and quickly determined that this is what had happened but that the router hadn’t automatically reconnected.  All he had to do was switch it off and back on again and it sprung back into life. This got me thinking that perhaps this could be a good use for a Raspberry Pi as a watchdog.

It didn’t take much investigation to find some basic Python code to check for the presence of an internet connection so I grabbed that and then looked into the hardware. I’ve not played with the GPIO before but it all looked pretty straightforward.  I didn’t have a suitable relay so decided to test this with just an LED playing the part of the relay so I could see if it worked.

First version of the Raspberry Pi internet watchdog

First version of the Raspberry Pi internet watchdog

The idea is that if the Raspberry Pi Zero W detects the internet has failed, it will trigger a relay and drop power to the router for a few seconds.  This first version worked perfectly and I tested it by pulling the internet connection from the back of the router.  After a couple of minutes, the LED flashed.  I was very happy with the way this worked and so I ordered a relay.

I wanted things to be a little more sophisticated though and started delving into the code.  I’ve only just started learning Python so this was a nice educational exercise for me.  It wasn’t long before I got things as I wanted.  At regular intervals the Raspberry Pi checks to make sure there’s a good internet connection and if not, it drops power to the router for ten seconds, brings it back up again and then pauses to allow the router to reboot and reconnect before checking again.

The relay I’d ordered turned up and I was able to set it up and prove everything working – Once again, it’s on breadboard and you can see the green ‘OK’ LED along with the red ‘fault’ LED, although that’s disconnected and the relay is in circuit showing that power is passing through.

Raspberry Pi internet watchdog being tested

Raspberry Pi internet watchdog being tested

I made sure to use the normally closed contact on the relay so by default it isn’t energised, it will only activate if there’s a failure so this means I can reboot the Raspberry Pi without killing my internet connection.  However there was a problem – Each time I restarted the Pi, it would click the relay and it took me a while to work out what was happening.  It turned out that my Python script was starting before the WiFi had initialised and connected to my network.  The script was seeing that as an internet error, going into a fail state and triggering the relay.  I resolved that by adding a delay to the cron command which started the script.

I decided to use an official Pi Zero case which has a hole in the top for the camera and to repurpose the hole for the green LED.  Sadly the hole was far too large for a 5mm LED so I picked up some 8mm LEDs.  Of course, the 8mm LED was too large for the hole!

Raspberry Pi Zero W case and 8mm LED

Raspberry Pi Zero W case and 8mm LED

It didn’t take much to enlarge the hole slightly so the LED would fit and before long it was glued in place.

8mm green LED in the Raspberry Pi Zero W case

8mm green LED in the Raspberry Pi Zero W case

While the glue was drying, I built the rest of the watchdog.  I actually used a different Raspberry Pi Zero W to the original one I had been testing with as I didn’t need the entire GPIO header, just needed to solder a few wires straight onto the board.  Here you can see the Pi mounted in the case with the wires for the relay feeding in through the bottom and soldered onto the board.

Raspberry Pi Zero W in the case along with the relay

Raspberry Pi Zero W in the case along with the relay

When the glue had gone off, I wired the LED to the GPIO pins and fitted it all together for final testing.

Finished Raspberry Pi Zero W internet watchdog

Finished Raspberry Pi Zero W internet watchdog

After this it was a simple job to integrate it into my setup.  My router has a standard DC power connector on the back so rather than destroy the manufacturer supplied power brick, I grabbed one of my many power cables, cut the positive wire, fed it through the relay, connected it all up and switched it on.

Raspberry Pi watchdog timer all set up and working

Raspberry Pi watchdog timer all set up and working

You can see I managed to catch it as it flashed the ‘OK’ signal.
The first time I started everything up with the router connected was a good test as it proved everything.  The Pi started before the internet had initialised so it saw a fault condition and rebooted the router, then paused itself for four minutes to allow the router to restart and the internet to connect.  Everything worked perfectly.

I consider this the perfect use for a Raspberry Pi – Think of something for it to do, find a way to do it, tweak as required and then get it working.

This entire project took just three days to complete.  It was conceived on Wednesday afternoon and by Saturday afternoon it was fully implemented and working!

Posted in Construction, Not amateur radio, Raspberry Pi | Tagged , | Leave a comment

New aerials for VHF/UHF (2m/70cms) and 28MHz (10m)

Over the years I’ve used a few different VHF/UHF aerials here and the one I always found the best was my old Diamond X500.  I bought that when I still lived at home with my parents and it moved here with me.  It ran my original AX25 packet radio BBS and then MB7UIV and was only taken down in June 2010.  When it was given away, it was in perfect working order, if just a little dirty.

I replaced it with a beam for 2m and added a Sirio 827 for 28MHz (10m).   Eighteen months or so later, I replaced the Sirio 827 with a Sirio Gain Master and that was destroyed by the wind in February 2014.  My VHF beam was removed after the lightning strike in 2011.

Since then, all I’ve had up for VHF/UHF is a very small aerial on the front of the house and nothing specific for 10m.

Yesterday I fitted brand new aerials to the side of the house – A Diamond X510N and a Sirio 827.  The Diamond is on a 20ft pole making it a little over 100ft above sea level where the Sirio is on a slightly shorter pole of 17ft length putting it around 97ft above sea level.  Here you can see the two aerials along with the very small vertical on the front of the house that I’ve been using for VHF/UHF for the last few years.

Diamond X510N and Sirio 827

Diamond X510N and Sirio 827

Now onto the measurements of the two aerials.  For the Diamond, I used a recent acquisition, an AAI RF Vector Impedance Analyser N1201SA which I bought from Banggood, specifically for the wide frequency coverage from 137MHz up to 2.7GHz.  I can thoroughly recommend this unit except for one thing.  There’s no way to export the graphs it produces so these were taken by photographing the display.

Diamond X510N VSWR on 144MHz (2m)

Diamond X510N VSWR on 144MHz (2m)

Diamond X510N VSWR on 430MHz (70cm).jpg

Diamond X510N VSWR on 430MHz (70cm).jpg

The VSWR on 2m is superb, below 1.4 over the whole band and very nice at just below 1.2:1 on 145.500MHz  (S20), the UK calling frequency.  It’s a little higher on 70cms at just above 1.4:1 on the calling frequency of 433.500MHz (SU20) and rising to about 1.8:1 at the top end of the band but considering the band is 10MHz wide, that’s not surprising and perfectly acceptable.

I’ve already made simplex QSOs on 70cms out to around forty miles and been able to access repeaters on 2m as far as fifty miles away so my initial impressions are that it’s working well.  I’m feeding it with around fifteen metres of EcoFlex 15 coaxial cable which gives me just 0.5dB loss on 2m and 0.9dB loss on 70cms.

For the Sirio on 10m, I used my trusty miniVNA Pro analyser.

Sirio 827 SWR on 28MHz (10m)

Sirio 827 SWR on 28MHz (10m)

The Sirio 827 is adjusted by the top section, the further in it is, the higher the resonant frequency of the aerial. I had the top section in as far as it will go but seeing as this is sold as a CB aerial, the resonant point is only a short distance into our very wide 10m band.  As can be seen, it’s perfectly useable in the CW/SSB segment of 10m but the SWR does raise to nearly 2.2:1 on 29.600MHz, the FM calling and working frequency. It’s a bit windier today so I don’t plan on lowering the aerial but if I get a chance in the coming weeks, I’ll drop it down and try and reduce the overall length just a little further.  I’m feeding the Sirio with seventeen metres of RG213/U which gives me around 0.6dB loss on 28MHz.

Overall it was a very successful days work and I’m very happy with the results.

Posted in Amateur radio, HF, UHF, VHF | Tagged , , | Leave a comment

How to replace the noisy fan in an Icom ID-5100 with a much quieter one

I’m a happy owner of two Icom ID-5100 radios, one is mounted in the car and I use the other one in the shack on low power for working the local repeaters.  It doesn’t get much use but I’m monitoring GB3CL and GB7TE most of the time.

About the only thing which I don’t like about this radio is the cooling fan.  When it kicks in, it sounds like a jet aircraft taking off.  I checked and it’s a Delta fan and they have a reputation for being loud.  You can see the exact specifications of the factory fan here and at 9,000rpm, it’s no surprise it’s noisy.   In the car that’s not a problem but it’s a big issue in the shack.

I did some searching and discovered that Andy, MW0MWZ had found a suitable replacement fan and written about it on his blog.  As this was written well over a year ago I contacted Andy to see if he was still happy with this replacement fan and he replied that he was but with one caveat.  He only uses the radio at 5W output and it’s perfectly good for that.  He does question whether the fan will be man enough for the job if it’s running 50W for long chats.  I don’t do that, mine never goes above the low power setting so I decided to do the same mod.

If you want to see the video comparing the audio levels before and after this mod, either scroll down to the bottom of this post or click here to see it on YouTube.

I ordered the suggested fan, a Scythe Mini Kaze Ultra SY124020L from Amazon and it dutifully arrived two days later in a nice package.

Scythe Mini Kaze Ultra SY124020L

Scythe Mini Kaze Ultra SY124020L

First thing to do was remove these four screws.

Back of the ID-5100 showing the fan about to be removed

Back of the ID-5100 showing the fan about to be removed

The screws were very tight to remove, I suspect there was some kind of screw-lock involved to stop them from turning.  Having a decent screwdriver helps here, be careful not to burr the screw heads.

ID-5100 with the fan cover off and the fan loose

ID-5100 with the fan cover off and the fan loose

It was very obvious that the length of the wire on the fan wasn’t going to be enough for me to easily get in there with a soldering iron to fit the new fan.

Not much wire to work with

Not much wire to work with

I hoped that the wire going to the fan would be actually plugged into the board inside the wireless so I carefully removed all the screws on the bottom cover of the Icom ID-5100 to see.  Oh yes, life is good!

Inside of the ID-5100 showing the fan connection

Inside of the ID-5100 showing the fan connection

I did hope that the connector on the wire with the replacement fan would be the same but it’s much larger so I would have to get the soldering iron warmed up.  I was expecting to do this anyway so it wasn’t a problem.

It was a simple matter to unsolder the cable from the original fan, remove the label from the new fan, unsolder the cable, solder the cable from the factory fan onto the now exposed connections and stick the label back on.  It probably took longer to type that sentence than it did to actually do it.

New fan with power cable attached

New fan with power cable attached

With that all done I just had to plug it in, mount the fan back in place and check it all worked.  I did this before I screwed the fan back on and replaced the bottom cover, being careful not to catch the power cable on the case frame or against the fan blades.

Inside of the Icom ID-5100 showing the new fan in place

Inside of the Icom ID-5100 showing the new fan in place

With the bottom cover replaced and the fan screwed securely back in place.

Icom ID-5100 all back together with the replacement fan fitted

Icom ID-5100 all back together with the replacement fan fitted

And onto the full test – What better way to demonstrate the difference between the old and the new fan than to produce a video and that’s what I’ve done.  You can see it directly here or use this link to watch it on YouTube in full HD quality.

Checking the specifications of the two fans, it’s really obvious why there’s such a difference in noise between the two.  The Delta is rated at 9,000 RPM compared with 3,500 RPM for the replacement and the measured sound level of the Delta is 36dBA compared to 19.5dBA for the replacement.  Of course the airflow on the new fan is significantly lower on the new fan at 4.86CFM as opposed to 10.1CFM for the Delta.

I cannot say enough that you do this at your own risk.  If you regularly use the radio on high power, I can’t recommend this modification as you’ll probably fry your radio.  If you only use it on low power though, I think it’s worthwhile.

I take no responsibility for any damage caused to your radio if you do this modification.  In other words, if you do it and your wireless catches fire due to overheating, don’t blame me.

Posted in Amateur radio, Construction, D-STAR, FM, VHF | Tagged , , , , , , , | Leave a comment

5B4AGN bandpass filters – The measurements

I’ve been moving some boxes around recently and I unpacked the bandpass filters I built for one of the Martello Tower Group DXpeditions and successfully used again during our activation of the MV Ross Revenge in August 2016.

It struck me that I’d never produced a full set of figures showing rejection on each band, insertion loss and SWR for them so today I’ve corrected that.

My filters were designed by Bob Henderson, 5B4AGN who helps set up group purchases once a year of so of all the parts required to build them.  Everything is done through a Yahoo Group so if you’re interested, head over there to find out more.

Although I bought all the parts to build six filters, I didn’t make the one for 160m so I have a set of five filters for 80m, 40m, 20m, 15m and 10m.  Without these filters it wouldn’t have been possible for us to have three stations running simultaneously while on Herm and two stations sitting next to each other on the Ross Revenge.

To measure the performance of these filters I used my miniVNA PRO and my homebrew dummy load.  Even though the filters aren’t designed for rejection specifically on the WARC bands, I measured them on those bands as well for completeness.  I believe that Bob has produced some newer design filters with higher rejection since I built these and they cope much better with the WARC bands.

For each filter, I connected it to the VNA and measured the rejection per band along with the insertion loss on the primary band.  I then disconnected one side of the filter, connected it to my dummy load and measured the SWR.

5B4AGN Bandpass filter performance measurements

5B4AGN Bandpass filter performance measurements

The important frequencies are the multiples of the primaries so for 80m we’re mainly interested in 40m, 20m and perhaps 10m.  For 40m, we’re interested in 20m, 15m and 10m etc.  The ‘next-door’ bands and the WARC band aren’t really important so it’s no surprise to see that the 20m filter only gives 14dB of rejection on 17m or the 10m filter only gives 10dB of rejection on 12m.

It’s interesting to see that compared to the very popular Dunestar filters, the 5B4AGN TXBPF are superior in performance overall and at a much cheaper cost.  I seem to remember these worked out at about £40 each to build.

Of note is the exceptionally good insertion loss figures on these filters, varying from 0.19dB to just 0.31dB which compares very favourably with all the commercial filters I’ve seen.

Apart from the chart, I also plotted rejection/insertion loss against SWR for each filter.  Each image can be clicked to see a higher resolution version.

5B4AGN 80m bandpass filter performance plot

5B4AGN 80m bandpass filter performance plot

5B4AGN 40m bandpass filter performance plot

5B4AGN 40m bandpass filter performance plot

5B4AGN 20m bandpass filter performance plot

5B4AGN 20m bandpass filter performance plot

5B4AGN 15m bandpass filter performance plot

5B4AGN 15m bandpass filter performance plot

5B4AGN 10m bandpass filter performance plot

5B4AGN 10m bandpass filter performance plot

I built these as individual filters in their own boxes rather than having them all together and switchable for the simple reason that for a multi radio station, if the filters had been all boxed together then I would have had to build two or perhaps three sets at the additional cost and time.  I never expect to have two or more stations operating on the same band so therefore one set of filters is enough.  The rejection figures really do talk for themselves and once you’ve used bandpass filters on multi-station setups, you won’t want to operate without them.

If you run any kind of special event station, DXpedition or contest where you have multiple stations running, I really can’t recommend enough that you have a set of bandpass filters to hand.  There are a few different types of commercial filters with different levels of performance but it’s a great feeling to have built your own which perform better than the majority of commercial products at a cheaper price.

(I have no connection with Bob, 5B4AGN except for being a satisfied customer)

Posted in Amateur radio, Construction, DXpedition, HF | Tagged , , | Leave a comment

MB7UIV is back

A little history
In January 2000 I started running the first licensed APRS Internet gateway in the UK originally with the callsign GB7UIV.  Within a week of experiments starting on the 26th January 2000, the gateway was on air and connected to the internet 24/7 except for periods when the connection dropped out and the modem (remember those?) had to redial.  The callsign changed to MB7UIV some time later.

The gateway was on 144.800MHz and was on the air until the 5th June 2010 when it was finally retired. At the time of closedown it was still running UI-View32, written by the late Roger Barker (G4IDE) and a very modest computer, a 1.5GHz P4 system with just 1Gb RAM and Windows 2000.
The RF side was a Kenwood TM-261E with 10 Watts ERP from a roof mounted co-linear and driven by a PacComm Tiny-2 Mk2 in KISS mode.  The packet driver used to control the TNC was the AGW packet engine, know as AGWPE.
The callsign of GB7UIV and then MB7UIV was chosen to reflect the very popular APRS software in use at the time: UI-View.

The return of MB7UIV
At 13:55z on Wednesday 8th February 2017, MB7UIV returned as an APRS receive only iGate using a Raspberry Pi Zero and an RTL-SDR dongle configured as per the method described in this blog.  All local APRS traffic received here on 144.800MHz is gated to the APRS Tier2 Server Network.

I’m very pleased to have MB7UIV active again and am happy to provide the service to any radio amateurs in the area who operate APRS in any way whatsoever.

Posted in Amateur radio, APRS, Data, FM, Raspberry Pi, VHF | Tagged , , , , , , | Leave a comment

Setting up an APRS RX only iGate using a Raspberry Pi, RTL-SDR dongle and a pre-built image

After my previous post, it was suggested that an easier way to set up a receive only APRS iGate would be to provide a pre-built image which only needs slight tweaking to go live.  That seemed like a good idea to me so I’ve prepared an image that just requires a handful of configuration changes which I will go through in detail below.

The entire process detailed here should take less than half an hour to complete.
You will only need to edit two or perhaps three files in total.

First, download my custom built Raspberry Pi image from here or preferably as a torrent from here.  This is a 1.6Gb file which will expand to approximately 4Gb when you decompress it.  Unzip it and write it to an SD card.  You don’t need a high capacity SD card, this image will fit on a 4Gb card and work perfectly.  This image is fully up to date as of 3rd February 2017.


There are two methods of downloading the Raspberry Pi image. The first is direct from SourceForge and the second is as a torrent.  If you use the torrent method, please seed the file for as long as possible because the more people who seed, the quicker the download will be for others.
Thank you.

MD5 of aprs-igate.zip is dde367dc0db9365b84850fcdc46519e4
MD5 of aprs-igate.img is 93060310c5a5c4a3a46822944dc0401f

Connect your RTL-SDR dongle and a network cable to your Raspberry Pi and boot it.  I thoroughly recommend you use a dongle with TCXO as it won’t drift in frequency and you shouldn’t need to do any frequency calibration.  I’m using an RTL-SDR R820T2 RTL2832U 1PPM TCXO SMA Software Defined Radio (Dongle Only) device which is the latest model, complete with TCXO.  Other dongles are available such as this NooElec version from Amazon which is a little cheaper and will arrive quicker or you can search eBay for similar dongles.

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.

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 192.168.1.144 so I use the command
ssh pi@192.168.1.144

You’ll be prompted for a password – It’s currently set to raspberry.
Use the following command to enter the Raspberry Pi config utility:

sudo raspi-config

Expand the filesystem by pressing enter on option 1 then select OK and you’ll be returned to the main screen.

Use the arrow keys to move down to the second option Change User Password and press enter.  Press enter again and you will be prompted to Enter new UNIX password.  Type a new password, press enter and re-type your new password again.  You will get a message telling you your password has been changed successfully.

Use the arrow keys again to move down to Localisation Options and press enter.  Use the arrow keys again to select Change Timezone and press enter.  First select your Geographical area and press enter and then select your Time zone and press enter.

You will now be returned to the main Raspberry Pi Software Configuration Tool main screen.  Use the tab key to select <Finish> and press enter.  You will be asked if you would like to reboot now.  Press enter to reboot.

You will need an APRS passcode so use the APRS Passcode Generator at Magicbug to generate one.

All the software has been pre installed, all you need to do is edit two (or possibly three) files.

cd ~
sudo nano sdr.conf

Scroll down to line eight and change the xxx to your callsign and required SSID.  I use -10 as my SSID so this line reads MYCALL G6NHU-10.  Please use your own callsign, mine is just shown as an example.

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.

At the bottom of that file there is one long line that starts with PBEACON.  Replace xx.xxxxxx with your latitude, yyy.yyyyyy with your longitude and zz with your callsign (including SSID).

Save the file by pressing ctrl-x, then hit the Y key and then press enter.

You can now perfom a test using 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

Press ctrl-c to exit the test.


*** UPDATE – READ THIS IF YOU GET AN ERROR WHEN RUNNING THE TEST ***
I’ve had some feedback that on some older model Raspberry Pis, you may get an error when you try and run the initial test.  The error ends:
Signal caught, exiting!

User cancel, exiting…
Illegal instruction

If this happens, you need to redownload and compile Direwolf using these commands (copy and paste them one at a time exactly as written below:

cd ~
sudo cp sdr.conf sdr.old
git clone https://www.github.com/wb2osz/direwolf
cd ~/direwolf
make
sudo make install
make install-rpi
make install-conf
cd ~
sudo mv sdr.old sdr.conf

Now reboot your Raspberry Pi and run the test again.


If your local APRS frequency is NOT 144.800MHz then you will need to edit an additional file.
cd ~
sudo nano dw-start.sh

You’re looking for this line.


Change 144.80M to whatever your local APRS frequency is.
Save the file by pressing ctrl-x, then hit the Y key and then press enter.

The last thing to do is to configure the system so that the APRS iGate starts automatically whenever you reboot the Raspberry Pi.  Enter the following command:
crontab -e

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

Delete the # at the start of that line.
Save the file by pressing ctrl-x, then hit the Y key and then press enter.

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 your status on aprs.fi by searching for the callsign you entered (including SSID).  You don’t even need to log into the Raspberry Pi, the gateway will start automatically within ninety seconds of rebooting.

It’s been mentioned that you might like to calibrate the frequency of your RTL-SDR dongle.  I didn’t and I didn’t notice any performance issues but it’s likely that if you’re using an older or cheaper dongle then it might be a little off frequency.  If you’d like to do this, it’s very straightforward to do requiring that you edit just one file.  I’ve written some instructions which you can see by clicking here.

Please note – I am not claiming originality for this setup method, I’ve simply followed what’s already available out there on the internet and created an image based on those instructions for your convenience.  My two source documents were Raspberry Pi SDR IGate and Raspberry Pi Packet TNC.  I thoroughly recommend you familiarise yourself with both of them to see what’s been done here.  You can also read my previous blog article where I list each command I used to create this image.  It’s also worth downloading the full Dire Wolf user guide.

I hope this image is useful and as always, I’d appreciate any feedback, comments or thoughts below.

Posted in Amateur radio, APRS, Data, FM, Raspberry Pi, VHF | Tagged , , , , , , | 58 Comments

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 192.168.1.144 so I use the command
ssh pi@192.168.1.144
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
make
sudo make install
make install-rpi
make install-conf

Test
direwolf

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
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
make
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.

Reboot.
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.

Posted in Amateur radio, APRS, Data, FM, Raspberry Pi, VHF | Tagged , , , , , , | 14 Comments