{"id":23291492,"url":"https://github.com/guycole/perky-janus","last_synced_at":"2025-08-24T19:50:04.624Z","repository":{"id":141768992,"uuid":"489788487","full_name":"guycole/perky-janus","owner":"guycole","description":"BeagleBone Black as a NTP server using GPS time source","archived":false,"fork":false,"pushed_at":"2024-05-15T19:41:51.000Z","size":10176,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T23:48:58.416Z","etag":null,"topics":["beaglebone-black","gps","ntp"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guycole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-07T21:48:57.000Z","updated_at":"2025-01-05T09:26:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"4718cab4-4fc7-4a1a-a3f2-b99a7d8c1c2a","html_url":"https://github.com/guycole/perky-janus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guycole%2Fperky-janus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guycole%2Fperky-janus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guycole%2Fperky-janus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guycole%2Fperky-janus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guycole","download_url":"https://codeload.github.com/guycole/perky-janus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526677,"owners_count":20953141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beaglebone-black","gps","ntp"],"created_at":"2024-12-20T05:18:13.292Z","updated_at":"2025-04-06T17:46:01.407Z","avatar_url":"https://github.com/guycole.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# perky-janus\nBeagleBone Black as a NTP server using GPS as a time source.\n\n## Introduction\nThis project is to share my experience using a [BeagleBone Black](https://beagleboard.org/black) to obtain time from a GPS and then sharing time with other computers on a local network.  There are many stale posts about this topic, so here is a fresh take to throw on the pile.  I am writing this during May, 2022 for the BeagleBone Black (Revision C) using [AM3358 Debian 10.3 2020-04-06 4GB SD IoT](https://debian.beagleboard.org/images/bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz)\n\nThe deployment domain is a network of single board computers in a mobile application.  Little computers have terrible clock drift, so an external source was a priority.  I also needed location (because, mobile) so a GPS was mandatory.\n\n## The Plan\n1. Purchase a GPS receiver w/PPS output (probably not a USB device)\n1. Flash a BeagleBone Black w/a fresh image\n1. Install software packages \n1. Configure GPS and PPS\n1. Configure time server\n\nImplementation follows, there is certainly room for substitution.\n\n### GPS Receivers\nI purchased several inexpensive USB GPS receivers via Amazon, which all delivered location data but would not drive ntpd(8), because they lacked a PPS output.\n\nThis [GPS Receiver](https://www.digikey.com/en/products/detail/adafruit-industries-llc/746/5353613?utm_adgroup=Essen%20Deinki\u0026utm_source=google\u0026utm_medium=cpc\u0026utm_campaign=Shopping_DK%2BSupplier_Other\u0026utm_term=\u0026utm_content=Essen%20Deinki\u0026gclid=Cj0KCQjw1N2TBhCOARIsAGVHQc5wzGDhJDlvyq4N77R9zlWtRVCpPK9Ajwizl2vyqLFRE6OX0z9Cs-8aAtAfEALw_wcB) was my solution (w/a powered antenna).\n\nI used a [Digilent Digital Discovery](https://digilent.com/shop/digital-discovery-portable-usb-logic-analyzer-and-digital-pattern-generator/) to verify the GPS receiver was healthy.\n1. GPS UART output\n![GPS output](https://github.com/guycole/perky-janus/blob/main/grafix/uart_out2.png)\n1. GPS PPS output\n![PPS output](https://github.com/guycole/perky-janus/blob/main/grafix/pps_out2.png)\n\n### Install packages\n1. apt-get install gps\n1. apt-get install gpsd-clients\n1. apt-get install pps-tools\n1. apt-get install ntp\n\n### Configure GPS and PPS\nThe GPS receiver will write ASCII messages to BeagleBone UART1, and send a sync pulse to GPIO_60. gpsd(8) will readily accept the UART messages, but the pps driver will require some extra work.  \n\n#### Pins\n| Header | Pin | Name      | Description       |\n|--------|-----|-----------|-------------------|\n| P9     |  1  | DGND      | Ground            |\n| P9     |  7  | SYS_5V    | GPS VIN           |\n| P9     | 12  | GPIO_60   | GPS PPP           |\n| P9     | 24  | UART1_TXD | GPS RX            |\n| P9     | 26  | UART1_RXD | GPS TX            |\n\n#### gpsd(8)\n1. Copy [gpsd.default](https://github.com/guycole/perky-janus/blob/main/gpsd.default) to /etc/default/gpsd\n1. Start gpsd(8) by invoking ```systemctl restart gpsd.service```\n1. Verify gpsd(8) by invoking ```systemctl status gpsd.service```\n![resultsl](https://github.com/guycole/perky-janus/blob/main/grafix/systemctl.png)\n\n1. Assuming gpsd(8) started, try your luck with cgps(1).\n![resultsl](https://github.com/guycole/perky-janus/blob/main/grafix/cgps.png)\n\n#### pps\n1. For reasons, pps will require you to install a device overlay.\n1. git clone https://github.com/RobertCNelson/bb.org-overlays.git\n1. Copy [BB-UART1-GPS-00A0.dts](https://github.com/guycole/perky-janus/blob/main/BB-UART1-GPS-00A0.dts) to bb.org-overlays/src/arm\n1. Install the overlays by invoking bb.org-overlays/install.sh\n1. Update /boot/uEnv.txt to reference the new overlay\n![uEnv.txtl](https://github.com/guycole/perky-janus/blob/main/grafix/uenv.png)\n1. Reboot\n1. Test for PPS success\n![ppstestl](https://github.com/guycole/perky-janus/blob/main/grafix/ppstest.png)\n1. gpsmon(1) will demonstrate you have pps working\n![resultsl](https://github.com/guycole/perky-janus/blob/main/grafix/gpsmon.png)\n1. ntpshmmon(1) will also verify gpsd using PPS\n![resultsl](https://github.com/guycole/perky-janus/blob/main/grafix/ntpshmmon.png)\n\n### Configure Time Server\nFor my application, there are not internet connected time servers to consult.  I want time exclusively from the GPS receiver.\n1. Copy [ntpd.conf](https://github.com/guycole/perky-janus/blob/main/ntpd.conf) to /etc/default/ntpd.conf\n1. Restart ntpd(8) by invoking ```systemctl restart ntpd.service```\n1. Verify ntpd(8) by invoking ```systemctl status ntpd.service```\n1. Verify ntpd(8) is reading via shared memory/PPS\n![ntpq](https://github.com/guycole/perky-janus/blob/main/grafix/ntpq.png)\n\n### Verify Results\n1. Remove external network connectivity\n1. Disable gpsd via systemctl ```systemctl stop gpsd.service```\n1. Set a bogus date ```date 042708002020```\n1. Restart gpsd ```systemctl restart gpsd.service```\n1. Observe the time eventually become current\n\n### Relevant Links\n1. [thread w/RCN](https://forum.beagleboard.org/t/beaglebone-black-gps-pps-and-chrony-for-time-sync/897/17)\n1. [overlays on elinux.org](https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays)\n1. [pps on kernel.org](https://www.kernel.org/doc/html/latest/driver-api/pps.html)\n1. [gpsd time service howto](https://gpsd.gitlab.io/gpsd/gpsd-time-service-howto.html)\n1. [beaglebone-gps-clock](https://github.com/jrockway/beaglebone-gps-clock)\n1. [Dan Drown BBB as NTP/GPS](https://blog.dan.drown.org/beaglebone-black-ntpgps-server/)\n1. [toptechboy python](https://toptechboy.com/beaglebone-black-gps-tracker-lesson-3-parsing-the-nmea-sentences-in-python/)\n1. [small golden sceptre](https://mythopoeic.org/beaglebone-green-time-server/)\n1. [LinuxPPS Wiki](http://linuxpps.org/doku.php)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguycole%2Fperky-janus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguycole%2Fperky-janus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguycole%2Fperky-janus/lists"}