OpenMarine

Full Version: Is there command line utility for scripting to show current GPS location?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there command line utility for scripting to show current GPS location in openplotter?

I'd like to investigate how I can script automatic weather fax receiving and decoding
with a script.

Something that can attempt gpsd and other openplotter NMEA services?

Or can openplotter just store location in some file?
Does it sync computer time with GPS time?
If it does can it in same piece of code store location and its timestamp?


Thanks,
--MG
signalK is probable the best way to accessing gps and other data..
You should do some reading on nmea sentences gps theory.
most of your questions can be found in the old documents. several app exists to receive and process weather data.
Does it store current position in memory which I can query?
I don't thing so.
Querying GPS position should be just as easy as querying CPU temperature
Just cat some file on /dev or /sys filesystem. What is is fundamentally different?

I think openplotter should provide that functionality. It just needs timestamp of the fix too (to know it is expired or not).

Thanks,
--MG
(2020-01-25, 03:53 AM)mgrouch Wrote: [ -> ]Does it store current position in memory which I can query?...........

There are several ways ....

One could be picking NMEA, RMC with

nc localhost 10110 | grep -i RMC

another could be using curl and the URL

http://Your_Host:3000/signalk/v1/api/ves.../position/
(2020-01-25, 03:53 AM)mgrouch Wrote: [ -> ]Does it store current position in memory which I can query?
I don't thing so.
Querying GPS position should be just as easy as querying CPU temperature
Just cat some file on /dev or /sys filesystem. What is is fundamentally different?

I think openplotter should provide that functionality. It just needs timestamp of the fix too (to know it is expired or not).

Thanks,
--MG

What is it you want to do with the GPS data? It will be broadcast as NMEA0183 & signalk data as each message comes in, timestamp included.
(2020-01-25, 11:02 AM)MatsA Wrote: [ -> ]
(2020-01-25, 03:53 AM)mgrouch Wrote: [ -> ]Does it store current position in memory which I can query?...........

There are several ways ....

One could be picking NMEA, RMC with

nc localhost 10110 | grep -i RMC

another could be using curl and the URL

http://Your_Host:3000/signalk/v1/api/ves.../position/

Thanks! It worked with URL query.


Code:
curl -s http://localhost:3000/signalk/v1/api/vessels/self/navigation/position/ | jq -M -jr '.value.latitude," ",.value.longitude'
You could also possibly invoke cgps if you are using gpsd.

Also consider the weatherfax plugin for opencpn. It already can automatically schedule and decode transmissions. If nothing else you might use schedules xml for your own script