signalk-server icon indicating copy to clipboard operation
signalk-server copied to clipboard

Magnetic variation returns as zero even if there is GPS fix

Open mgrouch opened this issue 4 years ago • 3 comments

curl -s http://localhost:80/signalk/v1/api/vessels/self/navigation/magneticVariation/value

returns zero.

mgrouch avatar Apr 17 '21 08:04 mgrouch

It seems comes from gpsd

navigation.magneticVariation 0 rad 04/17 04:18:50 gpsd.GN (RMC) navigation.magneticVariation 0 rad 04/17 04:18:50 gpsd.GP (RMC) navigation.magneticVariationAgeOfService 1618647530 s 04/17 04:18:50 gpsd.GN (RMC) navigation.magneticVariationAgeOfService 1618647530 s 04/17 04:18:50 gpsd.GP (RMC)

mgrouch avatar Apr 17 '21 08:04 mgrouch

The issue is most probably with your input data. There is no special processing for this in the server.

Record some data and take a look with Data Fiddler.

tkurki avatar Apr 17 '21 15:04 tkurki

geographiclib has tools to calculate it properly based on time and location. No other inputs are required.

https://geographiclib.sourceforge.io/html/magnetic.html

mgrouch avatar Apr 19 '21 10:04 mgrouch

Closing as stale

tkurki avatar Feb 14 '24 17:02 tkurki