<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 05/03/2016 06:16 PM, Eric S. Raymond
      wrote:<br>
    </div>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite"><br>
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">== Initial configuration in the GUI (Pi only) ==

Plug in a monitor, a mouse, and keyboard, and a live Ethernet cable;
power up the Pi. Go through your normal configuration - hostname,
keyboard layout, timezone, locale, etc.
</pre>
      </div>
    </blockquote>
    I'm gathering here the user has aquired a Pi with some distro
    already on a card?<br>
    With the references here to having a gui, does this imply NOOBS?  I
    started with the<br>
    latest image from here
    <a class="moz-txt-link-freetext" href="https://www.raspberrypi.org/downloads/raspbian/">https://www.raspberrypi.org/downloads/raspbian/</a><br>
    specifically Rasbian Jessie Lite.  Console only already, just dd to
    a card and boot...<br>
    <br>
    Followed mostly from here on except as noted.
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">------------------------------------------------------------------------
# rpi-update
------------------------------------------------------------------------
</pre>
      </div>
    </blockquote>
    I'm on a Pi, this command isn't found, see references to it all
    over.<br>
    Perhaps it is obsolete?
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">=== Configure the 1PPS GPIO pin ==</pre>
      </div>
    </blockquote>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">In all versions, you force the driver to be loaded by
editing /etc/modules to contain the line "pps-gpio"
footnote[Alternatively, you can build your own kernel with pps-gpio
hardwired in.].
</pre>
      </div>
    </blockquote>
    With recent changes in overlays I have found that one doesn't need<br>
    to modify /etc/modules.  The module will be loaded if the overlay is<br>
    written well.  This works for other devices also.  Forcing it with<br>
    the addition to /etc/modules doesn't appear to change anything, just<br>
    another change for someone to screw up.  Finger pointing back at me!<br>
    <br>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">
# apt-get install libreadline-dev asciidoc
------------------------------------------------------------------------
</pre>
      </div>
    </blockquote>
    asciidoc pulls in a shit ton of dependancies!  500+ Mb that filled /<br>
    and caused me some hair pulling.  Docs are online :)  I am using a
    smaller SD card than recommended above though.
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">------------------------------------------------------------------------
KERNEL=="ttyAMA0", SYMLINK+="gps0"  
KERNEL=="pps0", OWNER="root", GROUP="tty", MODE="0660", SYMLINK+="gpspps0"
------------------------------------------------------------------------
</pre>
      </div>
    </blockquote>
    I have the above, just question tty as group.  I'm running ntpd as
    ntp:ntp.<br>
    Guessing things works as nptd gets the pps device before dropping
    permissions.
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">According to <<NEVILL>>, "[dhcpcd5] has a nasty habit of interfering where
it's not wanted. Specifically, in this instance, if your DHCP server
specifies an NTP server, it will start ntpd with its own version of
ntp.conf."
</pre>
      </div>
    </blockquote>
    #dpkg --purge dhcpcd5<br>
    mike@ticker:/var/log $ cat /etc/rpi-issue <br>
    Raspberry Pi reference 2016-03-18<br>
    Generated using Pi-gen, <a class="moz-txt-link-freetext" href="https://github.com/RPi-Distro/Pi-gen">https://github.com/RPi-Distro/Pi-gen</a>, stage2<br>
    <br>
    With this release I did find before I purged dhcpcd5 that it ignores
    /etc/networks/interfaces.<br>
    After a bit a digging turns out you need to modify /etc/dhcpcd.conf
    to add static entries.<br>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">------------------------------------------------------------------------
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

# Local
server 127.127.1.0  
fudge 127.127.1.0 stratum 10
</pre>
      </div>
    </blockquote>
    Local refclock shows "D" in the refclocks chart and we didn't build
    it in<br>
    by the above instructions.<br>
    <br>
    # PPS<br>
    server 127.127.22.0 minpoll 4 maxpoll 4 iburst <br>
    fudge 127.127.22.0 flag2 0 flag4 1 refid PPS<br>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">
# GPS with PPS enabled
server 127.127.20.0 mode 17 minpoll 4 maxpoll 4 iburst true prefer  
fudge 127.127.20.0 flag1 1 refid GPS</pre>
      </div>
    </blockquote>
    Shouldn't 22.0 be the preferred refclock?  My experience is slim to
    none here and built on the work of others.  I've always thought that
    we wanted the pps signal for the precision not the NMEA.  Have I be
    misunderstanding this?
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap=""># By default, exchange time with everybody, but don't allow configuration.
restrict default kod nomodify notrap nopeer noquery  
</pre>
      </div>
    </blockquote>
    kod needs "limited" from log messages.<br>
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">
# Drift file etc.
driftfile /var/lib/ntp/ntp.drift
</pre>
      </div>
    </blockquote>
    The drift file location from example configs in the src pulled from
    git bit me. <br>
    Most of them reference /etc/ntp.drift which DOES NOT work when
    running as ntp:ntp...
    <blockquote cite="mid:20160503221656.GD24121@thyrsus.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 14px;"
        lang="x-western">
        <pre wrap="">== Edge-detection issues and new HATs ==

As the pps-gpio module is in April 2016 it has a flaw. It catches only
one edge of the PPS. You have a 50/50 chance you are seeing the
trailing edge rather than the leading edge (which is the actual top of
second).  A patch to fix this has been submitted to the Linux kernel
maintainers but not merged.
</pre>
      </div>
    </blockquote>
    I've tried to figure out just how one determines exactly which edge
    is being seen.<br>
    I'm at a loss on this one with software.  Using ppstest shows me
    atypical output<br>
    from nearly every example I'm seen online.  What is the definetive
    way to determine this?<br>
    <br>
    The GPS device I'm using isn't a hat.  In the past I've had it
    working with gpsd and ntp classic.  I haven't a clue which edge is
    actually being seen though.<br>
    <br>
    Mike<br>
    <br>
    <br>
  </body>
</html>