Invasion of the body snatchers

When there’s a lot on your plate to do, time just seems to wiz right by and this month both David and I can say that the last couple months have flown by with the speed of lightning. We were both busy during the summer and then in September, Schooner Chandlery exhibited at the Port Townsend Wooden Boat Festival. It was a fun event and we enjoyed having John Fruehwirth do demos of wood carving at the booth during the event.

John Fruehwirth wood carving Schooner Chandlery booth at Port Townsend Wooden Boat Festival

Following the Festival, David had a software project in Colorado to attend to for a bit. He brought back a doozie of a Colorado cold and after nursing it for a week, passed it on to me to let it linger in the boat longer. We both finally felt un-sick and capable on Saturday the 14th of October, a full month after the Festival.

Earlier in the week, I was feeling guilty for letting Mahdee get so dirty without a good washdown so I scrubbed a month’s grime off Mahdee’s topsides. I’m happy to say her varnish is still glossy and bright from last fall’s varnish-fest. The covering boards and bulwarks look so perfect so that only I would know that it’s been a year. Running out of time, this may be the first year that since 2009 that I do not complete a full varnish round-robin on Mahdee. I have to do the butterfly hatches as they won’t make it through the winter without another few coats — and the canvas covering their piano hinges needs to be replaced or we’ll have drips of water in the main saloon during the winter rains. I put on the canvas hinge covering–at the suggestion of Chris Frost of Downwind Marine–in 2009 so I’m pretty happy that it’s made it through 8 years without real leaks. However, the edge of one bit of canvas hinge cover is getting frayed and we noticed during spring 2017 saturating rains it would eventually leak below onto the main saloon table.

Mahdee’s charthouse exterior has not been re-painted or weatherproofed since 2010 and it’s showing cracks in the paint along all the structures like the corner posts and whatnot. A few bungs have cracks in the paint showing and one has a nasty red rust stain as a reminder that, while we did replace all the iron fasteners in the hull and deck, we didn’t replace all the iron fasteners in the charthouse. I put together a little pile of scrapers and sanding papers for my assault on the butterfly hatches and charthouse this week. Tomorrow I’ll be out and about most of the day but mid-week begins my “mini” paint and varnish-fest to include aforementioned hatches and charthouse as well as the cockpit bench seats and combing interior that have flaky paint. Midwinter flaking paint is never a good thing and usually, I sand and re-do the cockpit seats every year. Last year I didn’t do it and it’s very easy to see that.

The charthouse roof canvas and the canvas in the cockpit surround are also looking worn and in need of repair or replacement. Since the real water proofing is done with the metacrylic membrane under the canvas I know I can put off the repair/replace until next spring. I may just remove the canvas this week and go with the naked metacrylic through the winter. It’s gray color isn’t as nice as the straw color of the painted canvas but I’d probably be happier to be rid of canvas with little rips and flaking paint. Another project for the list.

Sherwood Raw Water Pump Impeller Housing with broken bolt

The Mahdee tasks that have been delayed by life intervening are now slowly getting put onto a list and much more slowly ticked off the list. This weekend’s Mahdee “togetherness” highlight for David and I was changing the oil bypass filter and replacing the raw water impeller on the Cummins while also flushing out the raw water and coolant systems. Finding the pencil zinc largely intact in the heat exchanger was sort of a bonus. Usually, it’s a pile of mush that has to be cleaned out of the exchanger. The low-lite of the experience for me was breaking one of the three corroded stainless bolts that hold the Sherwood impeller housing onto the engine while I was removing it. Usually, David does the honors of breaking bolts and I can make fun of him for it. This time, I was the culprit. The low-lite for David was tearing up his hands while contorted into the required spot and turning the wrench to get the impeller housing back together. What should have taken us two hours turned into a whole weekend. Break a bolt, 5 minutes. Replace it only after driving to a store and finding a replacement, 2 hours.

Somehow we were both pretty exhausted at the end of our mini-maintenance weekend and wondered what had come of our energetic and nimble bodies we’ve spent a lifetime abusing. Had bodysnatchers invaded and given us these low performing versions in return for our old selves? Happy with the Cummins basics completed, we chose to just enjoy a Sunday evening petting Beryl and watching a movie on the computer, stuffing the spectre of the body snatchers into the recesses of our minds.

Beryl the body snatcher?

The Power of Raspberry Pi–MythTV tweaks and techniques

This post continues my previous ramblings about using the Raspberry Pi aboard the boat.  To start this story at the very beginning, go to this post. To go to the previous post in this series, go here.

Screenshot of MythWeb running on Raspberry Pi 2

Now to discuss some lessons we have learned about using our RPI-2 with MythTV aboard Schooner Mahdee to record over-the-air TV broadcasts for later viewing: Why record when so much is available instantly over the Internet?  Four reasons:

  • we are often anchored where Internet access is unavailable, or the speed is too slow to stream video;
  • we pay for high speed (4G) access per gigabyte;
  • broadcast HDTV provides an effectively free source of additional bandwidth and the HDTV programming is often many times much higher resolution than via Internet streaming;
  • those shows can be saved on a hard drive for later viewing anywhere and anytime.

Stunningly beautiful full 1080 HDTV programming is often broadcast and can be saved for later viewing on a big vibrant HD computer monitor–even in places with no Internet at all.  Those very high resolution shows consume around 5GB per hour.  If using our 4G hotspot, at that rate, our entire monthly Internet bandwidth for work and pleasure is equivalent to a couple of HDTV movies.  By comparison, in some locations, we can record HDTV shows around the clock for free–an incredible deal!  In practice, each 24 hours of saved H-264 encoded HDTV recordings exceeds our total Internet bandwidth usage for the entire month. Our only cost is for the hard drives and each $150 hard drive can save thousands of shows and take up less space on the boat than a small paperback novel.  So, even when we could stream videos over the Internet, we rarely do.

Since we obviously travel a lot, our settings for MythTV are not set and forget–in contrast to more stationary users.  We use Antenna Web in each new location to determine where HDTV transmitters are relative to us and how well we can expect to receive different stations.  We have both an omni-directional and a directional gain antenna to choose from.  Spinning around on a single anchor makes the directional antenna unusable, but if the boat is fixed in orientation with multiple anchors or shore-tie, we can use it to increase reception of more distant HDTV stations.  Sometimes we can get great reception with the antenna below decks in a stealth mode.  For more challenging stations, reception may require an antenna be raised on a flag halyard–not so stealthy.

We have an inexpensive account at Schedules Direct which interfaces very well with MythTV.  With an Internet connection, we generally upload new schedule data every day or two.  There is limited (just the next 12 hours) program schedule data provided for free by the stations themselves on the transmitter frequency using EIT, but scheduling works best with longer range data and Schedules Direct provides about two weeks of scheduling. That data also includes lists of actors and other credits as well as descriptive information which we retain with our recordings and in a separate custom Ruby-on-Rails (RoR) web interface and database.

Schedules Direct also allows us to have four different locations in our profile.  Thus, we have one for each major city area we typically visit.  In those profiles, we can remove stations we do not want–such as those without English language audio–and our custom settings will persist until our next visit to that area.  I am constantly amazed at the number of over-the-air broadcast stations we can receive even when we are far from a metropolitan area.

With our large MythTV database of over 10,000 previously recorded shows, nearly 100 channels of available broadcast programs in many locations, and large number of rules and priorities about what we want to record, it can take several minutes after starting the MythTV back-end for it to figure out what to record. During that time, the MythTV front-end and MythWeb browser interface running on the RPI-2 will will show no scheduled recordings. Whenever possible, I use the command-line mythtv-status to see what is in the recording queue rather than running the more resource-intensive front-end. Even mythtv-status can take several minutes to complete and will show that nothing will be recorded until all of the data has been parsed and prioritized by the MythTV back-end.  Loading new schedule data from Schedules Direct can take nearly 20 minutes to process on our–admittedly overloaded–RPI-2. Sort of like sailing tack to tack to get to one’s ultimate destination, patience is required and one can not expect a newly added show to be put into the recording queue right away. I plan for the RPI-2 to take up to five minutes before a new recording is reflected in the queue.

With an Internet connection, MythTV gets program meta data for each recording so that we have images of cover art–which makes the front-end display nicer.  MythTV can also flag commercials so that they can be easily skipped during replay or even removed from the file entirely.  Commercial detection is very resource intensive, so we set MythTV on the RPI-2 to not do any commercial detection on the recordings. With this setup, the RPI-2 is also very useful as a desktop computer for me to browse the Internet using Firefox/Iceweasel, read and write email and other miscellaneous things all while displaying current weather data and monitoring anchor holding.

One glitch that I have encountered is that the MythTV startup script does not always work in Debian Jessie due to incompatibility with SystemD. The symptom is that the startup script completes with no errors, but the back-end is not running–starting and restarting MythTV using has no effect. The problem seems to be related to the init-functions command. Adding the following just before that call in /etc/init.d/mythtv-backend as follows helped:

_SYSTEMCTL_SKIP_REDIRECT=true
. /lib/lsb/init-functions

Then that fix failed so I am now manually starting MythTV using the old InitV command:

/etc/init.d/mythtv-backend start

It is also good to ensure that MythTV is not running before starting it and to make sure there is no file named /var/run/mythtv/mythbackend.pid. First kill hung processes and then check for the pid file and delete it if necessary before staring MythTV using the above command. Since I rarely reboot the RPI-2, manually starting MythTV works fine and the InitV command is trouble free.

Another glitch is that the HD HomeRun recordings sometimes fail leaving MythTV thinking the recording is still happening. After upgrading the HomeRun to the latest firmware, this situation happens less often. Still, every few days I need to stop MythTV and wait for all the threads to be killed and then restart MythTV.

Next, I will cover some system-wide optimizations that we have made that make MythTV more reliable given the highly loaded RPI2 we run it on.

The Power of Raspberry Pi–rethinking and restructuring to do even more with less

To start this story at the very beginning, go to this post. To go to the previous post in this series, go here. As it may be clear from the discussion so far, I have a tendency to increasingly add more requirements and functionality to my Raspberry Pi (and/or the newer version 2 RPI-2) computer until it cries “uncle”–or more often than not, just quietly dies under the extreme load. This post is about adding more functionality, but by being smarter, avoiding the dying part–at least for now.

myth tv running on raspberry pi
Every traditional boatwright needs to watch the Woodwright’s Shop for inspiration.

One of our luxurious activities when paying to be at a marina with shore power is to run my Shuttle small-form-factor (SFF) computer with its Intel i7 CPU and lots of RAM and lots of storage space. When it is running, it records over-the-air–using an antenna–HDTV movies and shows according to various rules we have programmed. Those shows are re-encoded by the Shuttle computer in a very efficient format to make the files smaller–1/3 to 1/5 original size–and then saved to a hard drive for later viewing–like when storm-bound in a remote bay somewhere in Alaska.

Our time in marinas is limited and the Shuttle requires too much power to run just for recording shows (producing non-shore power electricity is very expensive) and the movie recording program is way too demanding for a regular RPI. But now I thought maybe, just maybe, the new RPI-2 could record TV programs–of course I really mean do that in addition to all the other stuff the RPI-2 already does.

The program we use to record over-the-air shows is called MythTV. I have a love-hate relationship with MythTV, but we have been using it for about 10 years and it keeps track of every show ever recorded by us so that it doesn’t re-record something we already have on a hard disk or DVD or CD-ROM somewhere on Mahdee or in storage. The challenge for us is that the database for MythTV has a huge number of recordings (way over 10 thousand) to keep track of and the scheduler needs to sort through all of our rules (which are numerous and have evolved from our refinements over those same 10 years) and compare rule-matching scheduled showings to already recorded shows and determine which shows to actually record when so as to optimize the recordings. I had my doubts that even the RPI-2 would be capable–let alone doing that task while also doing the really important stuff like keeping track of the weather and how well the anchor is holding–after all, we do have to keep our priorities straight.

To make the RPI-2 able to record TV movies we had to make some changes.

1. We bought a network HDTV tuner (HD HomeRun Extend HDTC-2US) that has a built-in transcoder that re-encodes the movies in a more space-efficient format (H-264) on-the-fly. This removes the requirement for the RPI-2 to re-encode the recordings–which it couldn’t do anyway–and keeps the file sizes reasonable. In addition, H-264 is an open standard whereas the original inefficient proprietary format used in over-the-air transmissions requires one to buy a MPEG license before the RPI-2 can perform hardware decoding for viewing. So not only is the output of the HD HomeRun more space efficient, it also uses an open standard that doesn’t require the purchase of a license. The HD HomeRun even runs on 12V DC which is nice. So we installed a 60W regulated 12V DC power supply on Mahdee to use the HD HomeRun off a 12V DC battery.

2. The other change was to continually power up the Linksys Wifi router. The Linksys is also powered by 12V DC–so it can use the same newly installed regulated power supply as the HD HomeRun. Earlier, we tried to make the RPI be Mahdee’s Wifi access point in order to save the power required to run the Linksys. Running the Linksys offloads the Wifi access point functions but more importantly, also provides a needed Ethernet hub. The hub makes is possible for the HD HomeRun tuner to be available to the RPI-2, as well as to my Shuttle computer, all over fast Ethernet rather than Wifi. Further, we decided that we could also keep running the old RPI and use it via Ethernet to offload some functions from the new RPI-2–such as internet gateway, firewall, GPS server, network time server using GPS, secondary/backup anchor position alarm, Scrabble game server (oh–didn’t I mention that requirement), as well as that coveted contact and calendar schedule web server.

The net result is that, even though we now have two Raspberry Pi’s running (an RPI and an RPI-2) along with a network TV tuner and a Linksys router (the latter two alone adding 24 amp-hours a day to our afloat battery usage), our electric power usage is less than half of what it was at the dock with the Shuttle computer running. We are now getting recordings and a practical, fun to use computer that is available 24-7 even while at anchor. All that while logging weather and boat data and monitoring that important data with alarms to keep us safe. The RPI-2 has been exceptionally reliable with our previous and current up-time exceeding three weeks since the last intentional reboot.

When passage making, we can turn off the network TV tuner, Linksys router and the RPI to reduce power usage without loosing any important functionality–e.g. don’t really need our contact server in the middle of the ocean. And with no TV tuner, we can turn off MythTV and have plenty of CPU capability on the RPI-2 to run the OpenCPN chart plotter which can use either the weather/boat data pseudo serial port on the RPI-2 for GPS data or the GPS data on the RPI if it hasn’t been secured to save power. With this nice flexible and stable setup, I have to keep telling myself not to add anything new. Unfortunately, I know that it is only a matter of time before I come up with new ideas of things/tasks/programs to add to the RPI-2. With any luck, a new more capable RPI-3 will come out before I completely overload the RPI-2. Right now, however, I am really happy with both my RPI and RPI-2.  Next I will cover some tips for running MythTV on the RPI-2 without impacting all the other stuff the RPI-2 needs to do.

Pictures of Helper Tools: Freebag Pro

One thing leads to another it seems, for example, last summer while I was linking the Schooner Chandlery’s Freebag store page to the video of their yachting product, I discovered the Freebag Pro on their Norwegian site. As I read all about it, I became excited by the product. Really excited. The original Freebag was developed by Norwegian yachtsmen to increase comfort and endurance on long voyages in rough waters. Out of that development came the Freebag for Yachting and the smaller Freebag Pro for Industrial Use.

Over the years, use of this Freebag has been explored by a wide range of groups, ranging from archaeologists spending days on their knees, photographers seeking the best image in an awkward situation, and welders often working in cramped uncomfortable positions. I watched the video with guys using the Freebag while kneeling on rebar and then using the Freebag in a pool of water.  I saw it used to cushion the worker’s shoulder while carrying pipes and knees while setting floor tile.  I thought “I want one of THOSE Freebags!” David and I, like most other DIY boaters have spent countless hours and days on our knees or even contorted into uncomfortable places with stringers and bits and pieces of the boat jabbing us in the side, back, and chest as we try to get something done in an awkward place.

Both David and I thought “Oh, if we’d only had this while doing Mahdee’s rebuild — wouldn’t that have been nice!” We still have our crawl around and contortion jobs — from cleaning the bilges to replacing the raw water impeller on the engine — so there are still numerous opportunities to be jabbed by hard and sharp bits of Mahdee.

While I was working with Freebag to arrange for the yachting Freebag to be imported, I chatted with the Freebag company telling them how excited I was about the industrial product and I learned that, in Norway, the industrial Freebag is sold by a chain of tool stores and pretty much every archaeologist there has one too. The company sent me a few of the industrial Freebags for US DIY boaters, boatwrights, and yard workers to test out. Of course, the first thing I did was check out the product for my own varnishing contortions on Mahdee’s foredeck. David also made use of the Freebag while cramming himself into the lazarette for a project. The lazarette door has an uncomfortable 3″ threshold that jabs you in the ribs, back, or whatever part of you that spans it.  Unfortunately we have reason to work in that tiny space with some frequency.

As Mahdee readers know, I’m the varnish person aboard. But I wanted to get some photos.  So David demonstrated the Freebag Pro as we have used it so far on Mahdee: kneeling and laying on it to varnish. I also took a quick picture while David was using the Freebag in the lazarette. All-in-all, a great product for our use during DIY projects aboard Mahdee.

Below:  The Danforth Anchor blocking includes some very pointy bronze hardware that gets in the way when varnishing the foredeck.

danforth anchor brackets

It is much more comfortable to lay on the Freebag than on the pointy bronze hardware!

2

The perimeter of the boat includes a lot of covering boards and bulwarks that lead to many hours of on-knee time while varnishing. I dislike knee pads and so the Freebag is perfect for my use when kneeling.

kneeling with Freebag for industrial use

This Freebag Pro is smaller than the yachting Freebag and while it is big enough to sit on, it is small enough to hook to your belt to carry it around a worksite.

Belt carry of the Freebag for Industrial Use

Freebag for Industrial Use

The lazarette threshold is over 3″ tall and about 1″ wide with sharp corners that dig into your back as you’re halfway in the space to lubricate the worm gear steering, rearrange the mooring lines, work on the engine exhaust or, on the port side, to open and close the generator exhaust thru-hull each time the diesel generator is used.

lazarette threshold

This Freebag isolates your body from the threshold.

isolate

The Freebag also cushions the rest of you because it’s just long enough for the length of an average size person’s torso.

cushion with Freebag for Industrial use

We’ll be putting more information online over in the Schooner Chandlery about Freebags — and the Freebag company will be taking pre-orders for the product here in the USA soon. In the meanwhile, David and I will continue to be among the few lucky DIY boaters who have a Freebag Pro!

The Power of Raspberry Pi–the new resurrection

beryl and RPI On Lap Monitor
For background and to start this story at the beginning, go to this post. To go to the previous post in this series, go here. The Raspberry Pi (RPI) on Schooner Mahdee has continued to work well in its primary task–weather and boat data logging to hard drive and serving and displaying that data plus tides and currents as well as performing alarms for anchor position and wind speeds.

The RPI was clearly not good at interactive GUI applications except simple email and very basic web surfing. It was also not working satisfactorily as an Internet gateway and a Wifi access point. The harder we pushed the RPI, the more often it crashed and shutdown. Then the RPI-2 was released with 4-CPU cores and 1G RAM–four times the cores and twice the memory of the RPI–and I thought maybe now I can get everything I want.

The new RPI-2 is designed to use a more advanced ARM architecture which meant that a standard Linux distribution could be used rather than the Raspbian distribution required for the RPI. I like Debian, so I installed Jessie on our new RPI-2. The RPI-2 has a different setup of IO-ports so our woody Ti-Bow case was not usable. That gave me an excuse to keep the RPI in its case and temporarily mount the RPI-2 next to it without a case.

During the extended transition of applications and functionality from the RPI to the RPI-2, I connected the two together with a simple Ethernet cable–no hub needed. The 50W regulated 5V DC power supply we have on Mahdee has more than enough capacity to run both Pi’s, the HDMI monitor, Passport hard drive, along with various other USB accessories and device charging requirements. I describe installing Debian Jessie and setting up the RPI-2 to run the chart plotter OpenCPN here. That article also includes a link to download an installable copy of OpenCPN that I created.

Because we are sometimes without any Internet access, I try to anticipate and install applications before they are needed and while we have good Internet access. Whereas the RPI is well equipped with a 16G SD card, the Sandisk Extreme SD card we purchased for the RPI-2 has a capacity of 64G. More than 6000 packages are now installed on the RPI-2 using over 80 percent of those 64G. SD storage is primarily programs and their documentation because most data is saved on the external Passport USB hard drive. So we have lots and lots of programs. More programs than may ever be used.

There is some stuff (actually a lot) on the SD card that really isn’t needed there. Given our experience driving an SD card to its premature death by writing gigs and gigs of weather data to it, we are sensitive to this. Further, an SD Card with more free space will distribute writes so as to extend its life; a nearly full SD Card can not do this and is more likely to fail prematurely. Since the Passport USB hard drive is always connected (using an entry in /etc/fstab), we can move a few things there. My criteria is to only move things that are not needed to boot the RPI-2 and preferably things that have lots of writes; mostly static files that are primarily read can be left on the SD Card.

I create a directory on the Passport drive such as rpi2_rootdir and in that directory, I create the subdirectory rpi2_rootdir/var/cache. Then I move /var/cache/apt into that subdirectory and create a link to the new location in its place. The only time I really need the apt cache is when updating and upgrading and that subdirectory ends up with lots of data and writes that I would rather have on the Passport. Another file with lots of activity is /var/swap which is used by the package dphys-swap. That file is a swap file for when memory is scarce and therefore (unfortunately) can be heavily used in my setup. One can also move the /var/log directory to the Passport once everything is stable. Further, I create a subdirectory in my user home directory which links to a directory on the Passport drive and I use that directory (on the Passport) for most of my user data–e.g. my email folder, downloads folder, music folder, application data, etc.. With those changes, my usage of the SD card is now less than 50 percent–including a complete copy of NOAA charts on the SD Card as a backup.

After email (using Mutt) and general writing using VI/VIM, my most used interactive application is a web browser. In the original RPI, I often tried to use Midori, but it’s development fell behind and it failed to render a lot of sites. Net Surf and some other light browsers don’t work well for me. The new official light browser for the Pi is the Epiphany Browser. I have not been impressed by that browser either. Google Chrome is not available from the Debian ARM repository and I have not found an easy way to get it. My favorite browser, therefore, is Iceweasel (the Debian fork of Firefox). I install the Vimperator add-on which makes the browser usable without a mouse–you just need the keyboard–and then my web browser works much like my VI editor which provides a user interface consistency that is very nice. But, Iceweasel/Firefox is a resource hog! Fortunately, there are several configuration changes that can greatly improve the usability of Iceweasel/Firefox on a resource-limited device like the RPI or RPI-2. I use the modifications described here. Also, I add the following line to my .profile:

export set MOZ_DISABLE_IMAGE_OPTIMIZE=1

Before these changes, Iceweasel would slow down the RPI-2 the more it was used until the RPI-2 was virtually unresponsive. With the changes the RPI-2 works great with Iceweasel. I do try to limit the number of open tabs in Iceweasel, but I currently have 25 tabs, along with about a dozen terminal windows, my QT Weather program, XTide and can even use LibreOffice and have the interface feel responsive! All in all, a very nice computer experience.

The Debian Jessie install went great and the only real hitch for me is not limited to the Raspberry Pi. Jessie uses the new SystemD and that breaks a lot of UDev scripts I wrote to automatically start services such as the Weather data logger when the Airmar USB cord is plugged in, and the GPS position and time servers when the USB puck is plugged in, and the Internet gateway when the Palm is tethered. Jessie has packaged some automatic scripts which work with common new devices, but not our GPS, Palm, or Airmar. For the Airmar, it turns out that my automatic testing and recovery scripts will get the data logging started. The problems with my other old devices may not affect those with newer devices, but my solution for them will be covered in the next post along with some new stuff.

Google Analytics Alternative