Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.
JJX edited this page Sep 13, 2024 · 16 revisions

AIS stands for Automatic Identification System and is a technology similar to ADS-B, but used for ships. If you follow the steps in this chapter of the tutorial you will be able to receive AIS data and feed it to the big map.

Prerequisites

  • AIS reception: While ADS-B works nearly everywhere in the world, AIS is a bit different. Compared to planes all ships are "on flightlevel zero" so to speak, this is the reason why AIS signals travel much shorter distances. Under optimal conditions it may travel up to 100km but think more like 20km to begin with. Due to the signals nature it is vital to be near a river or near the sea where AIS equipped ships are operating.
  • A Pi with two SDR dongles will use up to 6 watts of peak power so you need a decent power supply. If you are using even more SDRs think of using powered USB hubs in between as your energy consumption can go up to 10 watts.
  • Keeping your setup cool may be an issue, look for decent cooling of your hardware to ensure stability and longevity of your setup. For Pi 4 we highly recommend aluminum enclosures with passive cooling fins.
  • As for ADS-B, a RTL-SDR dongle is needed. Look for a decent one with R820T or R820T2 Tuner with SMA connector and without a bandpass filter.
  • A matching antenna is needed of course. Build or buy an antenna for 162MHz. The shorter the cable from the SDR to the antenna, the better.

Hardware preparation

You need to change the id / serial number of the SDR dongle you want to use for AIS, to distinguish it reliably from other rtl-sdr dongles. You do not want to mix it up after a reboot, it will result in not working AIS.

Plug your AIS dongle in a PC with no other RTL-SDR dongle connected. This can be your Raspberry Pi or every other linux computer with the rtl-sdr library installed.

Set the new serial with

rtl_eeprom -s 20000001

Now you can access your stick with the serial number 20000001. Beware that smaller numbers like 2 do not work.

Software installation

We assume you followed our instructions for an ADS-B Pi with feeding and MLAT. If not, you have to add our repository before continuing.

Install AIScatcher

sudo apt install ais-catcher

test AIScatcher

$ AIS-catcher -d 20000001
Device selected: Realtek, RTL2838UHIDIR, SN: 20000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Allocating 15 zero-copy buffers
!AIVDM,1,1,,A,339L0eU0010fOHbO76Cp;1ti0000,0*3B ( MSG: 3, REPEAT: 0, MMSI: 211222710)
!AIVDM,1,1,,A,139fw`P001PfOjNO7:mtur4j0<1I,0*26 ( MSG: 1, REPEAT: 0, MMSI: 211533730)
!AIVDM,1,1,,A,13=r2R000:PfKVlO6rw443Dh0<<C,0*56 ( MSG: 1, REPEAT: 0, MMSI: 215909000)

!AIVDM indicates, that you are getting real messages from at least one ship

Adjust config file

Copy the config file template to the right place

sudo cp /etc/ais-catcher.d/rtlsdr.conf.example /etc/ais-catcher.d/20000001.conf

Fill in the credentials for your station with

sudo nano /etc/ais-catcher.d/20000001.conf
[...]
	"http": [{
		"active": false, // set this to true
		"url": "https://ais.chaos-consulting.de/shipin/index.php",
		"userpwd": "YOURSTATION:YOURAPIKEY", // enter your stationname and API-key here
		"interval": 1,
		"gzip": true,
		"response": false
	},
[...]

Register AIS-catcher as a service

To make AIS-catcher start with your Pi, we register it as a systemd service like this

sudo systemctl start [email protected]
sudo systemctl enable [email protected]

Thats it!

Clone this wiki locally