SARCNET logo

School Amateur Radio Club Network

☰ Menu

Related Information

Please note that this site is currently under constant construction and revision since January 2016. Please check back regularly to see new or updated news, activities and missions.

AIS Receiver

Amateur Radio Magazine Article

The draft article describing the inspiration and operation of the AIS receiver is here.

AIS Receiver Schematic

AIS Receiver Pictorial Schematic

AIS Receiver Layout

AIS Receiver Layout

Parts List

The AIS receiver requires the following hardware and software:

  • Antenna mast.
  • 162MHz antenna.
  • Weatherproof, non-metallic, enclosure and mounting hardware.
  • Raspberry Pi single board computer version 1, 2 or 3, model B or B+.
  • RTL-SDR USB dongle (TCXO 1ppm) with a 10cm USB extension cable.
  • WiFi USB dongle to suit your home WiFi router (not required for Raspberry Pi version3).
  • 5V 2A micro USB converter.
  • 12V Plug Pack with two-core cable.
  • 8GB SD or Micro SD card.

The RTL-SDR dongles are available from www.RTL-SDR.com. The Raspberry Pi and WiFi dongle from www.element14.com. Other components and cables are readily available locally or search the name on eBay.

Create a Raspberry Pi SD Card boot image

Do the following on a Windows PC:

  1. Download raspbian-jessie.zip from https://www.raspberrypi.org/downloads/raspbian/
  2. Unzip raspbian-jessie.img
  3. Download Win32DiskImager from https://sourceforge.net/projects/win32diskimager/
  4. Install Win32DiskImager
  5. Insert 8GB SD or microSD card (USB SD card adapter may be necessary)
  6. Start Win32DiskImager
  7. Select the image file and SD card above. Select Write.
  8. Eject the SD card from the PC

Set up the Raspberry Pi initial configuration using the desktop

Do the following on a Raspberry Pi:

  1. Insert the SD card into the Raspberry Pi
  2. Connect Raspberry Pi version 1 temporarily to a USB hub. It can be removed later. This is not necessary for version 2 or 3.
  3. Connect USB WiFi Dongle, USB keyboard and USB mouse. Do not connect USB RTL-SDR dongle yet.
  4. Connect an HDMI monitor.
  5. Power up the Raspberry Pi
  6. Task Bar|Panel Settings|Panel Preferences|Edge: Bottom
  7. Task Bar|WiFi|Select and connect to your WiFi Access Point
  8. Task Bar|Menu|Preferences|Raspberry Pi Configuration
  9. System|Filesystem|Expand Filesystem
  10. System|Boot: To CLI
  11. Localization|Set Locale
  12. Localization|Set Timezone
  13. Loalization|Set Wifi Country
  14. Select OK
  15. Reboot as suggested. (Say goodbye to the desktop)

Upgrade, install and compile the AIS software

In terminal mode now, type in the following commands to get and run our installation script:

  1. wget http://www.sarcnet.org/files/ais/ais
  2. chmod +x ais
  3. ./ais
  4. shutdown now

Note: Step 3 may take around 15-30 minutes. The software is distributed under the original GPL licences. No fitness for purpose is expressed or implied. The system must not be used for actual navigation. We decided to source copies of the original software from our web site because the original sources are subject to development and some have already been broken. We may update our copies from time to time.

Check the RTL-SDR frequency offset in ppm

This optional procedure uses kal and local GSM mobile base stations to check the frequency offset of the RTL SDR dongle.

Plug in the RTL-SDR dongle, connect a GSM antenna (or 80mm of wire) to it and cycle power to the Raspberry Pi.

At the prompt, press CTRL-C to exit starting up the AIS Receiver.

Type the following commands and note the results:

  1. kal -s GSM900

    Found 1 device(s):
      0:  Generic RTL2832U OEM
    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    Exact sample rate is: 270833.002142 Hz
    kal: Scanning for GSM-900 base stations.
    GSM-900:
         chan: 8 (936.6MHz + 2.289kHz)     power: 40324.67
         chan: 12 (937.4MHz + 1.677kHz)    power: 48893.99
         chan: 15 (938.0MHz + 2.250kHz)    power: 68151.80
         chan: 77 (950.4MHz + 1.764kHz)    power: 51462.37

Identify the channel with the strongest signal above (but not an absurd offset) then enter the channel number in the command below:

  1. kal -c 15
    Found 1 device(s):
      0:  Generic RTL2832U OEM
    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    Exact sample rate is: 270833.002142 Hz
    kal: Calculating clock frequency offset.
    Using GSM-900 channel 15 (938.0MHz)
    average              [min, max]       (range, stddev)
    + 2.243kHz       [2218, 2267]     (50, 13.075513)
    overruns: 0
    not found: 0
    average absolute error: -2.391 ppm

Round this number off to the nearest integer (e.g. -2) and remember it for the final configuration below.

Set up a free on-line account with AIS Servers

You will have to apply to AIS service organisations to get their IP address and port number. Only Pocketmariner publishes this data freely. Since AIS servers don't all share your data please register and upload to as many as possible. It will make the world a safer place for vessels. Here are some links:

  1. Pocketmariner: http://pocketmariner.com/ais-ship-tracking/cover-your-area/ (IP Address/Port = 54.225.113.225:5322)
  2. AISHub: http://www.aishub.net/ais-tracking-join-us.php
  3. Marinetraffic: https://www.marinetraffic.com/en/users/register/1/12
  4. Shipfinder: http://www.shipfinder.com/Login/reg

Complete the final startup configuration

  1. Cycle power to the AIS Receiver
  2. At the prompt, press CTRL-C to exit starting up the AIS Receiver.
  3. Type: sudo nano /home/pi/.bash_profile to edit the terminal startup profile. It should looks like this:

echo "Starting AIS Receiver in 10 seconds. CTRL-C to exit"
sleep 10
setterm -blank 0 -powerdown 0
sudo killall -w rtl_ais
sudo killall -w aisdispatcher
#Please edit the following list of IP addresses AAA.BBB.CCC.DDD and port numbers PPPP for your AIS server(s). Separate by commas (no spaces).
/usr/bin/aisdispatcher -u -G -h 127.0.0.1 -p 10110 -H AAA.BBB.CCC.DDD:PPPP,AAA.BBB.CCC.DDD:PPPP &
#Please change the -p option to set the frequency offset in ppm of your RTL-SDR dongle
/usr/bin/rtl_ais -p 0 &

  1. Use the keyboard to change the text in bold
    1. Enter your own list of AIS server IP addresses and port numbers
    2. Enter your own ppm offset (found using kal above) after -p. E.G. -p -2
    3. Type CTRL-o <Enter> to save your changes.
    4. Type CTRL-x to exit.
  2. Type passwd to change the default password from "raspberry" to your own secure password.
  3. Type shutdown now

Reconfigure for stand-alone operation

  1. Disconnect USB keyboard and USB mouse
  2. Disconnect the USB hub
  3. Connect the USB WiFi dongle to the Raspberry Pi
  4. Connect the USB RTL-SDR dongle to the Raspberry Pi via a USB extension cable
  5. Connect the power. It should startup showing AIS sentences.
  6. Disconnect the HDMI monitor.

Log in remotely to your AIS Receiver

  1. You can log into the AIS receiver over your WiFi network to check its operation .
  2. To do this you need to discover the IP address of your AIS receiver (check your WiFi router DHCP Leases. Look for hostname: raspberrypi)
  3. Use an SSH terminal program (such as PuTTY) to log into that IP address at port 22.
  4. Log in as user "pi" and use your password set above. You will see "Starting AIS Receiver in 10 seconds. CTRL-C to exit"
  5. If you let the AIS receiver start you will see the received AIS sentences on your remote screen.
  6. Before you logout of your remote session type: sudo reboot to return to stand-alone mode.