Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow vessel ID to be included in topic #47

Open
tkeffer opened this issue Aug 27, 2024 · 0 comments
Open

Allow vessel ID to be included in topic #47

tkeffer opened this issue Aug 27, 2024 · 0 comments

Comments

@tkeffer
Copy link

tkeffer commented Aug 27, 2024

continuing the discussion from Issue #46...

While the plugin allows the user to specify which SignalK paths are to be published, they are all published to topic signalk/delta. This pushes the responsibility for disambiguating vessel sources to the subscribing clients. They have to listen to everything, even vessels that they are not interested in.

Suggestion: publish to signalk/{vessel}/delta where {vessel} is the MMSI or UID of the SignalK server. Or, even better, publish to path-specific topics, such as signalk/{vessel}/delta/navigation.position. Then the client can target exactly what it needs.

@tkurki Suggests

One way to achieve by path and optional by source subscription would be NOT to map value paths to hierarchical MQTT topics but simply two levels: per the previous example: vessels/<id>/navigation.position/n2k-sample-data.160. This would allow subsciptions to

  1. all values for a path for a vessel, from any source with vessels/<id>/navigation.position/+
  2. all values for a path for any vessel, from any source with vessels/+/navigation.position/+
  3. all values from a source on a vessel: vessels/<id>/+/n2k-sample-data.160

but not allow hierarchical subscriptions, like all navigation values for vessel x.
We could also do a hybrid: first 2 value path levels as hierarchy, like vessels/<id>/batteries/1/capacity.remaining/sourceId. This would allow subscribing to all values for a device where the id is in the path, like a battery. Not very intuitive though.

Option 1 is the important one. Option 2 could happen when you're pretty confident only one vessel will be on the broker and don't want to be bothered looking up the <id>. Option 3 seems unlikely, or at least not a priority.

Sources are good at different things. A GPS sensor like the ZG100 will give you 2 m accuracy, but it sucks as a compass. So, it would be less of a priority for me to say, "Give me everything from the ZG100."

The notation navigation.position[n2k-sample-data.160] is the one suggested in the SK docs. I think it's clunky, but it does exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant