Installing SignalK

It's annoying, but without a current date and time nothing works. The drawbacks of using HTTPS and packaging with all encryption included.

$ ntpdate <ntpserver>

Basically I use OpenPlotter to get SignalK working. This is not the only solution but it is one of the best documented. Also the scripts simplify the process by a large margin. Yes, I know I am lazy.

This is what I aim for:

The first requirement before installing SignalK is CanBoat. Canboat is available on GitHub, but OpenPlotter nicely adds some patches which makes the packaging easier. However since part of canboat is ported to canboatjs, the binary an be omitted.

Next requirement for SignalK is nodejs and npm. This has changed for Ubuntu20.04, the npm packages are no longer necessary.

	$ sudo apt-get install libcurl4-openssl-dev
	$ url -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
	$ echo "deb https://deb.nodesource.com/node_10.x focal main" > /etc/apt/sources.list.d/nodesource.list
	$ echo "deb-src https://deb.nodesource.com/node_10.x focal main" > /etc/apt/sources.list.d/nodesource.list
	$ sudo apt-get update
	$ sudo apt-get install nodejs python3-smbus

Note: some dependencies might cause you to use node_12.x instead of node_10.x. (Some dependency on python-minimal which can't be exchange for python3-minimal).

This should do for the pre-requirements for SignalK. Next is installing the OpenPlotter Settings package:

	$ wget https://github.com/openplotter/openplotter-settings/releases/download/v2.3.0-stable/openplotter-settings_2.3.0-stable_all.deb
	$ sudo dpkg -i openplotter-settings_2.3.0-stable_all.deb
	$ sudo apt --fix-broken install
	$ sudo add-apt-repository ppa:openplotter/openplotter
	$ openplotter-settings

Here you could tweak the settings a little. You can remove the /etc/apt/sources.list.d/openplotter-ubuntu-openplotter-focal.list and you can edit the /etc/apt/sources.list.d/openplotter.list to comment out the free-x line. free-x does not provide binaries for ARM64.

For the odroid C4 I recommend changing the OpenPlotter script a little. Change the file /usr/lib/python3/dist-packages/openplotterSettings/platform.py like below:

--- a/platform.py       2020-05-17 12:39:12.788881736 +0200
+++ b/platform.py       2020-05-17 12:38:52.719906523 +0200
@@ -20,5 +20,5 @@
 class Platform:
        def __init__(self):
-               self.isRPI = False
+               self.isRPI = True
                self.skPort = False
                self.skDir = False

And while you are at it add the line
ln -s /dev/i2c-0 /dev/i2c-1
to /etc/rc.local somewhere before the line
exit 0

For the odroid N2 you apply the same changes but the line for /etc/rc.local changes to

ln -s /dev/i2c-2 /dev/i2c-1

The openplotter-i2c and openplotter-pypilot are blocked for non-RPI computers. Second change makes the /dev/i2c-1 available, which is the standard I2C bus in the RPI4. With these changes the Odroid's work with the RPI OpenPlotter scripts.


And here you start OpenPlotter for the first time.

Select Add Sources, then Update Candidates and finally Refresh. Install at least the following packages:

Run the openplotter-i2c and openplotter-pypilot scripts first. Using this if you have an BMP280 on your I2C bus you can add a service to provide the data to SignalK on port 51000 (UDP).

You can use openplotter-pypilot if you have a MPU9250 IMU on I2C. Select the "Compass Only" function and add the IMU to OpenPlotter. This creates a service in openplotter-i2c for the IMU on port 20220 (UDP).

In the background Systemd should start openplotter-i2c-read and openplotter-pypilot-read. If you can't find the data in SignalK there might be a problem where OpenPlotter does not start this services correctly.

After problems I added all to the /etc/rc.local but later I got Systemd to start the OpenPlotter services correct (NB this is OpenPlotter on 3rd party hardware with a different OS).

#!/bin/bash

if [ -f /aafirstboot ]; then /aafirstboot start ; fi

I2CCPU=3
ln -s /dev/i2c-2 /dev/i2c-1
## taskset -c $I2CCPU slcand -o -c -s5 /dev/ttyACM0 canable0
## sleep 2 && ifconfig canable0 up
ip link set can0 up type can bitrate 250000
## sudo -u opencpn /usr/bin/openplotter-i2c-read &
## sudo -u opencpn taskset -c $I2CCPU /usr/local/bin/pypilot_boatimu -q &
## sudo -u opencpn taskset -c $I2CCPU /usr/bin/openplotter-pypilot-read &

exit 0

Now run openplotter-signalk-installer and install the SignalK server.

Startup Firefox and go to https://127.0.0.1:3000. Sometimes the server can not be found on 127.0.0.1 but on your local IPv4 address.

And finally restart the SignalK server and check if everything works.

The openplotter-SKfilter contains a link to SKdiagnostics which does the same as the Data Browser.

To get full functionality over SignalK you might want to install the SignalK to NMEA0183 and the SignalK to N2k apps.

CAN-bus & Serial

One might ask why I don't recommend the OpenPlotter utils for CAN-bus and serial ports.

The serial port application does essentially nothing. It can change names to something more recognizable. This is in my opinion eye-candy and of no practicle use.

The canbus utility enables you access to your canbus adapter with a lower bar than without. Use it if you think it is usefull. In the end there are 2 approaches, for a Canable Pro:

# slcand -o -c -s5 /dev/ttyACM0 canable0
# sleep 2 && ifconfig canable up
And for the same Canable Pro with CandleLight firmware:
iplink set can0 up type can bitrate 250000
As you can see, it is a connection comparable with a network. The startup will work even without OpenPlotter. Keep in mind that if you use unknown CAN-bus adapters a first try with openplotter-can might be easier.
Links SignalK: