Skip to content

Commit

Permalink
feature: add seatalk 1 support (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
joabakk authored Apr 28, 2020
1 parent 822b14c commit 28e3e17
Show file tree
Hide file tree
Showing 3 changed files with 368 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

<p align="center"><img src="./small-GUI-remote.png"></p>

`signalk-autopilot` is composed of 2 modules:
`signalk-autopilot` is composed of 2 modules:
- [A graphical interface that emulates a Raymarine remote control](./GUI-help.md "GUI help")
To be able to acknowledge pilot related alarms through the GUI you need to install the `signalk-alarm-silencer` plugin.
- A back-end API described below.

This current only supports Raymarine NMEA 2000 Autopilots, but I'll be adding support for other autopilots as needed.
This current only supports Raymarine NMEA 2000 and Raymarine Seatalk 1 Autopilots, but I'll be adding support for other autopilots as needed.

For Seatalk 1 Autopilots to work, a device that can translate Seatalk datagrams back and forth within an NMEA0183 sentence is required. They may be purchased from [Digital Yacht](https://digitalyachtamerica.com/product/st-nmea-usb/)) or [gadgetpool](http://www.gadgetpool.eu/nuke/modules.php?name=News&file=article&sid=28). Also, signalk-to-nmea0183 plugin with APB (for route control) and MWV (for wind steer) should be enabled

# API

Expand Down Expand Up @@ -70,7 +72,7 @@ PUT http://localhost:3000/signalk/v1/api/vessels/self/steering/autopilot/actions

## Tack to port or starboard

The `value` is `port` or `starboard`.
The `value` is `port` or `starboard`.

```
PUT http://localhost:3000/signalk/v1/api/vessels/self/steering/autopilot/actions/tack
Expand Down Expand Up @@ -100,5 +102,3 @@ PUT http://localhost:3000/signalk/v1/api/vessels/self/steering/autopilot/target/
"value": 1.52,
}
```


24 changes: 11 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const advance = "steering.autopilot.actions.advanceWaypoint"

const types = {
raymarineN2K: require('./raymarinen2k'),
raymarineST: undefined,
raymarineST: require('./raymarinest'),
nmea2000: undefined,
nmea0183: undefined
}
Expand All @@ -51,27 +51,27 @@ module.exports = function(app) {

autopilot = pilots[props.type]
autopilot.start(props)

app.registerPutHandler('vessels.self',
state_path,
autopilot.putState)

app.registerPutHandler('vessels.self',
target_heading_path,
autopilot.putTargetHeading)

app.registerPutHandler('vessels.self',
target_wind_path,
autopilot.putTargetWind)

app.registerPutHandler('vessels.self',
adjust_heading,
autopilot.putAdjustHeading)

app.registerPutHandler('vessels.self',
tack,
autopilot.putTack)

app.registerPutHandler('vessels.self',
advance,
autopilot.putAdvanceWaypoint)
Expand All @@ -84,7 +84,7 @@ module.exports = function(app) {
autopilot.stop()
}
}

plugin.id = "autopilot"
plugin.name = "Autopilot Control"
plugin.description = "Plugin that controls an autopilot"
Expand All @@ -99,16 +99,16 @@ module.exports = function(app) {
title: 'Autopilot Type',
enum: [
'raymarineN2K',
'raymarineST',
/*
'raymarineST',
'nmea2000',
'nmea0183'
*/
],
enumNames: [
'Raymarine NMEA2000',
'Raymarine Seatalk 1',
/*
'Raymarine Seatalk 1',
'Generic NMEA2000',
'NMEA 0183'
*/
Expand All @@ -126,8 +126,6 @@ module.exports = function(app) {

return config
}

return plugin;
}


Loading

0 comments on commit 28e3e17

Please sign in to comment.