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?

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