iltis42/XCVario

Synch crew-,empty- and ballast-weight with XCSoar

Closed this issue · 5 comments

hjr commented

The recently aligned setup of weights with XCS should be nicely synched in-between tactical soar computer and vario.
Please provide the NMEA protocol for this.

Here is my idea: We add a new XCSoar <-> XCVario element xw* for eXchange Weight with two different messages depending on the sending peer to avoid loops, one for XCSoar (xws), one for XCVario (xwv), and a float field to carry the weight and a nice xor NMEA state of the art checksum:

  1. XCSoar is sending a new crew weight with 90.5 kg
    !xws,90.5*
  2. XCVario is sending a new crew weight with 81.7 kg
    !xwv,81.5*

No cyclic sending of crew weight in !PXCV. The master if crew weight might be XCSoar, what should sent its current setting down to XCVario. Once connected, XCVario may change this setting by using above NMEA protocol.

hjr commented

Yes, that sounds basically right.
I would suggest a prefix order in the NMEA Id: xs (XCS sends); xv (XCV sends). Then the content Id. Are we limited to just four letters? Why not xsweight etc?

!xs prefix is already taken by internal datasync protocol, so new proposal, even more luxus, extra field for item and a clear sender id divided by comma, and integer for the weight with 1 kg granularity on protocol level (should do well, xcsoar even provides granularity of 5kg) and of course checksum protected:
!xcs,crew-weight,NNN*cs for xcsoar sending crew weight
!xcv,crew-weight,.. for xcvario sending creweight
and for the reference mass in kg
!xcs,ref-weight,NNN*cs
!xcv,ref-weight,..
and the empty mass
!xcs,empty-weight,NNN*cs
!xcv,empty-weight,..
and for the water ballast, instead of fraction of maxballast also a new message in kg (or liters)
!xcs,bal-water,NNN*cs
!xcv,bal-water,..

439983d
The three commands send as XCV:
I (00:06:51.093) Protocols.cpp: sendNMEACmd: !xcv,crew-weight,8348
I (00:09:28.920) Protocols.cpp: sendNMEACmd: !xcv,bal-water,25
5D
I (00:10:10.796) Protocols.cpp: sendNMEACmd: !xcv,ref-weight,284*0F

Parsing is in place as well for "!xvs,.." messages.
So next step is to pimp XCVario protocol in XCSoar and weight handling at that the above places.

The reference weight might only make sense when polar data is synchronized as well. This is not target in this step, so in this first step we may omit this field for synchronisation.