The Power of Raspberry Pi: over reaching and hitting the wall

For background, see the previous post here. At this point, the Raspberry Pi (RPI) has proven itself aboard Schooner Mahdee by reliably logging data from our Airmar weather station plus other boat data and displaying that data on an HDMI monitor, as well as monitoring that data and sounding alarms as required. We built in the capability for more than one computer to read the Airmar weather/boat data from the RPI network port at the same time. To realize that potential, we needed a Wifi access point. A USB Wifi dongle, supporting the access point protocol, with the right software (in our case HostAPD) turned the RPI into an access point for all Mahdee users. A good access point provides some basic network services that were set up on the RPI–such as IP address assignment DHCP server–and is a domain name server (we used Bind9 server) for all the Wifi-connected computers aboard the boat.

Raspberry Pi and Cat

Further adding to the roles for the RPI, I wanted to be able to read email without turning on any other computer, so we needed to set up internet access on the RPI. We set up the RPI to use either a Sprint phone with a data tethering plan using PPP or our Verizon Wifi hotspot using a second USB Wifi dongle. Since Brenda’s Windows 8 machine can’t tether directly to the Sprint phone, we decided to make the RPI Mahdee’s internet gateway that can be switched between either Sprint or Verizon. That also meant a better firewall setup for the RPI.

The RPI doesn’t have a hardware clock (by design it would rely on an internet connection to set the time on boot), so when we rebooted the RPI, sans-internet, in the middle of nowhere in Alaska, the data logger had the wrong time stamps. To fix that, we setup a USB puck GPS as a time source for the RPI. This meant also running a GPS position server on the RPI which is then available on a network port of the RPI for other computers aboard Mahdee. The fast high resolution GPS data was also setup to be used by a Python anchor watch and position alarm which I’d previously written for the Nokia N810. The sound system on the RPI is not very good nor very loud even with our USB powered amplified speakers.  For the alarms we setup a piezo-electric buzzer which is energized by a RPI GPIO port so that we can hear alarms anywhere aboard the boat. The RPI also uses GPS time stamps to provide a network time basis for other computers aboard.

With the 2TB Passport hard drive attached to the RPI, it only made sense to put a copy of our public file archive on it and thereby make it available to us 24-7. The public file archive includes repair manuals in PDF form for most boat systems (nice to have in an emergency), all of our photos as well as digital books and magazines (nice for passage entertainment). This nicety meant putting PDF and e-book readers on the RPI. Then, to enable access to those files from Windows computers, we setup a Samba server which also requires a network time server. Fortunately we already had the GPS-based network time server on the RPI.

To enable us to read our email when there is no internet connection available, we setup the RPI with OfflineIMAP to sync mail from our main email server (an off-boat/shore-based virtual private server) whenever we have internet access. I read email using Mutt which can run in a terminal on the RPI. Brenda likes to access email using SquirrelMail webmail via her computer’s web browser, so we added an Apache2 web server to the RPI along with Squirrel Mail and an IMAP server.

In among the public archive data is our music collection, so we setup RPI as a network music player. On those long passages, we thought it would be nice to listen to music, but this is where things start to break down. The poor, now very overloaded, RPI just couldn’t make the music sound even decent. I also setup my Bluetooth stereo headset on RPI, but that was even worse than listening to broken up music through the speakers.

Many boaters want their RPI to run a navigation program like OpenCPN. I had managed to compile a version of OpenCPN on our first RPI, but running OpenCPN required all the resources of the RPI and I was not willing to forego all the other important roles our RPI was needed for–simply to use OpenCPN as a backup chart plotter.  Our real chart plotter is used to display radar and chart data including charts for other countries without free official charts (like Canada). Not needing to run OpenCPN helped a little with our overloaded RPI situation.

From the RPI GUI interface, I found web browsing to be very slow and unproductive. I could get email and read it using Mutt just fine, but there was other trouble lurking. Brenda informed me that basic web access from her computer through the RPI Wifi access point was way too slow. I tried it using my main computer and had trouble too. I had had hopes–fantasies perhaps–that RPI would also run a contact and calendar web service. Most people would just use Google for this, but we are often not near internet access and besides, who really wants to trust the big guys with all of your sensitive contacts and scheduling. But, it was not to be–at least not yet.  Stay tuned for the next installment in this series of posts about the RPI and how we turned the corner towards success.

The Power of Raspberry Pi: the blissful beginning

When we first heard about the Raspberry Pi (RPI) credit-card sized computer we thought that it might meet the goal of a low energy usage (just over 1 Watt) server on Mahdee that ran 24-7 and performed some essential functions. Those functions included logging, serving and displaying boat and weather data, as well as monitoring that data and sounding alarms when something isn’t right.  Our first RPI took many months to arrive because of demand exceeding supply in 2013 and the RPI coincidentally arrived at the marina office on Pi day (March 14).  It was late afternoon when I excitedly went to the office to take delivery (possibly just before 1600 and presaging a near obsession with this delicious sounding device).

Screencast of weather program on Raspberry Pi

The first RPI had only 256MB of memory and saw little use before we broke the SD socket. So it was replaced by the upgraded RPI with 512MB memory. With twice the memory of the original RPI and an over-clock ability, I was full of anticipation about what this improved, yet still power sipping lilliputian computer was capable of.  In hind sight, there was much to learn about the RPI.  This is the first in a series of blog posts describing how Raspberry Pi’s are used, and how their use has evolved aboard Schooner Mahdee. For the impatient and those who prefer doing rather than reading, the latest version 2 of the Raspberry Pi (RPI-2) can be purchased here and by following that link, you get a great price and can help to support the Raspberry Pi Foundation mission as well as this site.

Weather data on Mahdee is provided by our mast-top Airmar PB-100 weather station. The Airmar PB-100 provides relative and absolute wind direction and speed, barometric pressure, temperature, humidity and dew point, as well as boat magnetic heading, pitch angle and roll angle, GPS position, GPS course and GPS speed. The Airmar data is multiplexed with some boat data such as depth-sounder, water temperature and boat speed through the water before being sent via USB to the RPI. In order for the RPI to decode the Airmar data, the ftdi_sio kernel module must be loaded. And the crucial trick after loading that module, is to execute this special command:

echo 0403 d9a8 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

Without that change the data is not a readable serial port stream. With that change, the Airmar data is readable. We wrote a script to capture the USB serial data, time stamp each line with computer time and save it to a file. Initially, that data was saved on the RPI SD card which the RPI uses like a hard disk and also has the operating system and programs on it. SD cards have a fixed number of writes in their life, and after about a year, the limit was achieved and the SD card failed. So, we got a new SD card for the operating system and programs and a Passport USB-2 hard drive to hold data and thus preserve the life of the SD card.

When the weather and boat data are being saved, the data are forked and also sent to a serial-to-network converter that provides a pseudo serial port that is available on a network port of the RPI. We then wrote a QT-based program to connect to that port, read the data and display it on the RPI’s HDMI monitor. The QT program requires a GUI on the RPI and has many alarms including a position/anchor alarm, as well as a wind speed alarm. We cross-compiled the QT program to make different executables that run on the various computer architectures we have on Mahdee. An early version of that program was published on my GIT account, but if anyone wants a copy, please let me know so that I can update the version on my GIT account.

In the first versions of the QT program, we discovered that the displayed data was lagging further and further behind because the QT program could not always keep up with the Airmar data feed. This defect became painfully obvious during three sequential southerly gales while sailing north in March off the Oregon coast on our way to Alaska and striving to not unintentionally gibe–the displayed wind gust directions were just not matching the observed effects. It was pitch dark and freezing cold out in the cockpit with boarding seas and driving rain and we really, really wanted to steer from inside Mahdee’s warm, sheltered chart house and that required a good weather display with real-time information. We fixed that problem (later while recovering in a marina in Alaska) by allowing data to be dropped in the QT program so that the displayed data is the most recent data. If we want to analyze all data, we can then retroactively parse the saved file.

Sometimes the data capture would fail which would freeze the data displayed by the QT program. This required us to first notice the data freeze and then find the source of the problem.  We immediately noticed a data freeze when we were hit by a williwaw in a fjord in BC Canada and the displayed wind speed froze at only 56 knots even though conditions and our control of Mahdee were rapidly deteriorating. At the white-out stage, we knew something was wrong with the display.  The fix was usually to manually restart the data capture program, but there were often long gaps with no saved data because we didn’t notice the failure right away (or alternatively we were too busy fighting to control Mahdee in a williwaw). This was a big problem if we were counting on the RPI to sound an alarm–e.g. if the anchor came unset while we were asleep. So we wrote a Cron script to periodically check for file updates and if too much time passes without an update, a script automatically runs to restart the data stream. Alternatively if the external Passport USB drive becomes unavailable, the logger will automatically switch over and use the SD card for data storage. The automatic scripts greatly improved the reliability of our weather and boat data and improved confidence that the alarms will sound when they should. At this point, the RPI became a key piece of safety equipment aboard Mahdee.

Of course, we want the RPI to do more and in the next post we will discuss our experiences loading up (overloading?) the RPI.

Little by Little

We might as well start with a look at the sort of scenery I’d like to be viewing along about now–Mildred Island, ah, it was so peaceful and pretty last fall.


Now lets show a what I am seeing right now–yep, that’s a Dyneema core-with polyester braid splice underway (New England Rope Endura Classic) and Brion Toss’s Riggers’ Apprentice laying on my feet. I’m splicing lines for the running backstays.

Oh, yes, that’s right–forgot to mention, it’s raining outside and David is puttering around all over the place inside so my rigging station is our bed–safely out of the way. The upper running backstays are Amsteel Blue and very easy to splice but the lower portion uses the funky braid-over-high-tech line which is a little harder to splice. And to think–it’s all so the lower portion will look very “traditional” and classic rather than high tech!


The running backstays are interesting. We did some “quick-it-will-work-for-a-while” runners when we rigged Mahdee in 2009. It’s time to return them to more like what they were in the 1939 rig design. Originally Mahdee had running backstays with her 1931 gunter mainsail and the design was modified in 1939 when her mainmast was spliced to support a Bermuda sail rather than the gunter. She had no fixed backstay back then. The runners were removed by her owner in 1953. At that time, her owner installed a boomkin, shortened the boom and used a fixed backstay.

Her running backstays were not placed back in service until the 1960’s when she was raced for a while. Presently, she has a single upper runner and an “A” lower part that comes down to two chainplates on the deck. She is supposed to have an upside down “A” as the upper portion of the stay–attached to the top of the mast and lower near the triatic stay. We are installing that upper loop “A” with my new 3/8″ Amsteel Blue line and the lower loop “A” with the Dyneema/Endura Classic in 1/2″ (12mm).

No one seems to make a block exactly like that which Mahdee originally had (see the drawing below) to connect the two loops. Modern running backstay cascades use similar loops but most now rely on low friction rings. We could use that sort of system, but the polyester braid cover on the Dyneema really should have a sheave not just a low friction ring.

I discovered that you can connect two blocks head-to-head with something called an “upset shackle” so we may be doing that rather than fabricating specialized blocks. Initially David was going to just make a suitable wood cheeked stacking block to match our other wood blocks but we quickly realized that we’d not be certain of the load capacity of such a block set and they do need to be very strong.

The blocks will be leathered because they can touch the sails so they will happen to look pretty traditional. With the leather, it really doesn’t matter if the blocks are traditional wood or another more modern design and material. There are two makers of really lovely (and strong) wood blocks I’ve been in touch with as well as one sheave maker (in case David really wants to make blocks). It could go either way but I’m leaning towards just buying off-the-shelf blocks and upset shackles at this point.


Progress? I completed the splices installing the four 3/8″ thimbles in the upper backstay loops, did one of the lower backstays but stopped short of finishing the other one because I was getting sloppy. Tomorrow–finishing the other lower, and adding a couple Turks Heads to decorate the whipping required on the braid-over-Dyneema eye splices.

What does Beryl think about life aboard these days? She’s just happy when the laundry basket is empty and she can stake a claim to it. Unfortunately for Beryl, this is an older picture and our laundry basket is full-to-overflowing today.


Yes We’re Still Blogging


Beryl is dreaming of far off places; I really think she’s ready to get back out to sea where she can happily chase her toys as the winds and waves push the boat side to side in the perfect pattern to roll her favorite balls, strings, and straws across the worn teak sole. We remain in a serene marina environment, enjoying the mild weather and doing projects.


I’m starting to get notes that say “what’s up?” from several people. Those made me realize I’ve not updated the blog about our goings-on for over a month! Why? Well, many of our projects are amazingly ordinary, small, and boring!

In early January, David completed his project of making cabinet doors for some key shelving areas; I then varnished them and he installed them. Here’s a pic of the doors about to be installed. Suppose I should take a shot of them after the fact, too. Or perhaps just let our readers wonder how it went…

We are preparing for our northward progress this spring–what that means is we finally got an EPIRB (great deal at the end of 2013 with rebate from ACR) and we purchased a Simrad broadband radar system with B&G Zeus chart plotter. We’ve pulled, out of storage, the radar platform the previous owner had and are trying to figure out how to install it on the mainmast without putting the radar in harm’s way of the foresail gaff boom. There will surely be an interesting tale of the installation once the radar arrives here in about a week.

I’m also replacing the temporary (going on 3 years…) rope guard lines (aka lifelines and breast lines) with Dyneema ones as well as going over, with David, every inch of rig and rigging replacing any shackles or other things which seem worn or potentially under-sized. I ordered a total of 28 thimbles for the various guard lines–that means 28 splices I’ve got to do. I’ll be really good at the Mobius Brummel splice by the time that project is done! A strange combination of new and old with those guard lines–I’m using very traditional looking bronze pelican hooks combined with the Dyneema. All the parts haven’t arrived so that project is just a pile sitting in the corner right now.

A couple weeks ago, we took off the mainsail so I could put replacement batten pockets onto it (new RBS sail battens ordered via Sailrite), David sanded and then I put 6 coats of varnish on the boom. It hadn’t been varnished since 2010, so it really needed it in some spots! We then bent on our “spare” mainsail–this meant changing some hardware on the boom to fairlead the reefing lines. That means I’ve got more cleanup and varnishing to do. Sigh. It also involved seizing on all the slides on the sail’s foot. The sail previously had a thimble system on the foot where one tightened up a wire running through the thimbles and matching thimbles on the boom to manage the outhaul. That system was designed for booms without a sail track.




That spare sail is interesting–it is a Watts sail made decades ago for the 75′ 1958 Rhodes ketch Kamalii (Kamali’i) to serve as a spare mizzen sail during ocean races. It was never used. So, brand new Dacron that is decades old. It is also heavy 13 oz material. Our other sails are 10 and 12 oz. The sail may only last a season or it may last a long time–we don’t know. We purchased it from Minney’s in Costa Mesa, CA and had sailmaker Skip Elliott of Elliott/Pattison in Newport Beach take out the roach, shorten the foot by about 8″ and add a single reef. The sail had no reef to begin with. We had the reef placed high where our second reef is on the other main sail. We literally never use the first reef on that sail as we’ve discovered that in heavy winds the mainsail quickly overpowers foresail, staysail and jib combined.

Skip Elliot immediately recognized the sail while it was still in the bag when we took it to his shop–it turns out the lovely hand stitching was unique to a particular sailmaker that Skip knew from long ago. He said “that sail was made by Albert and will have number 7175 on it, it belonged to Kamalii and I saw it as part of a sail survey I did for the boat many years ago.” He thought the sail was well worth the work to make it fit Mahdee and that it would last quite a while.

Watts sails must be quite recognizable to people “in the know” and it seems that would not include us, the Mahdee crew. Kamalii’s sail number must also be quite familiar to people as well. While we were putting the sail up at the dock, one of San Francisco’s Master Mariners came along the dock and said “That’s a nice sail–made by Watt’s, huh?” and “7175, that’s a SoCal number–is it Kamalii’s sail number?” Go figure. I then spent 6 hours painstakingly snipping the threads to remove the sail numbers from the sail! We have no intentions of racing Mahdee but I’m beginning to think we should put her sail number on her mainsail. We’d have to research it and discover which is her earliest and proper sail number. We have seen photographs with 188 and 288. A three digit number rather than today’s four.

Perhaps instead of longing for ocean passages, Beryl is just watching the birds near the boat. In any case, the migrating birds are enjoying the sunny days as much as we are.


Thankless Tasks

Aboard Mahdee, we have countless tasks that must be done daily, weekly, seasonally, or by some other interval. Some of them are quite rewarding–cleaning the boat gives us a spiffy interior; varnishing the covering boards nets us a lovely classic look and numerous compliments from fellow boaters; keeping the hull clean and clear of bottom growth helps us sail faster through the water. Building and installing anything new is a rewarding experience. Then, we have what I call the “thankless tasks” which are truly invisible. Some sailors just don’t bother with the thankless tasks–after all, no one really knows if you’ve done them or not. You can just avoid thinking about them, too. There is no instant gratification, no reward, and as a matter of fact, your spare time is sucked into the black hole of these tasks, the bank account says “ouch!” and the cruising kitty diminishes all for…what…”what was it we did last week?” Yes, these tasks are not only “thankless” but so invisible that you forget you’ve done them at all. Why do them? well, in our case, it is for increased peace of mind–knowing that something probably won’t break down when it is most needed.

As our friends who have been reading the blog and website all along know, we did an extensive rebuild/restoration of Mahdee between 2007-2009. The previous owner had purchased numerous boat parts that we installed with the rebuild. An important big part was a brand new Cummins 5.9L 125 hp engine. He purchased it in the mid-1990’s but the build date on the engine was 1991. Old but yet never installed. We replaced belts and hoses and David rebuilt the Hurth transmission suspecting the seals would be bad but beyond that we just installed it in 2008 and with the re-launch of Mahdee in 4/2009 we’ve used it for more than 500 hours of engine time. I’m somewhat surprised we’ve used it that much in these past 4 years of primarily sailing.

Our engine maintenance since 2009 has been pretty minimal: We did flush the engine cooling fluids several times at the beginning but otherwise our use has been normal–changing the zinc anodes, the oil and replacing the raw water impeller as well as cleaning out the heat exchanger periodically has been the extent of maintenance. Last month, we purchased a variety of parts to do the first real tune-up on the engine. Some of the stuff was that which people would normally replace after 500 hours–David checked and set valve clearances so we had to replace the valve cover gaskets. BTW, the new ones are a pretty “Cummins Blue” vs the old black ones. We cleaned the air filter system and replaced various filters on the engine. We also replaced the belt which drives the water pump and alternator, as well as replaced the thermostat and associated seals.

Putting the valve covers back on. Note a yogurt container is perfect for covering the air intake while the air filter system is off the engine.

Some of the stuff fits into the “Thankless Tasks” category and isn’t of the variety that most folks would replace at 500 hours–but we felt this engine is so very old that we’d just, um, “feel better” if we replaced a few things.

We bought a new fresh water pump (a throw-away-not-rebuildable-part) and installed it. Looking at the rusted old one, I’m glad we replaced it.



We replaced a couple cooling hoses, well, “just because” we hadn’t replaced them when launching the boat so they were original ones over 20 years old. On the “it’s old, let’s replace it front” we also replaced the lift pump for the engine. If that would fail, the high pressure injection pump would likely fail and, well, that would be bad. The raw water pump was leaking a tiny drip of water when running so we knew we needed to get a rebuild kit for it (not a thankless task). We decided to make it into a “thankless task” and bought a brand new raw water pump (checking account “ouch!” at more than $600) as well as the major rebuild kit (another $100) so we could rebuild the old pump (to be kept as a spare) and install the new one. All sounds good until the new raw water pump shows up and it’s bright bronze (unpainted). Thus, another “thankless task” for me was to paint it white to match the rest of the engine.

Old raw water pump on the left, new one on the right

There is a purpose to the paint–with everything painted a light color it is easy to see leaks or warnings of wear. In the case of the old raw water pump, on inspection, we could see a stain of green bronze oxidation where the pump was leaking. Early warning of things to come. If I didn’t paint the new pump, not only would it not “match” the engine, heaven forbid! it also would likely turn green all over and we’d not have that warning stain before a larger doom was upon us. Even so, it’s a pretty thankless task to paint the thing. Once installed, it resides between the engine and a bulkhead–can’t stare at it and think “isn’t it lovely” without a flashlight, mirror, and basically standing on your head. I did touch up paint on all of the engine at the same time, so I can preen about that, too–if I remember to do so while staring at the motor. Hum, like that’s going to happen.

Painted and ready to install

David installed a (ouch! costly) bypass oil filter system. I suppose he can stare at it in wonderment and think “isn’t this nice” but in the overall scheme of things, it fits the “thankless task” category perfectly.

The engine tune-up included other thankless tasks but since David performed them and they’re nowhere to be seen now, I don’t know what they may have been. And that’s the thing about thankless tasks–only YOU know they’ve been done and that’s only as long as you manage to remember them. Unless you take photos, who’s to say they really happened?

Google Analytics Alternative