What is this?
This is a light weight, mobile compatible web site that tracks the whereabouts of the ferries serving Denman and Hornby Islands. It provides near real-time vessel positions, direction, speed and schedule information.
How does it work?
As of May, 10 2005 Canadian Navigation Safety Regulations require all ships, other than fishing vessels, of 500 tones or more be fitted with Automatic Identification System (AIS) transceivers.
These transceivers transmit a vessel’s, location, speed, and direction at regular intervals on two separate radio frequencies.
I receive the transmissions from both the Hornby and Denman ferries and relay this information to this web site. The delay between the ship transmission and it appearing here on the map is approximately 10-20 seconds.
Why I made this
While living in Courtenay, BC we were building a home on Denman Island. I often found myself dashing for a ferry and arriving at Buckley Bay only to find the ferry mid channel or on the other side. Summer time overloads require that both ferries depart from their schedule and enter ‘shuttle mode’ until the backlog of ferry travellers has been cleared.
While BC ferries does offer a vessel position map it is often 5 to 15 minutes behind. In that time both ferries can have made a partial or complete crossing. While this resolution of information might be adequate for the longer ferry runs, it’s not much help with a 10 minute crossing. Additionally, BC Ferry’s vessel position map isn’t particularly mobile friendly.
With a background in IT and an interest in electronics I thought I might be able to offer something better. This web site is the result of this ever evolving idea.
Nuts and bolts
Hardware
Initially I was trying to do this on the cheap but I soon realized that I was going to have to purchase a commercial AIS receiver since it appears to me that RF reception is more black magic than science.
There are many AIS receivers on the market and after much research I concluded that the SRT-Marine Krypton 1.5 Dual Channel AIS receiver was the right fit.

The trouble is, I can’t purchase this product from SRT-Marine. They are the OEM for boards used by other AIS manufacturers. Sometimes these boards are just repackaged and sometimes they are just a component in a more advanced product. The trick was to find the least expensive product that contained the board I wanted.
I started by purchasing a Digital Yacht ZDIGAIS100USB receiver since its specifications very closely matched those of the SRT-Marine product. At $200 US dollars it seemed reasonable at the time but landed it cost me $280 Canadian Pesos.

With some boyhood enthusiasm I found the IP54 rated case yielded easily to a deftly place razor blade. Who knew commercial manufactures used cyanoacrylate (crazy glue)? Not me. I expect that I voided the warranty.

With the receiver plugged into my desktop computer and short bit of copper as an antenna I verified that the receiver was operational by viewing the serial data with a terminal program.
I now needed a dedicated computer for handling and dispatching the never ending stream of AIS data and a Raspberry Pi 2B single board computer seemed like the right choice. Perhaps a little overpowered for the task but for $58 Canadian Pesos how could I go wrong? I was pretty sure I could repurpose the extra horsepower for something.

Next I needed an antenna. I first purchased a VHF marine antenna from a local on Denman Island. While I was able to receive signals from the Hornby ferry, the reception from the Denman ferry was intermittent at best. I then looked at commercial AIS antennae but their price was going to derail the project. After much searching on the internet I came across very detail instructions for the construction of a high gain collinear AIS (162MHz) antenna made from some lengths of coaxial cable. Many thanks to Neal Arundale for his work on this.
A quick prototype hung from the eaves trough proved the concept to be functional but more elevation was going to be needed. I took the rig up to a high point on Denman Island and left it for a day. Remarkably I was able to cover approximately 5,000 square kilometers from this location. I then wondered what a slight elevation gain at home would get me so I constructed the final antenna as per Neil’s designed and climbed the tallest tree on our property. Fastened as high as I could comfortably climb, this is where the antenna remains today. From its location it regularly covers between 3,000 and 4,000 square kilometers.
In order to keep the antenna lead as short as possible I needed to package up the electronics in a weatherproof case and get it set up in the woodshed which is luckily next to the tree and has temporary power.

Initially I had thought the case would need to be mounted up the tree as well so I chose to power the unit via a TP-Link POE connector and 100 feet of Cat5E Ubiquiti Tough Cable.
Connection to the internet is via a very small USB Wifi dongle which barely reached our access point at the house.
Temporary power to the wood shed is just that; temporary. During our home construction we used the woodshed as our outdoor kitchen and power to the refrigerator was supplied by an extension cord. With the fridge in the house now the extension cord needs to go. That, combined with our frequent power outages, makes this project an ideal candidate for a solar powered system. With our access point now on a UPS this addition would make the system more resilient.
Current power consumption averages about 1.95 W (380 mA @ 5Vdc) . When funds are available I’ll be replacing the Rasberry Pi 2 with a lower powered Rasberry Pi Zero, removing the TP-Link POE and adding a 20 Amp/Hr battery, a 60 Watt solar panel, a charge controller, and DC to DC voltage converter. I expect that the power consumption to be around 1.2W ( 240 mA @ 5Vdc)

Software
This gets a little nerdy. Read on if you must.
I installed Raspbian which is the de facto default OS for the Raspberry Pi. Based on the Debian distribution of Linux it is reasonably familiar to me.
The primary application running on the Pi is KPLEX which is a NMEA-0183 multiplexer. Essentially it receives the data from the AIS Radio and forwards it to other applications.
One of those application is WebTracker which is a program written in Python. It watches the NMEA data stream for AIS messages from the ferries we are tracking. This would normally be the Baynes Sound Connector and the Kahloke. This data is combined with scheduling data and forwarded to an efficient web server running on the Pi. (NGINX) Yes that’s right. This web server is running on a Pi in my woodshed.
Okay, that’s not entirely true. The data regarding vessel positions, speed, next sailing etc is being served from the Pi however the root of the website ferries.denmanisland.org is hosted on an NGINX web server configured on a EC2 virtual server instance on the Amazon Web Services cloud computing platform.
Initial this limited use application fit nicely into their ‘free tier’ service but more recently the bandwidth demands have generated costs. I may soon have to rethink the use of AWS.
With this none stop stream of ship location data at my disposal I thought it would be a shame to lose it so another python program I wrote decodes all the received NMEA position messages and logs them to a file. Want to know which herring boat dragged its anchor across the Denman to Hornby BC Hydro power cable and knocked out power on Hornby and southern Denman for a few hours? I’m sure it’s in the data.

No one likes a data hog so I also configured KPLEX to forward all of its data to the ship tracking service Marine Traffic. Check out station #1697 for details.
Near real time
As per AIS specifications frequency of AIS transmission is a function of the vessel’s speed. The faster the vessel is traveling the more frequently it transmits its AIS Position message. Based on my logging it seems that while underway both ferries transmit their position messages every 10 seconds and every 3 to 10 minutes while in dock. It takes less than a second to receive a position report, and write out the data to the local web server. Anyone using the site polls that server approximately every 10 seconds. So while the data is not exactly realtime it should be good enough for most purposes.
Disclaimer
WarningThe location of the pretty little icons on the map may or may not be grounded in reality. Like life, this site is subject to change without notice. Use at your own risk.