The NTP Server uses a low cost ublox GPS as the time source and hopefully is a simple sketch to understand and modify for your needs. It should also be easy to modify to suit a wide variety of GPS chipsets as only the standard NMEA sentence GPRMC is used as the time source.
packetBuffer = 1 ; // stratum think that should be at least 4 or so as you do not use fractional seconds
And the gps needs to be outside for it to lock to the satellites.
Quote from: doughboy on Nov 08, 2013, 06:22 pm And the gps needs to be outside for it to lock to the satellites.GPS always gives accurate UTC time. RTCs will always drift.The ublox and MT3329 chipset GPS receivers are very sensitive and work very well inside a house.
you can get more accurate RTC chips.
thishttps://www.sparkfun.com/products/10160or half price on ebayhttp://www.ebay.com/itm/DeadOn-RTC-DS3234-Breakout-Real-Time-Clock-DS3234-/280892418658?pt=LH_DefaultDomain_0&hash=item41667e2a62 if accuracy is your concern, then syncing time every 8 hours is defeating the whole objective. A better solution perhaps is a combination gps + rtc. you can actually sync the rtc to gps once every 8 hours, and rtc to sync the arduino time every 5 minutes.
well, there's that, and there is the practicality side of a solution.time library does not sync itself, you must call the now() function for it to check if it is time to synchronize. plus like I said, it does not matter if your time source is accurate to 1 billionth of a second if arduino is only accurate to 62 billionth. plus gps is not as accurate as you think, in theory it may be, but not from practical point of view. There is latency for the signal to get from satellite to the gps (ntp introduces network latency as well) , not to mention you are using a serial connection, which itself introduces timing error. Anyone who has ever used a gps for navigation knows how much error there is on location data. Gps signal can disappear or be blocked, hence it is not 100% reliable as well. Just understand its limitations so as not to fall into a false sense of security you are synchronized with atomic clock in fort collins.the fastest sync is still via rtc. Connecting to ntp server on the internet adds a lag of several seconds (I've see it hang up to 10 seconds). That's why it is not practical to use it (and gps) as a main sync source. Hence you cannot sync to ntp or gps as often as you like. You will find all these out when you actually build your project.