This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there command line utility for scripting to show current GPS location?
#1
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
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#2
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.
Reply
#3
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
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#4
(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/
________________________________________

Blog; https://pysselilivet.blogspot.com/
Reply
#5
(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.
Reply
#6
(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'
Download BBN Marine OS for raspberry pi 

https://bareboat-necessities.github.io/m...at-os.html

Video of actual installation:

https://www.youtube.com/watch?v=3zMjUs2X3qU


Reply
#7
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)