Homebuild WiFi AIS receiver

I like messing about in (and with) boats. Boats are full of gadgets.

Proper sailors know how to read the wind and tide. They chart their course across oceans using nothing but Dead Reckoning between fixes from stellar and solar observations.

Most people who charter boats on holiday are not proper sailors.

Holiday sailors think about sun, gin and tonic. For them, the chart plotter is a nautical TomTom: they point the bow where the thick blue line tells them to. Consequently, charter companies who want to keep their expensive capital assets afloat usually fit their boats with fancy chart plotters that do most of the thinking for the skipper.

These chart plotters are crammed full of holiday features. They can stream sea shanties and other nautical hits to the boat’s sound system.

But… beyond wind, log and depth they’re rarely connected to anything useful. These boats are rarely fitted with a radar or AIS.

WTF’s AIS?

The Automatic Identification System is a marine transponder system. Vessels broadcast their position, speed, name, size and other information on a couple of TDMA data channels straddling 162MHz. Websites like marinetraffic.com use a global network of hobbyist receiver stations to display this information in your browser, in exactly the same way that websites like flightradar24.com do with ADS-B transmissions for air traffic.

This information is very useful when overlaid on a live chart on your boat, which is why websites like marinetraffic.com charge you to remove their free-tier time delay.

The AIS receiver on a boat is usually hardwired and talks to the other systems using the NMEA protocol, or some variant of it. I covered NMEA in my GPS tracker post. So how do I bring a live AIS capability on to a rented boat without needing screwdrivers and soldering irons?

WiFi AIS

These days you can buy a portable AIS receiver that shares its data over WiFi. Modern chart plotters, whether hardwired to the boat or installed from the app store on your phone, can connect to this source concurrently.

But they’re over £100, and I’ve got a spare Software Defined Radio and a drawer full of Raspberry Pis…

The Design

Block diagram of the SDR and RPi
Block Diagram

There are pre-made builds available for the Raspberry Pi to do this sort of thing, but I wanted something very simple and expandable.

I’ve used a Raspberry Pi Zero W running rtl-ais to both share captured AIS packets on a TCP port and dump them in a logfile. The logfile has a watchdog on it that triggers GPIO BCM pin 17, flashing the blue LED when a change is made to it. The blue LED therefore functions as an “AIS working” indicator. The green LED is connected to the 3.3V pin and function as a power indicator.

Raspberry Pi Zero W and RTL-SDR in an IP68 box
Inside the IP68 box

I’m running hostapd to provide a WiFi hotspot through the Pi’s onboard WiFi adaptor, and a DHCP server to assign RFC1918 IP addresses to connecting devices.

The whole lot fits in a small IP68 box suitable for throwing in my luggage and getting wet on a boat. Practically all yachts have either a USB power socket or a 12V accessory socket that I can use to power it.

Very nice. Does it work?

Good question. I’d planned to take it sailing with me this summer, but Covid-19 lockdown put a stop to that.

Both OpenCPN on my desktop and Navionics on my Android phone can connect to it and receive simulated AIS packets. I’ll take it on a drive to the coast in coming weeks and see if I can get the blue LED to flash!

Be First to Comment

Leave a Reply

Your email address will not be published.