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

Advertisements

3 Responses to CubieTruck Chartplotter Setup

  1. I am very interested in your project
    how is the motor for the autopilot being driven?
    can you adjust cross track settings?
    Bill
    SV Rangatira

    • mattkabrown says:

      Hi Bill

      I have a hydraulic steering system, so all I have done is set up an arduino hooked up to a motor shield, which is in turn connected to the motor. If I send, via the motor shield, the current in one direction it moves the rudder one way, and if I reverse it, it moves the rudder the other way.

      I plan to the autopilot NMEA sentences from OpenCPN to drive the boat automagically, but right now it’s only at the stage where I have “move left” and “move right” buttons that send the signals.

  2. Pingback: The Big Bash 2015 | m/v C:[ESC]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: