Host your own microsecond-accurate Stratum 1 NTP (network time protocol) server using a $11 GPS receiver to keep all your devices synchronized reddit / selfhosted ---------------------------------------------------------------------- corruptboomerang · 2023-10-10 18:03 So as always this is great; but an important question is 'why'? ---------------------------------------------------------------------- vivekkhera · 2023-10-10 18:09 The correct answer here is “because” ---------------------------------------------------------------------- tgp1994 · 2023-10-10 18:12 I can see the argument for centralizing your time sync server rather than having every device rely on random computers on the Internet. ---------------------------------------------------------------------- psbankar · 2023-10-10 18:20 If you can change the sync server, you can set all of them to a same random computer. And I would always trust ntp servers from Google, Microsoft more than my self hosted ones. But again, its so cool to self host NTP so why not! ---------------------------------------------------------------------- Wolfgang-Warner · 2023-10-10 18:25 Why? Even on selfHosted there are limits. We can't afford our own atomic clocks, but we can stretch our budget to orbital, a step above cloud. ---------------------------------------------------------------------- NerdyNThick · 2023-10-10 18:33 I think the "why" is asking more of what benefit would this provide over the regular NTP to external facing time servers. The answer is, 98.7% of selfhosters have absolutely zero real need microsecond level time accuracy. The pricing idiom applies here. "If you have to ask, you can't afford it". If you don't already know why you need microsecond accurate time, then you don't need microsecond accurate time. Financial sectors (stock trading), and high end research/astronomy would definitely benefit from that level of precision and accuracy, but your self-hosted owncloud in a docker container has zero need for even millisecond time accuracy. That said, if I ever come across a cheap/free GPS receiver I can definitely see myself doing it just because I can :) Ultimately, that's the real reason why... "because I can". ---------------------------------------------------------------------- ElevenNotes · 2023-10-10 18:37 200G RDMA works better with micro second accuracy for PCF and DCP. ---------------------------------------------------------------------- woooolfi3 · 2023-10-10 18:37 imo selfhosting is mostly a "just because i can" kinda thing which, as a side effect, turns out to be useful - at least for me. but isn't what hobbies are about? ---------------------------------------------------------------------- NerdyNThick · 2023-10-10 18:41 For a lot of it, yeah. For another large part (for me at least) it's to retain control over my services, to be able to work through internet or service outages. A good chunk is to learn. Since I work in IT, learning about all the various options for hosting services internally is highly valuable. ---------------------------------------------------------------------- drakgremlin · 2023-10-10 18:42 `why not` is the better question in r/selfhosted . We do thing because we can. They further out understanding and system resilience (or not in some cases :-D ). ---------------------------------------------------------------------- EndlessHiway · 2023-10-10 18:50 you don't want to be late. ---------------------------------------------------------------------- jaskij · 2023-10-10 18:53 Yeah, but to sync it properly you really need PTP ---------------------------------------------------------------------- MzCWzL · 2023-10-10 18:56 Correct. From the blog post: "Why would you need time this accurate at home? You don’t. There aren’t many applications for this level of timekeeping in general, and even fewer at home. But this blog is called Austin’s Nerdy Things so here we are." ---------------------------------------------------------------------- corruptboomerang · 2023-10-10 18:57 But even if you use X, Y, Z, time server you don't need any more accuracy then you'd get from whatever server. ---------------------------------------------------------------------- AmaTxGuy · 2023-10-10 19:07 That's always the correct answer.. I put up a little dish to receive the goes s weather satellites. My daughter goes why you can get all that off the Internet. I said because I wanted to and I can. Lol ---------------------------------------------------------------------- panjadotme · 2023-10-10 19:13 I'm about to have the most accurate time on the block ---------------------------------------------------------------------- SillyLilBear · 2023-10-10 19:14 Because you can ---------------------------------------------------------------------- nikcou · 2023-10-10 19:21 Funny that, so am I ! ---------------------------------------------------------------------- dEnissay · 2023-10-10 19:40 Because you can! ---------------------------------------------------------------------- bobbyorlando · 2023-10-10 19:44 I'm not betting on my NTP against a Google dr. engineer in advanced time keeping, that's for sure. ---------------------------------------------------------------------- tgp1994 · 2023-10-10 19:52 I wasn't thinking accuracy so much as privacy and securiry. ---------------------------------------------------------------------- tyroswork · 2023-10-10 19:52 Obviously in case all the other NTP servers in the world somehow go down, while GPS satellites are still operational. Yours would be the only NTP server in the world, the coolness of that cannot be underestimated. ---------------------------------------------------------------------- MrDrMrs · 2023-10-10 19:56 I’ve done this with esp32, eth01, and some wonkyness with pi pico. Either way, great project and I love mine, additionally some ham radio modes require perfect time, so it’s been very useful. I then made a few clocks around the house that sync with my stratum1 for accurate, no need to adjust for daylight saving (can we please end that already?) Extra extra bonus, I then used my pps to generate a solid 10mhz reference for my (electronics) lab gear and ham radio transceivers. For those who don’t need gps perfect time (almost everyone), especially since NTP does take latency into account, just setting up a container (cturra/ntp) as the ntp server your local needs point to is more than adequate. Installed a better ntp time sync on windows (windows is notoriously bad with time) and rejoice in everything being time sync’d! ---------------------------------------------------------------------- MrDrMrs · 2023-10-10 20:04 Ntp privacy concerns huh? ---------------------------------------------------------------------- rumblpak · 2023-10-10 20:05 Now they need to combine that with precision time protocol to get sub- millisecond accuracy. ---------------------------------------------------------------------- lmamakos · 2023-10-10 20:38 Peel that label off the patch antenna; the edge of the patch is likely the high impedance part of the antenna and most affected by stray conductors or dielectric material. Maybe pick up a few more nanoseconds (or "precious PPMs"). ---------------------------------------------------------------------- lmamakos · 2023-10-10 20:42 Without well engineered Ethernet hardware, you're screwed. PTP requires specific support in the Ethernet NIC device, and ideally a way to synchronize the click in the NIC with the 1 PPS signal. The Pi isn't going to have that. And if it's an older Pi with the Ethernet connected by USB, well forget about your microsecond/nanosecond scale dreams 😀 ---------------------------------------------------------------------- tgp1994 · 2023-10-10 20:46 Sure, why not? It seems like everything's tracking us these days. NTP doesn't use any kind of E2E encryption that I know of. If someone is self hosting DNS, email and file sync, why not time sync as well? ---------------------------------------------------------------------- Brilliant_Sound_5565 · 2023-10-10 20:55 Think I'll just carry on using a time server lol ---------------------------------------------------------------------- bonelifer · 2023-10-10 20:56 Do you have a link with info on how to do that? ---------------------------------------------------------------------- Ergosyn · 2023-10-10 21:21 What’s that saying. A person with one ntp server knows the time. A person with ten ntp servers never knows the time. ---------------------------------------------------------------------- rumblpak · 2023-10-10 21:24 All fair points but even many commodity nics have hw timestamping now and nothing prevents anyone from reproducing this effort with a usb to serial dongle on something only mildly more powerful than a pi. ---------------------------------------------------------------------- MrDrMrs · 2023-10-10 21:27 Unfortunately not, I’ll see if I can find some sources I used for reference as I cobbled things together for my V1 of then project. I did use a fair amount of ChatGPT for help with the arduino and micropython code too. ---------------------------------------------------------------------- Pratkungen · 2023-10-10 21:51 I'm betting on a more precise protocol synced down to microseconds using GPS time which is basically the best we have available as it is based on atomic clocks over NTP from a server far away from me any day. ---------------------------------------------------------------------- Pratkungen · 2023-10-10 21:54 Currently there aren't many uses but there is a lot of stuff it does allow for. For example online gaming. Having extremely precise time allows the server much more precision for when something happened removing the guessing of what happened first and just count the actual time when it happened. Just like how it reduces load on servers by making it easier to know which one has the most up to date info and therefore the info that should be supplied to users. ---------------------------------------------------------------------- OkOk-Go · 2023-10-10 22:22 We call that person a timenut. A related type are the voltnuts, you’ll find them hanging out on the EEVblog forums. ---------------------------------------------------------------------- Akujinnoninjin · 2023-10-10 22:38 Seems like a good service to combine with [your tiny certificate authority](https://smallstep.com/blog/build-a-tiny-ca-with-raspberry- pi-yubikey/) Heck, I suppose you could throw the DHCP/DNS on there too - make the pi the ultimate authority on *Who*, *Where* and *When* everything is. ---------------------------------------------------------------------- mosaic_hops · 2023-10-10 22:42 If you don’t ever need to sustain internet outages or boot systems up on generator power but without internet connectivity then yes, you don’t need this. ---------------------------------------------------------------------- mosaic_hops · 2023-10-10 22:46 The USB spec has no provision for a PPS signal nor any way to do precision time synchronization. ---------------------------------------------------------------------- kevdogger · 2023-10-10 22:48 Hmm tiny certificate authority sounds cool..but also damn I can imagine that being a major source of frustration as well ---------------------------------------------------------------------- mosaic_hops · 2023-10-10 22:48 Many AliExpress/Amazon NEO modules are fakes. I’ve bought several for fun and they don’t even speak the uBlox protocol (hence appearing to be DOA). ---------------------------------------------------------------------- cd109876 · 2023-10-10 22:53 Well, the Pi 5 has PTP support in it's NIC. ---------------------------------------------------------------------- lmamakos · 2023-10-10 22:58 There is too much jitter over USB to get precise transfer of the 1-PPS event over, e.g., an emulated serial device's control signals. Or just about any other asynchronous endpoint on a USB device. ---------------------------------------------------------------------- MrDrMrs · 2023-10-10 23:14 In my experience they weren’t fakes but reclaimed chipsets from recycled devices. Isolate the chip and connect via uart and you’ll find that you can comm with the chip. Most project gps packages like this are 3rd party where the actually ublox chipset is genuine, I wouldn’t call that fake as that’s the business model for the product, but some are seriously shoddy. I have one where it was even re-labeled with a new label where the old labeled associated it with an oem device (GPS navigation). A now working neo-6 I have was same situation but poor flowing of the chipset and I had to reflow it. Fortunately it works now. Maybe there are fakes too, but I’d be more concerned with buying “new” and receiving a recycled (doa) unit. ---------------------------------------------------------------------- blind_guardian23 · 2023-10-10 23:15 because you have time. ---------------------------------------------------------------------- blind_guardian23 · 2023-10-10 23:19 thats like being a solider in a clone-army and hiding your face behind a veil ... for privacy reasons. ---------------------------------------------------------------------- ZeeroMX · 2023-10-10 23:29 That made me remember how Netware servers had a voting approach for timesync. I'm a formar CNE but can't remember what were the variables for the voting, I only remember how fun it was when time were not in Sync on the network. ---------------------------------------------------------------------- randobando129 · 2023-10-11 00:07 But can it handle ptp... ---------------------------------------------------------------------- stibbons · 2023-10-11 00:07 The reason my Pi now has a GPS-backed NTP service is that it was trying to do DNSSEC. Without a real-time clock it would try to start with wildly inaccurate time, and BIND didn't work. Yes, there are other ways to fix that, but they're nowhere near as much fun. ---------------------------------------------------------------------- crashj · 2023-10-11 00:35 Raspberry Pi supports PTP using the GPIO pins. There is a Linux kernel driver for it called nvpps. ---------------------------------------------------------------------- thicclunchghost · 2023-10-11 01:41 Legitimate answer: I've done this for a remote site that logs sensor data. It has very limited and unreliable power, but with this, log times will stay accurate after extended outages. Especially for small devices without a battery that can't keep their own time after a reboot. ---------------------------------------------------------------------- flecom · 2023-10-11 01:44 I trust my rubidium clock (na I wish I had one) Just have a Trimble GPS that gives 10MHz to all my gear and NTP to the house ---------------------------------------------------------------------- huslage · 2023-10-11 01:44 I’m looking for nanosecond precision. Milliseconds are way too long. ---------------------------------------------------------------------- corruptboomerang · 2023-10-11 01:48 See, this is a good answer. ​ In a HomeLab context less useful, but I can imagine situations like an infrequently used network in a rural area etc. But this is getting pretty far out of the scope of a typical environment. ---------------------------------------------------------------------- keidian · 2023-10-11 02:07 Go back to your room, you are disturbing the rest of us that are still trying to block Netware from our minds :P ---------------------------------------------------------------------- MzCWzL · 2023-10-11 02:10 Lucky for you there is an SI prefix right in the middle of milli and nano ---------------------------------------------------------------------- Jack_12221 · 2023-10-11 02:30 This is completely random but I used your article literally 30 minutes before I saw this post. What are the chances! Anyway thanks for the writeup. ---------------------------------------------------------------------- MzCWzL · 2023-10-11 02:53 What a coincidence! Yes that’s correct! How’s it working? ---------------------------------------------------------------------- Triks1 · 2023-10-11 02:55 This seems like a fun little project. ---------------------------------------------------------------------- JesusWantsYouToKnow · 2023-10-11 03:57 Man, I was so disappointed in Dave's decision to discuss his antivax views. I used to love eevblog content, now I have no desire to give him the clicks. AvE too, ugh. ---------------------------------------------------------------------- OneLeggedLightning · 2023-10-11 04:12 Or rather because you don’t ---------------------------------------------------------------------- cd85233 · 2023-10-11 04:47 Is he the host of the YouTube channel? If so I hate you for sharing this news. ---------------------------------------------------------------------- JesusWantsYouToKnow · 2023-10-11 04:58 Yeah, he and a couple of the niche engineering content creators shot themselves in the foot by opting to voice their politics on their channels. [It was a couple of years ago. ](https://www.reddit.com/r/ave/comments /sez9mu/so_am_i_shutting_this_subreddit_down_for_a_while/hvjxx5t/) ---------------------------------------------------------------------- kmisterk · 2023-10-11 04:58 Thank you for your share! For future reference, we ask that you create a text post with the link to the blog in the body of the text, and a few sentences on why it's relevant to the community. We look forward to future content. Cheers, /r/selfhosted ---------------------------------------------------------------------- cd85233 · 2023-10-11 05:22 I guess that's their right to the first amendment... But damn. ---------------------------------------------------------------------- JesusWantsYouToKnow · 2023-10-11 05:36 Absolutely they run the channels they want to; I was just there for fascinating engineering content and not room temperature political takes. C'est la vie. ---------------------------------------------------------------------- cd85233 · 2023-10-11 05:42 I just hope my 3d printer channels don't do anything like this. ---------------------------------------------------------------------- pm_something_u_love · 2023-10-11 05:58 Oh no. I'm a bit sick of AvE tbh, but sad to find out that Dave is an antivaxer. ---------------------------------------------------------------------- munchee · 2023-10-11 06:29 http://leapsecond.com/pages/atomic-bill/ ---------------------------------------------------------------------- feedmytv · 2023-10-11 07:08 no point in installing a dockerized ntp server when the os comes with a ntp client ---------------------------------------------------------------------- feedmytv · 2023-10-11 07:10 no ---------------------------------------------------------------------- reercalium2 · 2023-10-11 07:22 It's really stratum 3, you receive time from satellites who receive it from the US navy ---------------------------------------------------------------------- fprof · 2023-10-11 07:26 Intel I210 has a pin that can be used for PPS input. ---------------------------------------------------------------------- sexyshingle · 2023-10-11 08:08 I've been meaning to do this for years now... I have GPS module somewhere in my box of electrical thingies. Thanks for the reminder! ---------------------------------------------------------------------- IAmMarwood · 2023-10-11 08:09 My personal "just because" itch I keep meaning to scratch is to build a proper weather station with all the bells and whistles. I got as far as Raspberry Pi with sensors for temperature, humidity, light and rain and some TERRIBLE code stringing it all together. Oh and it was running BirdNET because why the hell not for something that's going to live outside. ---------------------------------------------------------------------- TackOverflow · 2023-10-11 08:32 A timelord ---------------------------------------------------------------------- maximus459 · 2023-10-11 08:41 About time ---------------------------------------------------------------------- kweevuss · 2023-10-11 11:39 I have two pi’s doing this and participating on ntppool.org! ---------------------------------------------------------------------- spicybright · 2023-10-11 11:52 Explain the risks? ---------------------------------------------------------------------- mega_corvega · 2023-10-11 12:11 But most game servers tick at like 64hz max. Thats multiple orders of magnitude slower than what’s described here. Also, don’t game servers sync clients server side? I highly doubt they’ll utilize client ntp for any sort of time syncing. That can be overridden. ---------------------------------------------------------------------- MzCWzL · 2023-10-11 12:11 “The basic definition of a stratum-1 time server is that it be directly linked (not over a network path) to a reliable source of UTC time such as GPS, WWV, or CDMA transmissions.” https://endruntechnologies.com/products/ntp-time-servers/stratum1 ---------------------------------------------------------------------- Pratkungen · 2023-10-11 12:18 Yes but they could do subtick updates and therefore be able to have precise times for all events and remove the thing of who shot first. ---------------------------------------------------------------------- spacelama · 2023-10-11 12:21 Oh wow, that for some reason doesn't surprise me. It's his accent. I presume he's from Queensland? ---------------------------------------------------------------------- qriff · 2023-10-11 12:49 https://dotat.at/@/2023-05-26-whence-time.html ---------------------------------------------------------------------- Brent_the_constraint · 2023-10-11 13:01 I have a concern: GPS is, as far as I know controlled by US military and has had intentional deviations in the past. Would that result in havoc if this should happen? ---------------------------------------------------------------------- PiotrekDG · 2023-10-11 13:24 I can see a use of this. If your Pi is its own DNS server with unbound and Pi-hole, and it goes offline for a longer time, it can no longer resolve DNS requests due to being out of sync too much and NTP cannot sync because DNS is not working... ---------------------------------------------------------------------- tgp1994 · 2023-10-11 13:27 https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=NTP In the grand scheme, it's hardly the worst thing to be worried about. But as our motto seems to go, "why not host it?" ---------------------------------------------------------------------- virtuallynathan · 2023-10-11 13:29 I built a fancier version of this using the ZED-F9T and an Intel i226 NIC with 1PPS input, and ran Timebeat as my clock sync software. I was able to maintain within 20ns of GPS time. I setup PTP across my network and shared the time to a couple other machines for “fun”. ---------------------------------------------------------------------- Jack_12221 · 2023-10-11 13:49 Great! ---------------------------------------------------------------------- prone-to-drift · 2023-10-11 14:01 I get why you have this rule, but this post follows it in spirit with a succinct and to-the-point title. I hope this rule would be applied manually via mods, and with case by case judgement. ---------------------------------------------------------------------- reercalium2 · 2023-10-11 14:10 NTP stratum 1 isn't really stratum 1. ---------------------------------------------------------------------- OkOk-Go · 2023-10-11 14:10 Yeah me too… wouldn’t have expected that from him. ---------------------------------------------------------------------- neuromonkey · 2023-10-11 14:21 [Cloud Cuckoo Land](https://www.goodreads.com/book/show/56783258-cloud-cuckoo-land), by Anthony Doerr. ---------------------------------------------------------------------- Duncaen · 2023-10-11 14:36 Those games should use monotonic clock, not the wall time of the system they run on. ---------------------------------------------------------------------- jimmyhoke · 2023-10-11 16:10 And if you use PiHole you get Adblocking too. Oh and a VPN so you can access this anywhere. ---------------------------------------------------------------------- MzCWzL · 2023-10-11 16:54 Oooo now this is something I’m interested in. For both survey/drone mapping/orthomosaic/GCP of my house and then stick it somewhere as both a ground station and source for timing. Was there a guide you followed? Are the i226 NICs in one of those 4x NIC router boxes (CWWK and similar) constantly being discussed on STH? ---------------------------------------------------------------------- MzCWzL · 2023-10-11 16:55 There would likely be far greater issues than you losing NTP. That said, I don’t know off the top of my head for this module, but most can utilize signals from the other GPS constellations not run by US military ---------------------------------------------------------------------- xia03 · 2023-10-11 16:57 he is weeding out wannabe engineers that are unable to consider an opposing viewpoint without throwing a hissy fit. that’s just not a compatible mindset for the engineering filed. ---------------------------------------------------------------------- strawberrymaker · 2023-10-11 17:23 Most (modern) GPS receivers (or better "GNSS") receive the signals from nor only navstar gps (USA) but also Galileo (EU) and Glonass (RU). Probably depends on the algorithm used in the receiver, but definitely likely that it will rather use other systems. You can also set it to completely ignore the other systems via UART commands. However, these "intentional" deviations in navstar GPS were made because the "enemy's" didn't had their own GNSS systems up. Around 1990-2000 they stopped doing it, as Russia had their Glonass system running in ~1995. So at least they wouldn't have any reason to do so except to move your Google maps position a few meters. ---------------------------------------------------------------------- strawberrymaker · 2023-10-11 17:28 Then you'll look at ~100$ ublox receivers with TXCO for less jitter and a good sight at the sky with your antenna. Add a phase locked loop with an OCXO and then you're good to go! Less than 1ns jitter. For only 400$ ---------------------------------------------------------------------- Brent_the_constraint · 2023-10-11 17:36 Wow. Great insight… thanks man ---------------------------------------------------------------------- MachDiamonds · 2023-10-11 17:37 The atomic frequency standards on the GPS satellites are stratum 0. ---------------------------------------------------------------------- kmisterk · 2023-10-11 18:28 I agree, the title is very elaborate and explanatory. But the point of the rule is to keep content at-a-glance relevant across the board. Can't enforce a rule that only ever *sometimes* get's acted on, no? One post get's allowed because of a well-phrased, descriptive title, and then every other person who's post gets removed due to this rule points to this one "But he broke the rule!," and then I have to explain why theirs were removed versus the one they point out? It's easier to just apply the rule as a blanket. ---------------------------------------------------------------------- panjadotme · 2023-10-12 01:55 Technically, yes! ---------------------------------------------------------------------- ItalyPaleAle · 2023-10-12 01:56 The only thing to keep in mind when you roll your own CA is that you absolutely must make sure your private key is never leaked, and in the case of ACME (custom Let’s Encrypt), that the server is never compromised. Any CA can issue certificates for any domain. if your laptop trusts given CA, it will trust any certificate issued by that. This means that if someone were to steal your private key, they could issue any certificate they want and make your laptop believe they are valid. Pair that with DNS poisoning or a MITM and they can intercept any internet traffic. ---------------------------------------------------------------------- lmux · 2023-10-12 09:34 My high school computer lab was using netware! So much fun! ---------------------------------------------------------------------- lmux · 2023-10-12 09:40 Considering you are getting time every second, and with occasionally signal distortion, it is pretty lous strat 1. Won't cellular be a better option? ---------------------------------------------------------------------- MzCWzL · 2023-10-12 13:12 It is not a lousy stratum 1. That’s your statement without any evidence. Just checked - raspberry pi is synchronized to the GPS signal within 0.2 microseconds (221 nanoseconds). Now you post your proof that I get “signal distortion” and that cellular would be a better option (keep in mind total cost for this stratum source is less than $20). user@raspberrypi:~ $ chronyc sources MS Name/IP address Stratum Poll Reach LastRx Last sample ====================================================================== ========= #? NMEA 0 3 0 38h +111ms[ +58ms] +/- 53ms #* PPS 0 4 377 16 +157ns[ +221ns] +/- 312ns ---------------------------------------------------------------------- Datsun67 · 2023-10-12 16:20 I have faith in Thomas, Zach, and Stefan. Don’t really watch any others for printing. I fell off AvE during the vax / trucker shit. Really enjoyed his stuff, but don’t want to help monetize bad takes. ---------------------------------------------------------------------- cd85233 · 2023-10-12 17:37 Man I was just thinking last night, I hope I don't hear about hackaday having these same things happen. My day would be so boring.