la5nta / pat

A cross-platform Winlink client written in Go
https://getpat.io
MIT License
490 stars 86 forks source link

Position report - input from gpsd or SignalK #359

Closed olewsaa closed 2 years ago

olewsaa commented 2 years ago

It's a very simple matter to display the postion using a couple of Python lines. It would be nice to have the position filled in automatic when submitting a position report. I have a simplified version of this script which just display the position in decimal form ready to be entered into the report. In my case SignalK, but gpsd could also be an option. I'm unfamiliar with go so I have not ventured into the source code and tried to implement it myself.

xylo04 commented 2 years ago

Hello Ole! Good news, this is already possible! It's not configured out of the box to prevent unintentionally exposing position since the Pat API doesn't require authentication. Check out https://github.com/la5nta/pat/wiki/The-web-GUI#enabling-gps-insertion-tags-when-using-gpsd for how to enable it. Let us know how it goes!

olewsaa commented 2 years ago

As always, details are hidden on the documentation :) . However, I'm not in the position to have gpsd running, the position are collected by the AIS transceiver and the chart plotter (Raymarine) and fed into the OpenPlotter server which export a lot of things using SignalK. I get positions using request to the Openplotter SignalK process server. This works for OpenCPN and my pat config file update (position entry updated each time I start pat). For some of us adding SignalK as a position source would be nice. While not very high priority, I have script that prints out lat/long in decimal format for cut/paste into the position report. As postion change while I'm sailing along I have thought of ways to keep the position updated, but updating each time pat is started seems to be ok for now.
A setting like : "SignalK" and "addr": "10.10.10.1:3000" would be quite nice. It's just a simple line: «resp = requests.get('http://10.10.10.1:3000/signalk/v1/api/vessels/self/navigation/position/value', verify=False)»

Update :

After playing around I found that OpenPlotter's NMEA183 export can also emit GPS data. It's also possible to set up gpsd on the radio server (a separate RPi4) which will accept input GPS data via TCP. It now works using gpsd. On the radio RPi side only the gpsd config need editing. Some more info in the readme.

While I still think SignalK should be used, this is a simple solution using only available tools.

martinhpedersen commented 2 years ago

Glad you were able to find a solution 🙂

Although not strictly necessary, I agree that it would be nice to have support for more GNSS sources in the future 👍

xylo04 commented 2 years ago

Seconded, glad to hear you found a workaround, Ole. Let's keep https://github.com/la5nta/pat/issues/356 open for Signal K as an alternate GNSS provider. Closing this one as a duplicate.