The Big Bash 2015

We went on our first boat trip of the year. We left our home dock on Friday, April 24th, and tied up to the docks at the Port of Poulsbo that afternoon. On Saturday I presented to the Cascadia sailors also in attendance, discussing Building your own Chartplotter with AIS, Radar, and followed up by listening in to presentations on sailing much further north than we have tried — all the way up to Alaska in most cases.  On Sunday, April 26th, we returned home, this time going around the east side of Vashon Island to avoid the currents, tying up at home in the mid-afternoon hours.

The map below shows the path as captured by our GPS location on our OpenCPN chartplotter with the purple track being the north-bound trip, and the yellow track being the south-bound return trip. There are a few gaps where I rebooted the machine for some reason or another, but it still shows the path we took quite well. I just extracted the route from OpenCPN, and used gpsvisualizer.com to generate KML files from them. Then I logged into Google Maps, and imported the KML files into a custom public map.

Preparation

Prior to the trip there was a ton of work to do.

Last summer we had a bit of an electrical issue on board, and lost our alternator and house bank of batteries. While we had replaced all the batteries, and purchased and mounted a new alternator, it wasn’t hooked up properly. I couldn’t figure it out as the wiring did not match up to any of the diagrams on the instructions that came with it. So before we went on this trip, I wanted to have a professional marine electrician finish up the installation.

I improvised a charging solution so that the engine wouldn’t die on the way, and drove the boat over to ModuTech Marine. At first even the electrician was confused as to what the instructions were showing. But he then discovered the issue: The instructions were showing three completely different options for installing the alternator. They just didn’t actually state that they were options, so I was trying to do all three at once! Less than an hour later we were done, and spent a couple hours cruising around Commencement Bay, validating that the batteries were, in fact, being charged properly.

Mechanically the boat was ready to go. Since this was the first time the boat had been running for any considerable time since last August, it was nice to just be out on the water.
20150420_125712

I also had to prepare for the presentation I was giving. I have been working on running OpenCPN on these low-powered systems such as the Raspberry Pi and CubieTruck for quite some time, but because these are active projects and platforms things change. Taking the opportunity, I started over from scratch, building the chartplotter on a Raspberry Pi 2, the most recent device. Over a couple days’ span, I had built a new system, running the most recent version of OpenCPN (4.1.412), with GPS location.

I also had an AIS receiver module that I planned on hooking up while we were underway and within range of signals. I also threw together a Powerpoint slide deck for the presentation, plus a bunch of other examples of hardware. The presentation was ready as well!

The Trip North

The trip north started out under overcast skies. We got a bit of a later start than originally planned, but did get some extra water in the tanks, and we were still well within the timeframe to catch the ebb current to assist our way north. We cruised through Colvos Passage at nearly 8 kts over ground, 6 through the water, with a substantial front to the south following us all the way.

The conditions were nice enough, though, that I was able to have a few hours to play with the AIS module, and caught our first ever AIS contact just as we were coming out of Colvos. It was a ferry leaving the Southworth Docks, and it showed up great! I wasn’t sure how to take a screenshot, so I simply took a picture with my phone:
First AIS Contact

Once we got to the north end of Blake Island, that front that was chasing us caught up. 2-3′ chop built up, and the ride got quite bumpy, right as we were entering into Rich Passage. Of course the Bremerton Ferry heading in at the same time didn’t do anything to reduce the stress of the situation. But once we rounded the southwest corner of Bainbridge island and turned more north, the wind pushed us straight into Liberty Bay. It was still windy and bumpy, but much better. The boat handles these conditions well enough that everyone was able to at least get a small rest in:
20150424_122447

An hour or so later we were docking at Poulsbo. I didn’t have the bow thruster working (did I mention we have had some electrical issues?) so it was a matter of lining the boat up on the dock and letting the wind push us in. We docked the boat as if we’d been doing it every weekend all year long! With the boat safely tied up to the docks, with shore-power and water, we were able to turn on a few movies and assist the rest of the Cascadian sailors as they arrived. Soon appetizers were shared and everyone was having a good time on each other’s boats.

20150424_161231

Poulsbo

The next morning we woke up to fog and glassy conditions.

20150425_07070420150425_07065020150425_074213

There is a ton to do for everyone in Poulsbo. The bakery is great. The bookstores are great. There are great restaurants. There’s even a great little aquarium with free (donations) admission. In short, it’s a great destination.

My AIS presentation went well, I think. It’s difficult to find that right balance between technical and non-technical aspects in a presentation like this. Some of the geeky sailors wanted to know things like what kind of interface do the chips communicate on between the modules, while other sailors just picked up the Raspberry Pi and said “well that’s kinda cool” before putting it down. But in the end, I had lots of people that seemed legitimately interested, and very few people walked out of the room. Well, except my wife of course.

I also wanted to listen to the other presentations, and was able to catch the vast majority of all of them. We definitely need to do more cruising on our boat, even if it’s just short weekend trips. But to hear about the multiple-months-long trips that these sailors went on, and see some of the thousands of pictures they took was amazing. The room was mostly full the entire day.

20150425_202319

Gramma and Papa took Tay and the dog home in the afternoon so that neither of them would be bored just sitting around. That night, with the boat to ourselves, we decided to watch the first episode of this season of Game of Thrones. About 20 minutes into the show, our electric heater went out. For those that have boats, you probably already know that electric heaters very often trip the breaker switch, and I assumed that was the situation here. Except when I looked at the switch panel, the breaker was fine. And the same was true with the breaker on the dock. For giggles I tried to turn over the engine, just to see… It barely made a sound.  Uh-oh.

So at 11:00pm, I dug into the engine room with a headlamp. I grabbed my electrical meter, and stuck the probes on the first house bank — 13.7 volts. Then I tested each of the other house bank batteries, and all of them were fully charged. I tested the starter battery, though, and it registered only 9.8 volts — essentially dead!

We weren’t stuck because with the fully charged house bank I knew I could get the engine turned over if I wired the engine starter to it. It’s not the most efficient way to do it, but once would work just fine. But I needed to figure out why we ran down our starter battery while plugged in to shore power. As I’m tracing wires and trying to figure it out, I lift up one of the house bank batteries to see behind it… and a large cable falls away loose. It was stuck between the battery and the battery case, and I couldn’t see it. It was also about 8AWG, so substantially large. I reconnected it to the negative bus, and realized that it was the return line from the starter battery charge circuit — the starter wasn’t charging at all.

I believe that because our 1-2-All switch was set to all, we were running down both banks all weekend, and only the house bank was being replenished. After letting the starter battery charge overnight, the next morning I tested the engine and she turned over without hesitation. We were good to go again.

The Return Trip

Most of the boats were starting to leave around 10:00. After a couple cups of coffee, and failing to give away the last of our mini cinnamon rolls, we decided to follow suit. Running the Raspberry Pi Chartplotter (because why not?), we backed out of the slip we had rented, into a very wide fairway, spun the boat, and headed back south.

The return trip was, for the most part, uneventful. We saw more ferries coming through Rich Passage, and again had to deal with ferries leaving the Vashon Island docks that confused us (we thought they were going to head east, so moved out of the way of that direction, but instead the ferry turned 90 degrees and headed north, more towards us than away!), but there was nothing truly concerning.
20150426_112546
The boat ran well the whole time, showing charging voltages on both battery banks, and we even took a short detour just north of Brown’s Point Lighthouse when we saw a small pod of Dall’s Porpoises off to our starboard.

Just four short hours after leaving the docks in Poulsbo, we were docking in our slip. Of course we did an absolutely terrible job on that docking maneuver! But at least there was nobody there to watch it happen, so nobody knows.

Right?

Advertisements

Lots of traffic to this little blog

Originally, I built this blog for myself. I wanted to use it to track maintenance and projects on our boat and to share trip reports and stories with friends and family; basically a captain’s log online.

But in the past few months, the traffic to this blog has dramatically increased, due to my OpenCPN Chartplotter project. It has been linked to in other forums, by other people that have found it in searches. It has been interesting to see.

I’ve also answered a few emails and forum posts from people that would like me to build one for them — either because they don’t have the time, or that have no interest in the electronics/software DIY aspect of the project.

Since I have a bit of an independent/entrepreneurial streak in me, this has had me thinking for some time that it might be interesting to create a device that takes all the leg-work out of creating a chart-plotter using standard components and OpenCPN. Everything, both hardware and software, that I’ve used so far has been Open Source, which allows commercial application and use. I’m not looking to quit my day job and be a chart-plotter vendor — Garmin, Lowrance, and Raymarine are already well established.

The idea is simply that the baseline system could be provided in an out-of-the-box solution. A low-powered device that can display GPS-located charts on a 7 or 10″ sunlight readable display by simply providing 12v power. Is this something that more people would be interested in?

Exterior woodwork

The cetol and varnish on our cap rail had seen better days. Due to a few weekends in a row of exceptionally sunny weather, we decided to tackle this project.

The first step was to strip the old varnish and/or cetol that was previously applied. We didn’t know what it was, but a heat-gun was able to soften it, and a scraper was able to lift it off:

20140824_141123

With two people, one person holding the heat gun and another scraping, one side of the cap rail could be stripped in about two hours. Another 30 minutes of sanding, and the rail was clear. You can see that the previous application was done fairly sloppily, as there were drips and bleeds:
20140824_125445

A few minutes with the shopvac cleared the side decks:

20140824_125425

We use Cetol natural. We truly don’t mind the look, but the ease of application is really why we use it:

20140824_150645

But to really make it look nice, you need a couple coats of Cetol clear over the top. You don’t need to sand between coats, and it gives a glossy “wet” look, and continues to protect the wood:

20141005_122005

20141005_122032

CubieTruck Chartplotter Setup

As I did with the Raspberry Pi, below is a complete set of instructions to set up the CubieTruck as a dedicated OpenCPN chartplotter:

20141004_102259

Base Operating System

  • Download the latest Cubian OS image from Cubian.org
  • Write the image to a micro SD card (I used a 32 gig card) I used Win32DiskImager on my Widows machine
  • Insert SD card into the CubieTruck, connect HDMI monitor, Keyboard, and mouse, and boot.
  • Login as cubie/cubie
  • Setup Wifi
    • sudo modprobe bcmdhd
    • edit /etc/modules and add bcmdhd module so that WiFi will be available on reboot
  • apt-get update
  • apt-get upgrade
  • Install cubian-update
    • The deb command was already in /etc/apt/sources.list so that step could be skipped
  • Turn off the screensaver
    • apt-get remove xscreensaver
  • Auto-Login to the system
    • create a new user and grant them sudo access
      • I can’t understand vi (Hey, I’m a Windows guy), so I used nano to update visudo:
        • su root
        • export VISUAL=nano; visudo
    • edit /etc/lightdm/lightdm.conf and add:
      • autologin-user={new user}
      • autologin-user-timeout=0
    • In a terminal run:
      • sudo groupadd autologin
      • sudo gpasswd -a {user} autologin
  • Install Hardware acceleration
    • apt-get install mesa-utils build-essential git cmake libx11-dev
    • install a user version of libGL from source
    • install libGLU from source
    • set the LD_LIBRARY_PATH environment variable to use usr/local/lib
      • edit ~/.bashrc file
        • add export LD_LIBRARY_PATH=/usr/local/lib
    • Verify with glxgears
      • over 100 FPS and a minimum of CPU usage

Setup OpenCPN

  • Build and install OpenCPN
    • $ git clone git://github.com/OpenCPN/OpenCPN.git
    • $ cd OpenCPN/
    • $ mkdir build
    • $ cd build
    • $ cmake ../
    • $ make
    • $ sudo make install
  • Download the appropriate charts
    • For all US waters, it’s very easy to find appropriate charts at NOAA
    • I decided to try ENC vector charts this time. On the Raspberry Pi the rendering was just simply too slow and I used Raster charts.
    • Expand into an appropriate directory. I used /usr/local/include/Charts
    • run opencpn with the -unit_test_1 flag to ingest and process all the charts that were downloaded
  • Restart the gpsd service
    • sudo killall gpsd
    • sudo gpsd -n -D 2 /dev/ttyUSB0
    • Note: cubian auto-starts the gpsd service on a restart
  • Launch OpenCPN
  • Set the charts directory to the directory you expanded your charts into
  • Add a connection for the gpsd service
    • Settings -> Connections -> Add Connection
      • Network
      • GPSD protocol
      • localhost address
      • 2947 port

At this point, in one weekend day, I had a complete chartplotter solution running on a CubieTruck:
20141005_175023

Resources

CubieTruck Upgrade to CPN Pilot

I love the Raspberry Pi. I really do.

I have three of them, and will probably purchase more. As a movie player (XBMC), or low powered (battery) computer, it really is great. And the price cannot be beat. Also, if you simply want a cheap integrated chartplotter, the Raspberry Pi is by far the most cost-effective platform. It also has the best community support.

However, for the autopilot/chartplotter project, I actually am running into limitations with it’s processing power. For example, when testing AIS functionality, the CPU was pretty much maxed out when running the services as well as OpenCPN — so much so that the entire UI would hang for a few seconds.

After researching the different inexpensive, low-powered, single-board computers, I decided to go with CubieBoard. Specifically the CubieBoard3, aka CubieTruck. It has a DualCore 1Ghz A7 SOC processor, 2Gigs of RAM, 4Gigs of NAND flash memory for an OS as well as micro SD, built in WiFi and Bluetooth, and most importantly a graphical processor that complies with OpenGL ES 2.0/1.1 so the graphics can be offloaded from the CPU. It should be more than capable for my needs in this project, especially since I still consider the performance of the Raspberry Pi to be sufficient.

It does come at a cost — It’s about twice the price of a Raspberry Pi, it consumes about 1.5 times the energy (2 amps at 5v), and is about twice the size physically:

RPI and CT

AIS on the CPN Pi-lot project

First of all, what is AIS?

Automatic Identification System, or AIS for short, is a system for automatically displaying location, tracks and information about ships (and other large vessels) It works automatically, transmitting the data over standard VHF frequencies. The information provided is then generally rendered by a chartplotter or other software.

There are some very interesting websites on the web that display AIS information in near realtime. MarineTraffic.com is one of my favorites.

I wanted to add the capability to receive real-time AIS information and display it on the CPN Pi-lot project I’ve been building. Fortunately, once again, the hard work and research has already been performed by other people across the world. They have discovered that USB software defined radio dongles (SDR-RTL) have the capability to extract AIS information using cheap and readily-available hardware and software.

I recently purchased a usb dongle from Amazon that was listed to work with SDR-RTL, and wanted to see if I could get any usable data out of it.

AIS on the Raspberry Pi

I followed the instructions on a few different blogs and forums. The following is the steps I performed to get AIS around all the small gotchas:

sudo apt-get install git-core
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot
rtl_test -t

At this point, the rtl_test program displayed the following error:

Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6
Failed to open rtlsdr device #0.

To resolve it, I needed to edit the /etc/modprobe.d/raspi-blacklist.conf file, by adding the following lines:

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

After a reboot, the rtl_test program confirmed that I was receiving samples from the USB dongle.

The next step was to install an AIS receiver:

sudo  apt-get  install  libasound-dev  libpulse-dev
wget  http://www.aishub.net/downloads/aisdecoder.tar.gz
tar  zxvf  aisdecoder.tar.gz
cd  aisdecoder
mkdir  build
cd  build
cmake  ../ -DCMAKE_BUILD_TYPE=Release
make

Then, open up two terminal windows. In the first terminal, type:

mkfifo /tmp/aisdata
rtl_fm -f 161975000 -g 40 -p 95 -s 48k -r 48k /tmp/aisdata

and in the second termnial, type:

./aisdecoder -h 127.0.0.1 -p 10110 -a file -c mono -d -l -f /tmp/aisdata

At this point, it appears I’m getting data flowing through, as I see the following:

Level on ch 0: 50 %
Level on ch 0: 50 %
Level on ch 0: 50 %
.
.
.

Since I am currently at home, and not within range of any ships that should be broadcasting AIS, I believe this is a success. However, I will need to bring all this gear down to the boat, test it there (where I know there are AIS signals) to confirm.

References

New TV Mounted

We watch a lot of TV aboard our boat. Quite often we will go down to the boat just to watch a Seahawks or Sounders game outside of the house. And most of the time when we are working on a project, we will throw a movie up on the screen. Or take a nap.

IMG_20120513_160637

 

We had a nice LCD TV that we just put in the aft, right next to the sliding door entry. This was not the best spot on the boat for a TV for viewing, as none of the seats in the boat were able to comfortably see it. Plus it had a tendency to fall over in rough water;  recently it got knocked off the shelf, and the screen cracked.

Taking the opportunity to upgrade, we decided to get a bigger TV, mount it, and move it to a more visible location.

Recently we purchased a Samsung TV from Costco, and an under cabinet mount. Then we spent a few hours installing it — a very straightforward process of drilling holes, and running bolts backed with big washers through the ceiling. The mount has a very secure latch on it when it is stored up and out of the way.

Up:

20140731_201921

And down:

20140731_201856

We haven’t done any electrical work for it yet, but eventually this will be the display for the Chartplotter/Autopilot project too. The Raspberry Pi will be stored up and out of the way in the open area above, with just the HDMI cable coming down and attaching to the tv. I also want to run an inverter powered 110v outlet for the TV to plug into as well.

But for now, the power cable can hang down and connect to the current inverter that is located to port, and the TV is perfectly usable.

The Journey's The Thing