Cruisers Forum

Join CruisersForum Today

Thread Tools Rate Thread Display Modes
Old 21-01-2014, 13:45   #1
Registered User
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 7,455
GPS Time for accurate Computer Time

GPS Time for Accurate Computer Time
(This seems to keep coming up.)

rgleason summary post in Feature Request thread

If there weren't ready made free solution that can happily coexist with OpenCPN and do it, maybe. But I don't see any real reason why not use GPS clock freeware or gpstime - Script that sets system time through a GPS. - Google Project Hosting depending on the platform...
Post #1543 We have it but too little time - Bdcat


I think this feature would be useful for several reasons.
1. Celestial Navigation Plugin - help with setting PC time.
2. Weatherfax Plugin - several weather fax programs use GPS time for timing the satellites. [accuracy is not as stringent]
4. Pavel has listed several free solutions, but it would be simpler if this could be done at some point....

Is it worth putting into Tracker -Feature requests? ..somewhere just above Low priority?
Post #1543 We have it but too little time - Bdcat

We have code in OCPN to do this. Very old cruft, untested in a long time.


#ifdef ocpnUPDATE_SYSTEM_TIME // Use the fix time to update the local system clock, only once per session if( ( sfixtime.Len() ) && s_bSetSystemTime && ( m_bTimeIsSet == false ) ) {
Too many ideas, too little time....
Jelbert Post in another thread
Yes I use an Olimex A20. It has no RTC and there is an external module posible. Now I use NTP for the time. There is also a way to use the GPS time. I found the sources for that already. What I have not yet figured out is if this will occupy the gps and if it can still be shared with OpenCPN.
The A20 including a 4 port usb serial converter and an old gps dongle uses 3.6W if it is very busy.
I did try to get SDR running on it with a gui but that became too slow or too unstable. So for now I ditched that idea.
Pavel's Response just below:

Jelbert... Have a look at Synchronizing ntpd to a Garmin GPS 18 LVC via gpsd - You can connect NTP to GPSd, so no problems with possible race conditions.
rgleason is offline   Reply With Quote
Old 09-03-2016, 10:27   #2
Registered User

Join Date: Jan 2016
Posts: 2
Re: GPS Time for accurate Computer Time

Since I use the RPI do record my tracks, and during longer trips, I tend to "improve" my setup, which leads to several restarts of the pi, the times of my track points are kind of messed up. All the solutions I found for the Pi use gpsd, which does not work for me (and since OpenCPN does not need it, I don't want to install it). Anyone knows a solution to set the system time to GPS time WITHOUT gpsd? If anyone could tell me how to activate the "builtin" function in the chart1.cpp, I would try to compile opencpn for myself (before turning off the "more than 2 hours difference"-check :-))

Thanks and BR
mischa.mole is offline   Reply With Quote
Old 09-03-2016, 15:03   #3
Marine Service Provider
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,464
Re: GPS Time for accurate Computer Time


in chart1.cpp, look for "ocpnUPDATE_SYSTEM_TIME".

Read the code, define the variable "ocpnUPDATE_SYSTEM_TIME", rebuild OCPN, fix sudoers file, and it might just work.

bdbcat is offline   Reply With Quote


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities

Copyright 2002-2015 Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 10:00.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2016, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.