Portable GPS Time Server Powered By The ESP8266

Most Hackaday readers will be familiar with the idea of a network time server; a magical box nestled away in some distant data center that runs the Network Time Protocol (NTP) and allows us to conveniently synchronize the clocks in our computers and gadgets. Particularly eager clock watchers can actually rig up their own NTP server for their personal use, and if you’re a true time aficionado like [Cristiano Monteiro], you might be interested in the portable GPS-controlled time server he recently put together.

The heart of the build is a NEO-6M GPS module which features a dedicated pulse per second (PPS) pin. The ESP8266 combines the timestamp from the GPS messages and the PPS signal to synchronize itself with the atomic clock aboard the orbiting satellite. To prevent the system from drifting too far out of sync when it doesn’t have a lock on the GPS signal, [Cristiano] is using a DS3231 I2C real-time clock module that features a high accuracy temperature-compensated crystal oscillator (TCXO).

These components, along with the open source code provided in the project’s GitHub repository, gives you an extremely accurate Stratum 1 NTP server that can respond to client requests over WiFi. But to take the idea a step further, [Cristiano] added an OLED and some LEDs to provide feedback, and put the whole thing inside a handsome enclosure along with a 18650 cell, TP4056 charging module, and DC-DC buck converter. The result is a fully wireless time server that can be deployed anywhere, which as an amateur radio operator, he plans to use in the field.

Whether you take yours on the road or permanently mount it, this project is an excellent way to get more acquainted with NTP and GPS reception. It’s a great time (no pun intended) to start experimenting with this technology too, as there have been some grumblings that terrestrial radio time signals may go dark in the near future.

31 thoughts on “Portable GPS Time Server Powered By The ESP8266

  1. I can see advantages of the device (lightweight, portable, probably quite cheap). On the other hand using WiFi for NTP link can give up noticeable part of precision the device aims to provide.

      1. Not only the latency but also its jitter. And while the jitter can be averaged over time, statistical properties of such value (e.g. standard deviation) are worse and can change over time due to radio channel occupation in the neighbourhood.

        1. And I wouldn’t be surprised if the delay is at least slightly asymmetric, at least if communicating from WIFI to a wired device connected to access point. The roles of the access point and the mobile station are quite different in when they can or cannot transmit.

    1. @steelman said: “I can see advantages of the device (lightweight, portable, probably quite cheap). On the other hand using WiFi for NTP link can give up noticeable part of precision the device aims to provide.”

      NTP was designed from the beginning to handle symmetric latency well, and it’s a low bandwidth protocol. In my experience NTP over WiFi is no problem for light to medium loads, you’re not giving anything up versus using wired connectivity. If you are serving a high-density NTP (or anything for that matter), avoid wireless networking entirely and stick to wired or fiber. Where NTP traditionally has (or had?) problems is with asymmetric latency (more delay in one direction than the other).

      I suggest you read the book on NTP by its creator Dr. David L. Mills (ret.) at the University of Delaware.[1][2] The physical book is quite expensive to buy (even used), but there are much cheaper Knndle E-Book options available.

      * References:

      1. Computer Network Time Synchronization: The Network Time Protocol on Earth and in Space, Second Edition, by David L. Mills, $158.99 New Hardcover

      https://www.amazon.com/Computer-Network-Time-Synchronization-Protocol/dp/1439814635

      Publisher: CRC Press; 2nd edition (November 15, 2010)
      Language: English
      Hardcover: 494 pages
      ISBN-10: 1439814635
      ISBN-13: 978-1439814635
      Item Weight: 1.8 pounds
      Dimensions: 6.1 x 1.2 x 9.1 inches

      2. 1. Computer Network Time Synchronization: The Network Time Protocol on Earth and in Space, Second Edition, by David L. Mills, Kindle $47.16 Buy, $17.44 30-Day Rent

      https://www.amazon.com/Computer-Network-Time-Synchronization-Protocol-ebook-dp-B008KZU4AI/dp/B008KZU4AI

    1. I don’t know exactly but there are three problems (this device shares one of them). 1) NTP server binds to UDP port 123. Smartphone OS may not allow opening ports <1024. 2) Dedicated device may provide better precission. 3) Using WiFi introduces degrades some of that precision.

    2. Yes, a smart phone has all the required hardware to do what the article is about:
      ” an excellent way to get more acquainted with NTP and GPS ”

      And taking the smartphone route will learn how much information you have about the device that you own.

      Most likely you will base your work on the work of the people that build smartphone firmware.

        1. I don’t think that’s the point. The apps have a nice display and the ability to share the time to devices without RTCs. There’s no reason to mess with the the phones internal clock which could cause bad things. Local NTP is great for internet down or lack of internet. Think Ameteur radio for instance. We use digital communication that require accurate time.

        1. They are suggesting that there are NTP daemons on the Google Play store (there are), not that there are NTP clients on the Play store.

          There are also NTP clients in the play store too, but I imagine they do not actually change your system clock for the reasons you mention.

  2. So one gotcha I ran into building a Linux box + gpsd ntp server is that the crappy USB gps I had available ended up reporting time as very precisely one second behind. Easy to offset, but do always check your work against some trustworthy ntp sources before you ship your box off to a field somewhere.

  3. If you have a gps or radio based ntp server in the data center one of the problems you can run into is nearby noise from the racks. Typically datacenters sometimes offer a service to mount an antenna on the roof etc.
    That being said this is good for home use.

    1. Every year, I have to have somebody at my datacenters clear hornet’s nests out of my GPS antennas. Otherwise, my Symmetricon-based NTP servers become quite useless.

  4. Props for the integration work and packaging. Well done. The main reason for accurate time for amateur radio is FT8 and other digital modes. A cheap USB GPS does the job. For owners of the IC 705, it is built in. For general logging contest groups have allowed for the piss poor PC clocks for years.

  5. Wow, the link here on HaD to [Cristiano Monteiro’s] page: “An IoT Maker Tale: Stratum-1 Time Server Built From Scratch” is on Linkedin, and I can see it! That’s the first Linkedin content I’ve ever seen that didn’t require me to create a Linkedin account and log in first (I’m not going todo that). Am I the only person that has this perpetual problem with Linkedin?

Leave a Reply to JimCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.