From: Steven Baltakatei Sandoval Date: Wed, 7 Oct 2020 17:45:10 +0000 (+0000) Subject: chore(doc/time):Update README X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02.git/commitdiff_plain/aafe11cf00550096cae03919d3d3009a87977005?ds=inline;hp=-c chore(doc/time):Update README --- aafe11cf00550096cae03919d3d3009a87977005 diff --git a/doc/time/README.org b/doc/time/README.org index b346b3b..7f84558 100644 --- a/doc/time/README.org +++ b/doc/time/README.org @@ -4,11 +4,14 @@ This document was created by Steven Baltakatei Sandoval on was updated by Steven Baltakatei Sandoval on ~2020-07-25T19:34Z~ ** Development Task list *** Set up prototype unit -**** Solder wire for PPS signal +**** DONE Solder wire for PPS signal +***** 2020-07-25T20:03Z; bktei> Soldered pins to permit accessibility. + CLOSED: [2020-07-25 Sat 20:03] **** Follow guide - [[https://ozzmaker.com/forums/topic/connecting-gps-pps-pin/][Ozzmaker post]] on ~PPS~ wiring and a [[https://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html][guide]] recommendation. - [[http://www.satsignal.eu/raspberry-pi/Schmidt-RPZ-NTP-2016.pdf][Schmidt article]] on Raspberry Pi Zero time server. - [[https://gpsd.gitlab.io/gpsd/gpsd-time-service-howto.html][GPSD dev ref]] page for ~gpsd~ interfacing with ~ntp~. +- [[https://raspberryautomation.com/connect-multiple-ds18b20-temperature-sensors-to-a-raspberry-pi/][Raspberry Autom]] article on specifying custom GPIO pin. *** Document prototype unit ** Narrative The ~ninfacyzga-01~ device is equipped with an Ozzmaker BerryGPS-IMU @@ -34,19 +37,105 @@ See [[https://ozzmaker.com/forums/topic/connecting-gps-pps-pin/][this]] Ozzmaker ~T_PULSE~ pin to GPIO 18. Connect the ~T_PULSE~ connection on the BerryGPS-IMU-3 to GPIO pin 18 -in order to enable ~gpsd~ to read the PPS signal for forwarding to -~ntp~. +(ex: with solder and wire) in order to provide the PPS data signal +generated by the BerryGPS-IMU to the Raspberry Pi. Processing of this +data signal is handled by adding a line to ~/boot/config.txt~ in the +next section ("Install Software"). **** Install Software -Run the following command to install the required packages. -: $ sudo apt install usbmount eject gpsd gpsd-clients python-gps pps-tools ntp - These instructions assume that ~gpsd~ has already been setup to provide NMEA sentences to ~gpspipe~ for location. See the ~README.org~ in ~doc/location~ for details. Basically, ~gpsd~ needs to be told via -its ~/etc/default/gpsd~ configuration file of which ~/dev/tty???~ will +its ~/etc/default/gpsd~ configuration file of which ~/dev/ttyS0~ will provide the raw GPS module data. +***** Install packages via ~apt~ +Run the following command to install the required packages. +: $ sudo apt install usbmount eject gpsd gpsd-clients python-gps pps-tools ntp + +***** Modify ~/boot/config.txt~ +In order to tell the Raspberry Pi to expect PPS data on ~BCM 18~ (pin +number 12; see [[https://pinout.xyz/][RaspPi pinout]]), add the following line to +~/boot/config.txt~ as described on [[https://ozzmaker.com/forums/topic/problems-with-pps-on-a-pi0w-running-raspian-and-attached-to-a-berrygps-imuv3/][this Ozzmaker page]]: + +: dtoverlay=pps-gpio,gpiopin=18 + +PPS data can be confirmed by running: + +#+BEGIN_EXAMPLE +$ sudo su - +# ppstest /dev/pps0 +trying PPS source "/dev/pps0" +found PPS source "/dev/pps0" +ok, found 1 source(s), now start fetching data... +source 0 - assert 1595708074.003644641, sequence: 219 - clear 0.000000000, sequence: 0 +source 0 - assert 1595708075.003709620, sequence: 220 - clear 0.000000000, sequence: 0 +source 0 - assert 1595708076.003779580, sequence: 221 - clear 0.000000000, sequence: 0 +source 0 - assert 1595708077.003850580, sequence: 222 - clear 0.000000000, sequence: 0 +#+END_EXAMPLE + +***** Add udev rule +As per [[https://www.slsmk.com/how-to-setup-a-gps-pps-ntp-time-server-on-raspberry-pi/][the slsmk.com]] guide, create symbolic links expected by ~ntp~ +pointing to the PPS device. This may be performed by creating the file: + +: /etc/udev/rules.d/09-pps.rules + +with the contents: + +#+BEGIN_EXAMPLE +KERNEL=="ttyAMA0", SUBSYSTEM=="tty", DRIVER=="", OWNER=="root", GROUP=="tty", MODE=="0777", SYMLINK+="gps0" +#+END_EXAMPLE + +***** Modify ~/etc/modules~ +For older versions of Raspberry Pi, it may be necessary to explicitly +require the ~pps-gpio~ module to be loaded by making sure +~/etc/modules~ contains the line: + +: pps-gpio + +According to [[https://www.raspberrypi.org/forums/viewtopic.php?p=757747#p757747][this]] post on 2015-05-13T09:14 by [[https://www.raspberrypi.org/forums/memberlist.php?mode=viewprofile&u=31454][ame]] on the Raspberry Pi +forums, + +#+BEGIN_QUOTE +rowlandski wrote: +> Hi, +> +> I want the RPi to load/probe the w1-gpio module on boot. +> +> I have added: +> +> sudo modprobe w1-gpio +> +> To the etc/modules file, but on boot it is not loaded. +> I have checked this by the lsmod command. If i then enter the above line manually and then check it's there loaded. +> +> What's wrong with my line on code in the modules file? +> +> Thanks + +You no longer need to load modules for some devices. It's handled by devicetree. + +Search for "devicetree" on the forum, or start here: +https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314 +#+END_QUOTE + +As of 2020-07-25, using Raspbian Buster 10 with a BerryGPS-IMU v3, +~/etc/modules~ did not need to be modified. + +***** Remove DHCP client hooks +As per [[https://www.slsmk.com/how-to-setup-a-gps-pps-ntp-time-server-on-raspberry-pi/][this]] guide, "remove ntp DHCP hook (so that it doesn't override ntp settings)". + +This can be performed by running the following command (shown in +script form for readability): + +#+BEGIN_EXAMPLE +if [ -f "/etc/dhcp/dhclient-exit-hooks.d/ntp" ]; then + mv /etc/dhcp/dhclient-exit-hooks.d/ntp /etc/dhcp/dhclient-exit-hooks.d/xxxntp-orig; +else + echo "NTP exit hook does not exist"; +fi; +#+END_EXAMPLE + *** Normal Startup *** Normal Operation *** Normal Shutdown