Creating an AIS Pi for Maritime Research
The key component to performing maritime research is tracking a vessel’s AIS (Automatic Identification System). This allows you to see the vessel’s broadcasted name, location, destination, vessel type, and more! I have previously written about AIS in several blogs including The Curious Case of the HMS Defender and Six Tips for Investigating Maritime Vessels.
Two weeks ago, I attended DEFCON 29 as a speaker and had the chance to check out Hack the Seas Village. Gary Kessler gave a really enjoyable talk about AIS tools and how AIS can be manipulated. After taking a deep dive into his previous DEFCON talks, I came across this presentation he gave last year on creating an AIS receiver from a Pi. Since I am familiar with AIS from a tracking standpoint I really want to be familiar with it from the manipulation side. I want to understand how AIS can be manipulated to make it easier to spot and understand what I see when I am performing research. Following Gary’s paper on creating the Pi along with some supplementary documentation I built my own AIS and documented it along the way. I hope you enjoy this project as much as I have.
Raspberry Pi $90(I used the Pi 4 Starter Kit but if you have the parts you can cut costs here)
dAISy Hat AIS Reciever $69
dAISy Hat Pi Case $14(not required but nice to have)
Marine VHF Antenna $21(161.975 MHz and 162.025 MHz)
*If you buy the antenna listed above you will also need to buy the SMA Male to SO239 RF Coaxial Coax Cable connector $11
Total Project Cost: $205
Gary has some useful connector information on his site here for choosing connectors based on your antenna type.
NOTE: If you use an antenna for your dAISy Hat, note the terminating connector. If it comes with a male BNC plug, it should attach directly to the dAISy Hat’s female BNC jack. If it comes with a coaxial cable, it most likely terminates with a male PL-259/SO-239 plug, thus, you will need an adapter. I would recommend getting the SO-239 pigtail or BNC-to-SO-239 adapter when you buy the dAISy Hat. A note on antenna connector nomeclature: According to most sources that I can find, references to SO-239 and PL-259 are mated connector pairs for coaxial cable terminations. In general, the SO-239 (aka UHF Female or UHF Jack) is the connector on a radio or chassis and the PL-259 (aka UHF Male or UHF Plug) is the connector on a cable. You may also find a “male SO-239” or a “female PL-259” product listings. Be sure to look at the pictures!
Let’s Begin Assembling!
- Grab your Raspberry Pi and Pi case and excitedly rip them from their boxes
Below is a picture showing all the pieces of the case and Pi. Lay out the bottom case plate and use these screw standoffs to go up through the bottom of the case as shown.
2. Place your Pi board on top of the standoffs so the screws go through all 4 holes in the board.
3. Attach the standoffs that have no screw end as shown below.
4. Open your dAISy Hat and stare at it lovingly.
5. Place the dAISy Hat on the 4 standoffs so the connector is over the USB port.
6. Add the last 4 spacers with the screws down
7. Now lay out the remaining case pieces like so. Note: This piece below is deceptively hard to get situated. In fact, I am pretty sure I have it upside down in this photo.
8. You have now created something beautiful. Give it a name.
9. If you bought the same antenna I recommended above you now need to screw the connector wire to the dAISy Hat.
10. Screw the other end of the wire to your antenna connector.
11. You are now the proud parent of an AIS Pi Receiver! Congrats.
Let’s not break out the cigars quite yet; Herbert still needs an OS!
12. If you made it this far you are ready to install an OS. If you purchased the Pi Starter Kit you will have all the cables necessary to accomplish this. Place the provided SD card into the slot on the Pi, hook your HDMI cable from the connector on the Pi to a monitor, plug your power cord into the Pi. If you have a mouse and keyboard they can be plugged into the USB ports on the Pi. The native OS, Rasbian, is ready to install from the SD card or you can download it here.
In the next blog, we will walk through how to install and configure OpenCPN for maritime tracking.
Special thanks to Gary Kessler for inspiring this project and providing some really awesome maritime content!