Thursday, 17 September 2020

Newtown River to Gosport

Hi everyone,

Yesterday morning we returned to Gosport, motor-sailing in light winds.  This was the last leg of our south-west coast cruise which lasted for 55 days.  More stats later, but first a description of our time at Newtown River.

Newtown River sunset

We spent 5 nights anchored at Newtown River.  We arrived at neap tides and had plenty of depth.  For our last two nights we moved about 30m to ensure we stayed afloat as the low tides got lower.  The river is very peaceful at night.  During the day many vessels come and go, making the anchorage quite busy.

Looking SE over the mud flats

Looking S towards the Solent

William the seal

Misty dawn

Feed me or I'll eat your dinghy

High tide exploring

The landing

Our passage back to Gosport was an 11nm motor-sail in light winds.  The track and graphs are below.  The graphs show the strength of the tidal currents in the Solent.

Zen Again track

Zen Again graphs

Reaching sheet on the new Yankee

During our 55 day cruise of the south-west we logged 457nm, ran the engine for 67 hours (about 1/3 of that charging batteries) and visited 21 locations.  We stayed in 2 marinas, on 1 pontoon, on 4 swinging moorings and anchored at 14 locations.  We particularly enjoyed anchoring at the top of rivers, surrounded by farm and woodland.

The only failures we had were the engine overheating at the Needles and the fridge breaking down.  The fridge has been running pretty much continuously for 5 years so no complaints there.  We spent the last two weeks fridge-less but it's a good cool box and we had plenty of UHT milk and canned food aboard.  The successes were the AutoProp propeller, the WindPilot vane gear, the new Yankee headsail and adding SignalK to our electronics system.

Here's our overall track for the 55 days...

Zen Again South-West Coastal Cruise Track

On arrival back in Gosport we gave the boat a good wash, filled our water tanks, exchanged a propane cylinder and filled our diesel jerry cans.  Zen Again's ready for more!

Trust all's well where you are!

Saturday, 12 September 2020

Poole to Newtown River

Hi everyone,

Following our passage from Weymouth to Studland Bay we spent two nights there.  Last Saturday we motored the short distance to Poole Harbour.  We spent most of the week there, did a short-stay in Poole Town Quay Marina to reprovision then yesterday sailed back to the Solent and into the Newtown River.

Poole Harbour is reputed to be the second largest natural harbour in the world, second only to Sydney Harbour.  However much of Poole Harbour is shallow.  We did a tour of the harbour before anchoring in in South Deep, south of Brownsea Island.

Here are our tracks in and near Poole Harbour...

Zen Again Tracks in Poole Harbour

Our initial tour of the harbour took us around the north side of Brownsea Island.  There are visitors moorings here but we didn't like the wash from the traffic.  So we motored around to the much quieter south side of Brownsea Island.  It's shallow but the channel is well marked.  We anchored in South Deep.  We liked it so much we stayed for five nights.

Entering Poole Harbour

Brownsea Island

Sunset in South Deep

Twilight in South Deep (looking East)

While Nicki worked from home Monday to Wednesday I worked on our boat electronics software.  See the preceding posts on SignalK.  We also did some chores including our laundry.  We love our Wonder Clean pressure washing machine.

Laundry day

South Deep Dawn

On Thursday we motored around to Poole Town Quay Marina for a short stay.  Before entering the marina we motored past the waterfront up to the first bridge and back.  A little like Annapolis's 'ego alley' except one side has the waterfront with many pubs and the other has the port and the Sunseeker yard.

Inspecting Poole Waterfront

Sunseeker Yard

In the marina it only took an hour to reprovision from the adjacent Tesco Metro, leaving us time for a sober pub lunch at The Jolly Sailor and a walk around the old town.  A lot of very old buildings and narrow side streets.  Then we motored back out to Studland Bay so as to allow departure for the Solent free of South Deep's tidal constraints.

The Jolly Sailor

Studland Bay Sunset

Yesterday we sailed from Studland Bay to the Newtown River in the Solent.  Winds have been very light recently and the afternoon offered the first decent breeze for several days.  We departed at 1100 in a light WSW breeze.  The breeze gradually built to 15 knots or so and we had a marvellous sail.

Here are the track and graphs...

Zen Again Track

Zen Again Graphs

Twas a downwind, 6 gybe passage.  Initially we had to work hard with boat speed less than 2 knots for a period.  Then the predicted wind came in and we got moving.  We had a nice view of the Needles as we approached Dolphin Bank and the Shingles.  From there we gybed NE toward North Channel.  It was fun sailing close along Hurst Beach with 2 knots of tide with us.

Departing Studland Bay

The Needles

In North Passage

Hurst Castle

Crossing the rip off Hurst Castle was fun.  We reached the approach to Newtown River rapidly with 1.5 knots of tide with us, and it was a neap tide.

In the Rip off Hirst Castle

Approaching Newtown River Mouth

The entrance to Newtown River is narrow but deep.  Inside it is quite shallow with varying depth.  It is quite well marked but care is necessary.  We found our Admiralty and Navionics charts good but our Garmin charts poor.  There are visitor's moorings and one or two were free.  We found a good spot to anchor.

Entering Newtown River

Newtown River Track

Newtown River Sunset

We had hoped to sail east to Brighton and Eastbourne this week but the light winds made that unattractive.  Maybe we'll do so in a week or two.  In the mean time we're enjoying Newtown Creek and may visit other parts of the Solent.

Trust all's well where you are!


Tuesday, 8 September 2020

NMEA-2000 Data on BeagleBone Black using SignalK

 Hi everyone,

This is a technical post.  It is the second of two posts describing how we installed and setup software to capture, record and display data from our NMEA-2000 network.  The first post described how we did so on a Macbook laptop running Mac OS X.  This post describes how we moved the NMEA-2000 capture and recording onto a cheap, low-power BeagleBone Black (BBB) computer.

24 hours at anchor in Poole Harbour
BeagleBone Black
(beaglebone.org photo)

The capture, recording and display of our NMEA-2000 data on a Macbook was a big step forward.  However it required the Macbook to be running.  This uses a lot of power.  We have two low-power BeagleBone computers aboard, one of which we use for SSBMinder to run a 24 hour schedule on our HF/SSB.  We decided to try SignalK and InfluxDB on the BBB. 

Here's how we did it, noting that we have an ActiSense NGT-1 NMEA-2000 to USB interface directly connected to the BBB.  If you follow in our footsteps you should replace 'ZenAgain' with your boat name, and our IP addresses to your own.  Needless to say, the BBB and Macbook are on an ethernet network and they have internet access during this installation process.

NOTE1: Commands were executed in a ssh session, in our case from our Macbook.  We connected as the default user 'debian' but used 'su' and 'sudo' for some commands.  This is shown below.

NOTE2: I'm NOT a Linux expert and made many mistakes along the way.  I believe what follows is correct but there may be errors.  Proceed with care and backup your BBB before starting!

NOTE3: An advantage of the BBB over the Raspberry Pi is it runs from 5.0V, not the weird 5.1V demanded of current Pis.  We use this power supply to provide 5V from ship's 12V power.

Making Room

The BBB has only 4GB internal storage.  Much of this is consumed by the Debian Linux distribution.  We're currently running 'bone-debian-9.9-iot-armhf-2019-08-03'.  We knew we'd need more space for the InfluxDB database so we added a micro SD card.  We've used 4GB and 32GB SD cards.
  1. Insert the SD card in the BBB
  2. Connect to BBB as 'debian'
  3. Run 'su'
  4. Run 'lsblk' to identify SDcard (usually /dev/mmcblk0p1)
  5. Run 'fdisk /dev/mmcblk0'
  6.   'd' to delete current partition
  7.   'p' to print the partition table
  8.   'n' to create new partition, then <enter> to take defaults
  9.   't' then '83' to set partition type to Linux (ext4)
  10.   'w' to write
  11. Run 'mkfs.ext4 /dev/mmcblk0p1' to create file system on the new partition
  12. Run 'lsblk' to check partitions (see first image below)
  13. Use nano to add a line to /etc/fstab: '/dev/mmcblk0p1 /media/sdcard auto auto,async,rw,nofail 0 0'
  14. Run 'reboot now'
  15. Reconnect to BBB as 'debian'
  16. Run 'lsblk' to check partitions (see second image below)
  17. Run 'sudo mkdir /media/sdcard/influxdb' to make a folder for InfluxDB databases
  18. Run 'sudo chown debian /media/sdcard/influxdb'
  19. Run 'sudo chgrp debian /media/sdcard/influxdb'
  20. Run 'df' to view space available
'lsblk' output before mounting

'lsblk' output after mounting

Disable Services

The BBB runs a number of services which clash with putting SignalK's web server on IP port 80 and/or compete for resources.  Here's what I disabled...
  1. Connect to BBB as 'debian'
  2. Run 'sudo systemctl disable cloud9.service'
  3. Run 'sudo systemctl disable gateone.service'
  4. Run 'sudo systemctl disable bonescript.service'
  5. Run 'sudo systemctl disable bonescript-autoscript.service'
  6. Run 'sudo systemctl disable bonescript.socket'

Install Dependencies

This was the toughest part.  NodeJS is required by SignalK and it took me a while to realise the BBB had the wrong version installed.  Likewise 'dns_sd.h' was reported missing.  Hopefully the following is correct.  If not Google is your friend, as it was mine!
  1. Connect to BBB as 'debian'
  2. Run 'sudo apt-get install libavahi-compat-libdnssd-dev'
  3. Run 'sudo curl -sL https://deb.nodesource.com/setup_10.x | bash -'
  4. Install specific version of NodeJS by running 'apt-get install nodejs=10.22.0-1nodesource1 -V'

SignalK Installation and Setup

  1. Connect to BBB as 'debian'
  2. Run 'sudo npm install -g --unsafe-perm signalk-server'
  3. Run 'sudo signalk-server-setup'
  4.    Enter your boat's name and MMSI, and set IP Port to 80

Initial Run and ActiSense Connection Setup

  1. Connect to BBB as 'debian'
  2. Run 'signalk-server' to start the SignalK server
  3. In a remote browser (ie Macbook), open 'http://192.168.1.21' to access the server
  4. On the 'Server => Connections' page click on 'Add'
  5.   Set ID to 'actisense'
  6.   Set NMEA 2000 Source to 'Actisense NGT-1 (canboatjs)', noting the 'js'
  7.   Set Serial Port to '/dev/serial/by-id/usb-Actisense_NGT-1_...', modifying the '...' to suit your BBB
  8.   Accept defaults for the other fields and click 'Apply'
  9. On the 'Dashboard' page check the Stats show ActiSense data being received.
  10. On the 'Data Browser' page select 'Self' and check for data, noting the use of SI units.
The SignalK server starts automatically on boot.

Here are some screenshots, noting that some aren't from the BBB...

SignalK New Connection

SignalK Dashboard

SignalK Server Settings

SignalK Server Connections

OpenCPN SignalK Connection

Use OpenCPN running on our Macbook to test availability of the SignalK data.  OpenCPN support for SignalK began with version 5.2.  Here's our OpenCPN connection setup...

OpenCPN SignalK Connection

ActiSense Connection not working?

I had trouble using the ActiSense NGT-1 with canboatjs prior to SignalK Server version 1.34.0.  The error was indicated on the Dashboard page.  This simplest fix was...
  1. Connect to BBB as 'debian'
  2. On the 'Server => Connections' page click on the 'actisense' connection
  3.   Change NMEA 2000 Source to 'Actisense NGT-1 (canboat)'
  4.   Set Serial Port to 'dev/ttyUSB0'
  5. Run 'sudo reboot now' to reboot
  6. In a remote browser (ie Macbook), open 'http://192.168.1.21' to access the server
  7. On the 'Dashboard' page check the Stats show ActiSense data being received.

If the above fails try installing canboat separately.  Here's how that's done...
  1. Connect to BBB as 'debian'
  2. Run 'sudo apt install xsltproc' since canboat needs xsltproc
  3. Run 'git clone https://github.com/canboat/canboat' to download canboat source
  4. Run 'cd canboat'
  5. Run 'make' to built the executables from the downloaded source
  6. Run 'sudo cp rel/linux-armv7l/* /usr/local/bin' to move the executables for use
  7. Run 'which actisense-serial' to check the executable we need is ready for use
  8. Run 'nano ~/.signalk/settings.json' and replace its contents with the text illustrated below, replacing '/dev/ttyUSB0' with the correct string for your NGT-1
  9. Run 'sudo reboot now' to reboot
  10. In a remote browser (ie Macbook), open 'http://192.168.1.21' to access the server
  11. On the 'Dashboard' page check the Stats show ActiSense data being received.
SignalK ~/.signalk/settings.json for canboat

InfluxDB Installation

  1. Connect to BBB as 'debian'
  2. Run 'sudo apt install influxdb' to install
  3. Run 'which influxd'  to check success

InfluxDB Database Creation

  1. Connect to BBB as 'debian'
  2. Run 'mkdir /media/sdcard/influxdb/meta'
  3. Run 'mkdir /media/sdcard/influxdb/data'
  4. Run 'mkdir /media/sdcard/influxdb/wal'
  5. Run 'sudo nano /etc/influxdb/influxdb.conf' and edit the three database pointers to suit the above locations.

InfluxDB Start

  1. Connect to BBB as 'debian'
  2. Run 'sudo systemctl unmask influxdb.service'
  3. Run 'sudo systemctl start influxdb'
The InfluxDB daemon will now start automatically on boot.

InfluxDB uses IP port 8086 to service client requests.  It doesn't provide a web page but browsing there is a handy way to see if InfluxDB is running.  Doing so produces a page with '404 page not found' text.


InfluxDB Setup

  1. Connect to BBB as 'debian'
  2. Run 'curl -X POST http://localhost:8086/query?q=CREATE+DATABASE+ZenAgain' to create influxdb database
  3. Run 'journalctl -u influxdb.service' to view the log

signalk-to-influxdb Installation

  1. In a remote browser (ie Mac), open 'http://192.168.1.21'
  2. Go to 'AppStore => Available' page, find the 'signalk-to-influxdb' entry and click on the download link on the right
  3. Go to 'AppStore => Installed' page and check 'signalk-to-influxdb' installed
  4. Connect to BBB as 'debian'
  5. Run 'sudo reboot now' to reboot
  6. Back in the remote browser wait (several minutes) for the Server page to refresh then go to 'Server => Plugin Config' page, and click on 'Influx DB'
  7. On the page, tick the 'Enable' checkbox, enter 'ZenAgain' as the Database, then click on 'Submit' at the bottom
Here are some screenshots...

SignalK Server Plugin Config

SignalK Server Plugin Config InfluxDB

The BBB is now setup with SignalK and InfluxDB running.  Lastly we need to tell our Mac (or other machine running Grafana) to read data from the BBB's InfluxDB.

Grafana Setup Modification on Macbook

  1. Open Grafana in browser at 'http://localhost:3001'
  2. In 'Configuration => Data Sources' click 'Add Data Source' then 'Influx DB'
  3.   Set Name to 'InfluxDB-BBB' and switch Default on
  4.   Set HTTP URL to 'http://192.168.1.21:8086' (don't leave it greyed-out)
  5.   Set Influx DB Details Database to 'ZenAgain'
  6.   Set Influx DB Details user/password to 'debian/password'
  7.   Click 'Save & Test' and confirm all 'green'
  8. Open your Dashboards and check data is flowing from the BBB's database
Here are some screenshots...

Grafana Add Data Source (top of page)

Grafana Add Data Source (bottom of page)

Grafana with 2 Data Sources

It's worth noting that the Grafana Dashboards setup on the Macbook used the default Data Source for all their data.  Adding the BBB Data Source and making it the default brought the Dashboards to life immediately.  Very nice.

Overall Usage

We've been running SignalK and InfluxDB on our BBB for 48 hours now.  No crashes and so far it has used only 2% of the 4GB SDcard.  Marvellous!


Backup

Here's how I backup the InfluxDB databases and the BBB generally...
  1. Connect to BBB as 'debian'
  2. Run 'sudo systemctl disable signalk.service'
  3. Run 'sudo systemctl disable signalk.socket'
  4. Run 'sudo systemctl stop signalk.service'
  5. Run 'sudo systemctl stop signalk.socket'
  6. Run 'sudo systemctl stop influxdb'
  7. Run 'sudo tar -cvf /media/sdcard/backup/<date>_bbb_influxdb.tar /media/sdcard/influxdb'
  8. In a Terminal window on the Macbook run 'scp debian@bbb:/media/sdcard/backup/<date>_bbb_influxdb.tar .'
  9. Back on the BBB, run 'sudo umount /media/sdcard'
  10. Remove the InfluxDB SD card from the BBB
  11. Insert a backup SD card into the BBB
  12. Run 'sudo /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh'
  13. When the BBB powers down on completion of the backup, remove the backup SD card
  14. Insert the InfluxDB SD card into the BBB
  15. Power up the BBB
  16. Connect to the BBB as 'debian'
  17. Run 'df' to check /media/sdcard connected
  18. Run 'sudo systemctl enable signalk.service'
  19. Run 'sudo systemctl enable signalk.socket'
  20. Run 'sudo systemctl start signalk.service'
  21. In a browser on the Macbook check the Signal K Server and Grafana are functioning normally

Upgrading SignalK

I had problems upgrading SignalK from within the browser.  Instead I did this...
  1. Stop SignalK as described above (steps 1..3)
  2. Run 'sudo npm install -g --unsafe-perm signalk-server'
  3. While updating SignalK perhaps do the same for Debian generally... 
  4.   'sudo apt-get update'
  5.   'sudo apt-get upgrade'
  6. Run 'sudo reboot now'

Next Steps

We'll continue to run reliability tests.  We may schedule daily reboots of the BBB 'just in case'.  Our second BBB is a BeagleBone Black Wireless.  We may use it to transmit SignalK data to our iPads and iPhones.  But that's a job for another day.