Jörgen - I'd like to help with support for Garm...

I'd like to help with support for Garmin Reactor autopilot for the signalk-autopilot plugin. I was thinking about listening for messages when switching between auto and standby to start with, just do a raw log of nmea and translate it to json with analyzejs. But any tips on how to find the culprits in the log, except trying to note the exact time when pressing the buttons? Or any other ideas on how to go ahead with this reverese engineering?
12 Replies
AdrianP
AdrianP10mo ago
Check out the work in progress at https://github.com/SignalK/signalk-server/pull/1596
GitHub
feature: V2 Autopilot API by panaaj · Pull Request #1596 · SignalK/...
Version 2 Autopilot API: Goals: Implement an API (with OpenAPI definition) for performing common autopilot operations. Support commands being sent to specific autopilot devices (using the autopil...
Jörgen
JörgenOP10mo ago
Perfect, so what I understand I should create a plugin for Garmin Reactor. Is there an example of a minimal such plugin? However first I need to hack a poc together, to show that I can steer the Garmin, I cannot find that anyone has done that previously, maybe there are hard-to-overcome obstacles.
AdrianP
AdrianP10mo ago
I will put together a minimal plugin based on the PR of the signalk-autopilot plugin. We will also need to check the PGNs are decoded by canboatjs.
Jörgen
JörgenOP10mo ago
Perfect! I have been down in the boat and managed to get the right pgn and data needed to set the autopilot to auto and back to standby. It took a while since I am not used to the n2k protocol and this was all unknown paths. But I also managed to find the increase and decrease of the course steered, so basically I have the beginning in order to emulate the control head (GHC 20). So now I will try setup a development environment, since i could not send raw data from node-red.
David Godin
David Godin10mo ago
We have a few AP supported using V1 API. Mostly Raymarine. At some point when you have something solid I’d like to migrate those PNGs over to API v2. It would be nice to have a generic plugin approach where we can set device ID and AP model. If that’s something you are willing to do, I’d migrate the other stuff over.
AdrianP
AdrianP10mo ago
I have created an inital plugin template here https://github.com/panaaj/signalk-autopilot-provider-plugin-template which is a stripped down version of the signalk-autopilot PR to support the Autopilot API. This provides the basics to discover a device and define the PGNs to process. I have left some methods for sending N2K to the device as an example. You can use this temple with the code in the signalk-server v2_api_autopilot branch.
GitHub
GitHub - panaaj/signalk-autopilot-provider-plugin-template
Contribute to panaaj/signalk-autopilot-provider-plugin-template development by creating an account on GitHub.
Jörgen
JörgenOP9mo ago
Great job! I will check it out and try it when ready with my POC (just messing around with the current autopilot plugin). Right now trying to understand how I can live without the missing PGN's, but will probably be able to fix something. Have at least been able to turn the autopilot on and off - in theory - but needs to go in the boat to make a field test. @AdrianP FYI, I just released a first proof of concept based on the old api. https://github.com/jorgen-k/signalk-autopilot-garmin. I did not get the new API to work at all for some reason, I think the "old" plugin signalk-autopilot was not really updated. Anyways, I will of course update to V2 when possible.
AdrianP
AdrianP9mo ago
For the new API to work you'll need the server code from the PR. Not sure on how you've set up your dev environment, but it should be straight forward if you have cloned the server repo and checkout the v2_api_autopilot branch and then run npm run build:all.
Jörgen
JörgenOP9mo ago
Now i found it, there is a PR on the signalk-autopilot that is needed to commit to make it work. So I thinkj it should work. But i concentrate in the v1 for now, and will move the code for garmin to support v2, latest when the v2 is released. I can also see in the PR that the head (the gui) is not updated to use v2 api. Since I am doing a generic head that can work with garmin - and raymarine - i was a bit interested in those changes. But one question about the new api: what is the difference of state and mode? STate could be standby, active (auto), wind etc. But what is mode then? On off?
AdrianP
AdrianP9mo ago
State= on/off (i.e. engaged/disengaged, auto/standby) Mode= compass, wind, route, GPS, etc. I know that signalk-autopilot doesn't really reflect this but it is what the specification defines.
Jörgen
JörgenOP9mo ago
thanks, and spec is what is written in the pr discussion?
AdrianP
AdrianP9mo ago
Yes as well as the related links.
Want results from more Discord servers?
Add your server