Categories

Archives

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Building an APRS iGate using a Raspberry Pi and a TV tuner dongle

I’ve been messing around with APRS – the Automatic Packet Reporting System – for some time now and had noticed an absence of coverage in my local area. The end goal of APRS is to feed packets (which might be position data, weather reports, messages or other information) to the APRS-IS (which can be viewed at aprs.fi), and this is done via digipeaters and iGates. A digipeater merely re-transmits packets, until they reach an iGate, which feeds them to the Internet.

My local RAYNET group frequently uses APRS for position tracking at events, but often position reports fail to reach control due to a lack of APRS coverage. I therefore deemed it would be a good project to make a portable, lightweight iGate that could be deployed quickly.

This was done using a Raspberry Pi and RTL-SDR USB dongle – while it is easier to feed the audio output of a radio into the Pi, this does increase the price of the setup; an RTL-SDR dongle can be purchased for as little as £10.

Parts:

  • Raspberry Pi running Raspbian / Debian
  • RTL-SDR dongle
  • Powered USB hub (the Pi cannot provide enough current to run the RTL-SDR)
  • A network connection – this could be via ethernet, WiFi or 3G
  • Power – either a 5V mains power supply, or a battery. The fact that the Pi runs from 5V means one could use a high-capacity mobile phone ‘power bank’ to run this in a remote location temporarily

Preparation

Download a Raspbian image from http://www.raspberrypi.org/ – I used the NOOBS images as these are slightly easier. Extract the image to your Pi’s SD card.

Upon booting the Pi for the first time, ensure you go into advanced settings and enable SSH, as well as changing the hostname to something memorable and descriptive. Then, set up your network link. It is also advisable to force audio output via the 3.5mm socket rather than HDMI, as this will make troubleshooting easier later.

Once an Internet link has been established, update the Pi from the Terminal:

Setting up the RTL-SDR dongle

By default, the Pi will attempt to load its own drivers to use with the RTL-SDR dongle. However, these assume it is being used for its original purpose (watching Freeview TV), and so we must blacklist them.

Then add the following lines to the file:

To save the file, press Ctrl+X, press Y and then hit enter. Then, reboot:

Following this, create a folder for the software needed to run the RTL-SDR:

You may see error messages at some points – play close attention to the terminal when entering these commands. If  you get an error, this may be because the command needs to be run as ‘root’ – re-enter the command, but prefixed by ‘sudo’.

We will then install ‘sox’ – a utility that converts audio formats to others – so that we may test the RTL-SDR later.

Check the RTL-SDR dongle is working with the Pi

You should (hopefully) get no packet loss, however when I ran this on my Raspberry Pi Model B (2011), I got loss of around 50 bytes – the iGate still worked, however. The more powerful Raspberry Pi 2 does not suffer from this issue.

We will then test the dongle itself by listening to broadcast radio – I chose to use BBC Radio 1 on 98.5MHz:

Plug in a pair of headphones to the Pi and you should be able to hear your selected radio station.

Then, try 144.800 MHz, transmitting (on low power) on a HT to check you can hear narrow-band FM signals:

Calibrating the SDR

Many of these cheap dongles are not particularly accurate. I therefore plugged mine into a laptop running SDRSharp and transmitted on 144.800 MHz to calculate the necessary offset. With my particular RTL-SDR, one needs to set its frequency to 144.791 MHz when listening to 144.800 MHz.

Decoding the APRS packets

APRS packets are transmitted as AFSK1200 – that is, audio-frequency shift keying at 1200 baud. multimonNG is a piece of software that is capable of decoding this data.

Having done so, we then want to test that the Pi is decoding packets. Note that the frequency here should be set so that the RTL-SDR is actually listening to 144.800 MHz…

Then, transmit an APRS packet on 144.800 (if you do not have an APRS capable radio you can use the APRSDroid app,  holding your phone up to the microphone). You should see multimonNG output the content of the packet.

Feeding the packets through to APRS-IS

pymultimonaprs is a script that interfaces with the RTL-SDR to send APRS packets to the Internet.

You then need to generate your APRS passcode, which is needed to send traffic to APRS-IS (replace T3ST with your callsign):

Note down this passcode, as you will need it later.

We will then edit /etc/pymultimonaprs.json – setting the proper frequency and gain*, as well as our callsign, SSID (-10 for iGates), passcode, gateway, comment and location.

*a setting of 42.1 worked well for me. Run rtl_test to get a list of possible gain values.

We will then test that the script is working:

Go to aprs.fi, search for your callsign and hopefully see your iGate on the map.

Making the script run at startup

Then paste in:

Make the script executable and start it:

 

And that’s it – you’re finished!

 

Cover image: Russ Sanderlin – https://www.flickr.com/photos/tearstone/8498072730. CC 2.0 BY-SA 

ที่มา: https://milo.me.uk/2015/08/building-an-aprs-igate-using-a-raspberry-pi-and-a-tv-tuner-dongle/

Leave a Reply