{"id":1781,"date":"2014-03-09T16:08:17","date_gmt":"2014-03-09T23:08:17","guid":{"rendered":"https:\/\/digitalnigel.com\/wordpress\/?p=1781"},"modified":"2014-03-09T16:13:24","modified_gmt":"2014-03-09T23:13:24","slug":"raspberry-pi-stratum-1-ntp-server","status":"publish","type":"post","link":"https:\/\/digitalnigel.com\/wordpress\/?p=1781","title":{"rendered":"Raspberry Pi &#8211; Stratum 1 NTP Server"},"content":{"rendered":"<p>So, I&#8217;m sure you&#8217;ve all heard of the <a href=\"http:\/\/www.raspberrypi.org\/\">Raspberry Pi<\/a>, which is a fancy little linux computer that fits in the palm of your hand. It&#8217;s certainly not the biggest, fastest, most capable thing out there, but it&#8217;s got a lot of appeal with the electronics hobbyist community due to being inexpensive, and having lots of interface options for other electronics.<\/p>\n<p>The Raspberry Pi has admittedly been out for a while now, so it&#8217;s nothing new at this point, but I had until now, not had much of a reason to get one. I had Arduino (and similar) boards to do little project things, and I had real x86 computers to do the real computational work.<\/p>\n<p>The impetus came when I was looking for an inexpensive way to set up a camera for a time lapse over the course of something like a week. I needed something that was &#8220;reasonably&#8221; low power, would run without me needing to fiddle with it much, and would produce decent quality photos.<\/p>\n<p>Unfortunately, nothing I had in terms of a point and shoot camera would fit the bill here, and while something like a GoPro would work, it was looking more expensive and less flexible.<\/p>\n<p>The Raspberry Pi has a camera accessory that takes 5MP stills or video, and is a linux computer when I&#8217;m done with the time lapse, and is pretty inexpensive, so, it seemed the choice was made and I ordered one.<\/p>\n<p>After playing with it for a bit, I realized it was also the perfect excuse, as well as device to build a project I&#8217;ve had on my mind for quite a while. A Stratum 1 NTP server.<\/p>\n<p>You see, for a few years now, I&#8217;ve had a Trimble Thunderbolt GPS timing receiver. It&#8217;s a fancy GPS device that produces very VERY *VERY* accurate timing outputs. I use one of which to clock some of my lab instrumentation to get the best accuracy there, but it has another output, that puts out a pulse once every second, on the second, which is very useful for making an accurate clock.<\/p>\n<p>Through a bit of digging on the intertubez, I found that a few other people had taken Raspberry Pis, or similar small low power boards and used GPS PPS (Pulse Per Second) outputs to create high accuracy Stratum 1 NTP servers. Using a combination of their collective information, I re-compiled the kernel on the Raspberry Pi to support watching a GPIO pin for pulses, and use those pulses to have the kernel discipline the local clock into being as accurate as possible.<\/p>\n<p>After which, it was a simple matter of editing the config file for NTPd and starting it up. BAM! It saw that it had a PPS signal source, grabbed the coarse time from other random NTP servers it found in the ntp.org pool, and then started disciplining the local time with the high accuracy signal.<\/p>\n<p>So, now I have a Stratum 1 time server here at my house, feeding my systems, as well as whomever else decides to use it (time.k7nvh.com).<\/p>\n<p><a href=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2014\/03\/IMG_0429.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-1782\" alt=\"IMG_0429\" src=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2014\/03\/IMG_0429-300x225.jpg\" width=\"300\" height=\"225\" srcset=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2014\/03\/IMG_0429-300x225.jpg 300w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2014\/03\/IMG_0429-150x112.jpg 150w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2014\/03\/IMG_0429-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You can also find the references I used here:<\/p>\n<p><a href=\"http:\/\/elinux.org\/RPi_Kernel_Compilation#Perform_the_compilation\">Raspberry Pi Kernel Compilation<\/a><\/p>\n<p><a href=\"http:\/\/ntpi.openchaos.org\/pps_pi\/\">Building a Stratum 1 NTP server with a Raspberry Pi<\/a><\/p>\n<p><a href=\"http:\/\/rdlazaro.info\/compu-Raspberry_Pi-RPi-stratum0.html\">Another Building a Stratum 1 NTP server with a Raspberry Pi<\/a><\/p>\n<p><a href=\"http:\/\/www.satsignal.eu\/ntp\/FreeBSD-GPS-PPS.htm\">Bulding a Stratum 1 NTP server with FreeBSD<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;m sure you&#8217;ve all heard of the Raspberry Pi, which is a fancy little linux computer that fits in the palm of your hand. It&#8217;s certainly not the biggest, fastest, most capable thing out there, but it&#8217;s got a &hellip; <a href=\"https:\/\/digitalnigel.com\/wordpress\/?p=1781\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,20,6],"tags":[],"class_list":["post-1781","post","type-post","status-publish","format-standard","hentry","category-electronics","category-projects","category-technology"],"_links":{"self":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1781"}],"version-history":[{"count":1,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1781\/revisions"}],"predecessor-version":[{"id":1783,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1781\/revisions\/1783"}],"wp:attachment":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}