Integrate with SignalK
Now the BoatIO HAT for the Raspberry Pi can be integrated into SignalK systems! Follow the instructions below or head over to www.signalk.org

SignalK
What is SignalK - www.signalk.org
Signal K is a modern and open data format for marine use. Built on standard web technologies including JSON, WebSockets and HTTP, Signal K provides a method for sharing information in a way that is friendly to WiFi, cellphones, tablets and the Internet. A format available to everyone, where anyone can contribute, Signal K is the first truly open data format for the marine industry and is set to revolutionize how we consume and interact with data on boats.
The picture to the right is data taken from the four analog inputs and eight digital inputs on the BoatIO HAT
Follow the instructions below to allow data from the BoatIO HAT to be used and displayed in SignalK

Integrate BOAT IO into SignalK - Instructions

Create a directory to save the files
1. Create a folder off your home page using the commands
cd /home/pi then mkdir BoatIO
2. Change to the new directory with the command
cd /home/pi/BoatIO or cd ~/BoatIO
3. Click on the link below to download the plugin files which are in a tar file
Note : The assumption is that the user is logged on as "pi" and the BoatIO driver is in a folder off of "pi's" home folder. This can be moved to a different location - just remember to change the folder name in the following steps
Install the downloaded files
1. Once in the new folder move the downloaded tar file boatio.gz to the new folder using the command
mv ../Download/boatio.gz
2. Untar the file boatio.gz to the folder using the command
tar -zxvf boatio.gz
3. Use the ls command to check the files required are un-compressed
4. There should be the following files:
-
boatio_udp.py - python code that runs in the background
-
package.json - SignalK package file
-
index.js - SignalK js plugin source
-
boatio.servce - system service file


Start a service
To start the BoatIO plugin as a service so that it runs in the background
1. Copy the boatio.service file to /lib/systemd/system
cp boatio.service /lib/systemd/system
2. Change the permissions on the file with the command
sudo chmod 644 /lib/systemd/system/boatio.service
3. Reload the systemd daemon with the command
sudo systemctl daemon-reload
4. Now we can enable the service to start on boot with the command
sudo systemctl enable boatio.service
5. Lets go ahead and start the service with the command
sudo systemctl start boatio.service
6. We can check the status with
sudo systemctl status boatio.service
Note: If you change the installation folder from what is shown here, you will need to edit the boatio.service file and change the ExecStart line
Link the plugin to SignalK
1. From the BoatIO folder created earlier, run the command
sudo npm link
2. Now change to the signalk folder. This is usual off the pi home director, use the command
cd ~/.signalk or just cd ../.signalk
3. To link to the plugin into SignalK, run the command
sudo npm link boatio-plugin


Check SignalK has the plugin
1. Open SignalK and navigate to the Server->Plugin Config section - refer to the picture to the right
2. Check that that BoatIO plugin is listed
Configure the BoatIO plugin
1. Now that the plugin is installed and linked to SignalK its time to configure the way each of the Analog and Digital inputs are recognized in SignalK
2. Click on the Active check box to start using the values from BoatIO
3. The default driver folder should be left as is
4. The update rate is how often in seconds you want BoatIO to update SignalK server
5. The remaining settings are specific to how you are using the analog and digital inputs. It is assumed that you know enough about SignalK paths and define meaningful paths for each input. The defaults may help you with examples of common uses.


Final SignalK step - Enable a UDP Connection
1. Navigate to the Server->Connections section
2. Click the ADD button and then follow the settings as shown in the picture to the right
Input Type: SignalK
Enabled: Yes
Logging: Can be Yes or No
ID: enter boatio_udp
Signal Source: UDP
Port: 51000
At this point data from the BoatIO plugin will be reaching the SignalK server and can be viewed in the Data Browser section