-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leap seconds and inaccurate time report #125
Comments
As this is not a Tiny Gps issue, may I suggest you look at the following link which has options and discussions. In particular GMT vs UTC conversion. |
Thank you for your answer. It seems that the problem is difficult to solve. First, I looked in the TinyGPSPlus library for a flag informing that the given time is correct. It turned out that the isValid() function informing about the correct location does not tell about the correctness of the time. It happened many times that despite receiving the correct coordinates, the time was incorrect. It would be enough for me to know whether the seconds correction was included or not. But I don't think it can be determined. With the assumed method of using the clock (it is taken outside the house once a day and synchronized with GPS), it probably makes the most sense to check the time difference between the DS3231 and the GPS. If the difference is in the range from 2900 ms to 3100 ms, it means that the GPS time is not corrected. And if it is in the range from -100 ms to +100 ms, then the correction is included. Here is a snippet of data received from GPS. At the beginning of each line I have included timestamp from DS3231 (valid UTC time). The moment when the GPS time was corrected is visible: the seconds jump back by three. There is no information that this happened. So the problem is unsolvable with such receivers... 13:28:35,06/08/2023,$GPGLL,,,,,132838.00,V,N49 |
I've completed the first version of the GPS-synchronized clock using, among other things, the TinyGPSPlus library. |
Use a realtime OS for your project, like FreeRTOS. Segregate time critical tasks like refreshing the display and driving the serial interface in RTOS tasks. Use a state engine for control. Your issue seems not related to TinyGPS, since TinyGPS is just an NMEA payload parser - no more, no less. |
Hello,
I used this library in a GPS synchronized clock project. The assumption was to display the time with a resolution of 0.1 seconds and an error of no more than 50 milliseconds. The clock has its own DS3231 module which provides accurate time for at least 24 hours after synchronization. The clock is in a room where there is no GPS signal. Synchronization therefore requires moving the clock near a window and manually initiating synchronization. Of course, the synchronization procedure waits until a valid GPS signal is available and then sets up the DS3231 with millisecond accuracy (using the PPS output from the GPS module). But there is a problem: the time given by the GPS after turning on and catching a fix is often three seconds ahead. Exactly three seconds. After several minutes, the time is corrected to the correct value. This is due to leap seconds and delayed accounting for the correction as I read at gpsd.gitlab.io/gpsd/NMEA.html. Under the given assumptions (error not exceeding 50 ms), a deviation of 3000 ms is of course unacceptable. Is there any way to detect whether the reported time includes leap seconds correction or not? Currently, I just leave the clock by the window for 20 minutes and then start syncing.
Regards
Piotr
The text was updated successfully, but these errors were encountered: