With Only the Wind

The last couple of weeks have been quite fulfilling. Last year I remember being at Fort Warden, camping during the week of Fiddle Tunes and looking at the single boat tied to the closest mooring buoy from the dock. I kept thinking to myself that this would be me next year and so I made it happen.

Sailing north from Seattle to Port Townsend happened to be downwind, until just south of Point no Point. Before I started sailing north I immediately reefed once to get the mainsail in a better shape for winds that could potentially reach thirty knots. I was uncertain what would happen out there but I knew it was blowing from the south and was the only person on board of Satori. She did really well with just the reefed main and the jib flying and kept her speed from 3.5 knots over water to her maximum speed of 4.7 knots. The winds blew a steady twenty knots with the maximum true wind speed of 26.5 knots. The speed over ground was 8.3 knots which could be the fastest she has ever gone with myself at the helm. The currents were remarkably swift and there was a moment where I was so nervous I decided to drop the mainsail and fly with just the staysail. A few minutes after dropping the main, the winds shifted to 180 degrees from the north. In hindsight I think it was a good choice as I could have watched the boom swing and flutter violently in 25 knot winds. Not exactly something I ever want to experience. Once the winds shifted, I dropped all sails and motored the entire way to Port Townsend to ensure getting tied up to a mooring buoy in time.

Point no Point chop
Point no Point chop

If you’re not following my previous posts, this was a trip to test the MNBB project and specifically gather some statistical data from the trip north so I could come up with the maximum values that I described above. The MNBB logger did an excellent job at providing more information than I would normally have on any given trip so I will continue enhancing the project so one day others can enjoy the additional information from their sailing trips. I will be presenting the project on Thursday at the SeattleJS meetup in hopes to gain some exposure and find additional contributors to help with all of the coding.

Moored at Fort Worden looking at Point Wilson lighthouse
Moored at Fort Worden looking at Point Wilson lighthouse

While at Fort Worden I learned that the swells coming from the cargo ships roll in at the wrong angle and several times a day Satori would rock violently. Nothing bad came of it other than some rude awakenings and my pup Sasha looking up like the sky was falling and the world may come to an immediate end. We endured the rocking for the better part of the week and I ticked it off as training for dealing with sleeping in the open ocean. We both did well but also decided that Fort Worden is not the best spot to moor in the Salish Sea. Next time I will bike to Fort Worden and keep the boat back in town.

Seattle fiddle legends - Paul Anastasio imitating Joe Venuti's loose string bowing.  Greg Canote bowing the tune.
Seattle fiddle legends – Paul Anastasio imitating Joe Venuti’s loose string bowing. Greg Canote bowing the tune.
Clare Milliner and Walt Kokken playing Old Time tune
Clare Milliner and Walt Kokken playing Old Time tune
Best jam of the week. Friends Joe and Aki jamming really good Old Time tunes. I joined in later. Satori behind.
Best jam of the week. Friends Joe and Aki jamming really good Old Time tunes. I joined in later. Satori behind.

On July 4th I decided it was a good time to take a cruise and look for some fireworks and wind. The winds blew 15-20 knots before I even untied from the mooring buoy. Normally I would just sail off the buoy but I was blocked by the dock so I turned the motor on for a bit to maneuver away from the dock and into the wind. As soon as I headed out the engine alarm went off with a steady beeeeeeeep. I thought it might have been a malfunction of the alarm but also decided to sail off and see what was happening so I killed the motor and went down below. First I checked the bilge and immediately knew that the reason for the alarm was from lack of oil pressure. The bilge held all of the oil from the engine. I switched the bilge pumps off to eliminate any concern about an oil spill overboard. The bilge has not cycled in months and has been bone dry so I was not worried about the boat filling with water. The next task was to get the boat back to anchor or mooring buoy so I could clean it up and figure out the issue. I didn’t want to come into the bay with all sails up and twenty knots of wind so I tactfully flew the staysail and took a long time getting back to the buoy sitting outside of the dock. I figured I could tie up and then the next day sail away without needing the motor. After two hours of tacking in twenty knot winds I finally made it back, only to find out that the buoy was private and strictly stated, “do not tie up”. My home was on sail power only and I knew the buoy could hold a boat so I did it anyways. When the boat was getting blows with that much wind and I really had some work to figure out how to get her home, I tied up and began cleaning out the bilge. After removing the oil and before completely cleaning I decided to try to fill the engine with oil and see the rate of leakage so I refilled and started her up. She leaked it all out in a matter of seconds. Okay time to clean up. I keep a five-gallon jug for this very reason so I was able to remove the oil, then spray with degreaser and water and completely remove all of the oil without any issue. The engine compartment was wiped down with paper towels and dried completely. Another few towels to prevent the drip from going back into the bilge and it was time to figure out what the problem was.

I found the source of the issue but could not actually see it because it was located back and at the bottom of the engine. I grabbed my point and shoot camera to get a better look and after some skillful shooting at some nice angles, I found the problem. There is an oil cooling system that has two pipes that come out and back into the engine block with a heat exchanger and the outflow pipe had rusted out. The muffler was replaced earlier this year but prior the leakage caused some severe corrosion in the back corner and the pipe rusted to the point of failure. I attempted to clamp the hole shut but there was no way to make a patch with the given placement of the hole so I decided the only way to fix it was to get Satori home and order a new part.

Corroded pipe leaking oil detail
Corroded pipe leaking oil detail
Corroded pipe leaking oil
Corroded pipe leaking oil

The next morning I made one last stop to take Sasha out for potty and get my bike back to the boat. Around noon the winds picked up and I untied from the mooring buoy, committed to sailing the entire way home. I called Boat US towing to check my policy regarding long-distance towing. My limit was 25 miles from the slip and I was thirty miles away. If I had her towed the entire way I would pay fifty percent of the cost, which would have been $700. If I sailed most of the way home it wouldn’t cost anything.

The winds were moderate to light most of the way. Around the south end of Whidbey Island the winds died as always and I simply kept her pointed downwind. Around Edmonds right where the ferries cross I was slowing down again so I figured anywhere from Edmonds to Seattle would be fine. I called for a tow but the dispatch said they would not get to me until 11:30pm. As long as I could keep sailing I was okay and although moving slowly, she kept going. Around 11pm I was outside of the Shilshole Marina and decided to come up with a strategy for staying under sail without drifting south. I put up my jib and tried to put her on a course where she would move slightly hauled without going too fast or drifting too far south. She did really well and after two laps into the shipping lanes, the tow operator called to let me know he was on his way. I headed in close to the north entrance of the marina right around where he would be arriving. He came alongside while I was under sail, then I dropped sails and within a ten minutes was tied up to the slip. A long day and night but we were back safely at home without any issue except getting the rusty part off and replaced.

MNBB – Trial run

A quick recap:

MNBB is abbreviated for Mariners NMEA Black Box. It does not replace the existing navigation instruments or multifunctional display on a sailboat. The purpose is to log your boat’s instrument data and show you useful information about your trips. It may also show you useful trip information while underway. I just started developing the application software and now have it up and running on a Raspberry Pi. If you would like an introduction to this project, take a look at my prior post.

I have not made a lot of progress on the project over the last week but I have made some important decisions on the architecture to keep the entire project simple and easy for other web developers to contribute to. The entire platform is written in JavaScript, which was once a language designed for web browsers and is now an excellent language for building what we programmers like to call full-stack software. The idea is to use a single language for the entire application which should cut down on the amount of code needed to make it work and also make much of the code more purposeful. One of the important decisions I made is how to build it so others can contribute to the project. Right now it is still just scaffolding but eventually I will produce the first displays to show things like maximum and minimum values for a given trip, broken into days, hours, etc. It would be nice to know the maximum wind speed, minimum wind speed, maximum boat speed and even compare apparent and true wind speed over a given trip. This is the next step for the project.

Another part of the MNBB project I am working on is taking the realtime NMEA data and displaying it just like you would see on an instrument panel. With the use of web sockets I should be able to provide a universal display similar to what you would see on a chartplotter or in your instrument panel. The most exciting part of this project is the fact that the entire setup would cost less than $100 to duplicate for another vessel. This excludes the NMEA wifi client but they cost only $200 and can then allow you to use it for other charting apps for Android and iPhone.

The Raspberry Pi, Router and NMEA wifi client
The Raspberry Pi, Router and NMEA wifi client

The above photo shows one of the navigation station lockers containing the network electronics. It may look like a big spaghetti mess of wires but this setup is a good configuration. The power supply is a terminal block with every component fused with one-amp fuses. Each component has it’s own dedicated switch, which is simply labeled and run inline of the wire. I could build a switch panel but I don’t foresee using them much but in case I want to turn them on and off, I added them for convenience. The Raspberry Pi is powered using a Blue Sea USB hub, which simply uses a standard micro-usb cable. The total power consumption for all of these components is less than one amp. Everything can be switched off at the breaker panel or individually if needed. There is an extra ethernet (POE) cable which connects to the wifi booster antennae on the stern of the boat. Eventually I hope to be able to connect to the wifi network while I’m on shore or also pickup wifi from shore using the same router.

On Saturday I am heading to Port Townsend for Fiddle Tunes  and will be anchored at Fort Worden State Park for the week. While heading there and sailing around the bay I should be able to collect some useful NMEA data for the purpose of building some of the first applications. The key is to use the unit while underway but then power it off while at anchor. Most of the useful information is when the boat is actually moving so logging here at the marina isn’t nearly as useful aside from gathering weather data.

Summer is here and I’m still sailing at least one evening during the week just to stay practiced at preparing the boat to sail and then putting her away, plus keeping her uncluttered for an unscheduled trip. There are more trips planned in the future, including the PNW Westsail Rendezvous .

MNBB – TCP Client, Parsing and Queries

From here forward I will be including technical posts about my new project; MNBB which stands for Mariners NMEA Black Box. I mentioned it a couple of posts back and have been hacking on it for the last week getting the foundation going so I can start working on the small parts.

First, a little background about how I decided to start this project.

When I first took up sailing, I had no idea about NMEA or even marine networks. It’s a technical topic with several layers of confusion. First, the NMEA standard is extremely out of date. When you have an instrument such as a barometer, you can send the barometer data to another instrument. NMEA experts call this talking. Any instrument can talk to several other instruments. When that instrument wants to receive data from different instrument, it is limited to one single source. This is where the problem lies. To make your marine navigation system play well with others you need to take all of the instrument NMEA wires and plug them into something called a multiplexer so it can listen to many instruments and then talk to many other instruments, multifunctional displays or networking devices. A multifunctional display would include your chartplotter and a networking device can transmit the nmea data to something like a computer or smartphone so the apps can use the data to assist you in navigating your vessel.

What does not exist already is a data logger or any kind of device that can recall what your instruments were outputting on a given voyage. If they do exist, they would cost exorbitant amounts of money and deliver not so promising capabilities. For a recreational consumer this cost tends to be prohibitive. The idea came up to develop this capability using a very inexpensive computer and completely open source software so the consumer can actually afford this kind of instrument. Since it’s just me working on MNBB this could take the better part of a year in my spare time. I’ve opened the project to anyone who is capable of contributing in the hopes that it will speed up development and deliver a beta version as soon as possible.

The benefit to this kind of product is mainly for those who would like to have a look at their instrument data and try to make better decisions about their current and future voyages. For example, if you could follow barometric pressure over a selected period of time, perhaps you could see that the barometer is dropping at an alarming rate. I like to be able to use technology to help me keep track of what has happened in the past so I can recall this information whenever I want. What about comparing wind speed and barometric pressure? Can you think of anything that might be useful in that comparison? I think there is quite a bit worth looking at.

Getting Started

The first step in this project was getting my Raspberry Pi computer up and running. This required just a few temporary peripherals. I needed a monitor, mouse and keyboard so I could install the operating system and boot the computer for the first time. After that, I no longer needed the peripherals because I use my laptop to login to the Pi and do everything I need. The second step was to decide what technology I can use to start writing the application. Since I am a JavaScript engineer and I like the simplicity of Node.js, I decided to use it for the entire architecture stack. The benefit is that the entire application will be written in one single language. We call this full-stack JavaScript. Don’t let anyone convince you that this is not a good application platform. It has been proven for it’s simplicity at working with networking, file systems, database communication and most other common needs of an application platform. Once I had Node running, I could use a simple client script to connect to the network and stream NMEA sentences from the Vesber XB wifi NMEA client. It took about an hour to get it working.

The next step after knowing my Raspberry Pi was receiving NMEA sentences was to start parsing the sentences to something meaningful. I had already seen a Node NMEA parser in Github and it is under the same license as the MNBB project so I forked the project and it worked right out of the box. Each NMEA sentence has an identifier that tells you what type of sentence it is. The parser already includes the following: GPGGA, GPRMC, GPGSA, GPGSV, GPVTG. To prove that the parsing library was built properly and easy to contribute to I decided to write my own parser for GPGLL as a proof of concept, which is a simple global positioning latitude and longitude sentence. To my surprise, within an hour I had developed a complete parser for an unsupported sentence. 

NMEA parser
NMEA parser
NMEA data storage at intervals
NMEA data storage at intervals

The next step is storing the data. This is called a data logger and so the next step is to build a simple database that can collect the parsed sentences and store them for later retrieval. This will take some time to complete because I am not completely certain the best way to store everything. An important step is ensuring that not every single sentence is stored. I only need a subset of the data because there will be a ton of duplicate data, which can cause storage capacity issues over a long period of time. One issue I can see is how some types of data may need more sentences to be stored than others. For example, AIS sentences provide real-time information about other vessels broadcasting their position, speed, distance, etc. These sentences need to be parsed differently than something like water temperature, where you might only need to log the single value once every five minutes.

NMEA data parsed into JSON
NMEA data parsed into JSON

What’s next?

At this point in time I am building a Mongo database for Linux on the Pi and should be able to begin storing all of the supported sentences at whatever intervals I want. I am able to connect to the NMEA client, receive a set of data and then send the data to a Mongo database. I can also run queries with a given talker type (e.g.- GPGLL) and respond with a set of results that can used in a web application. I am going to integrate the web application framework next so I can write the first web app and view it from any device I have connected to the same network. I am also hoping that by the time I have the first release that getting Mongo installed on a Pi will not take twenty-four hours to build from scratch.

The scale of some of the projects is beyond my capabilities at the moment. It’s a perfect way to understand how to gain skills to understand how some of the information is determined for marine navigation. For instance, comparing apparent wind and true wind requires an algorithm that will calculate true wind speed and direction from several input parameters (speed over water, heading, etc) . Once I have written the algorithm I can use this input as part of any wind instrument application.