Raspberry PI Stratum 1 NTP server

Discussion in 'Hardware' started by tux, Mar 7, 2015.

  1. tux

    tux The mighty penguin! :P

    As mentioned in the other thread here I've gotten myself two raspberry PI's. (Actually work payed for them, in exchange for some VPN experiments, but that's another story.)

    As I have already put them together I can't be arsed to pull them apart and photograph my parts. But these are my parts:

    * Raspberry PI 2 http://www.r-pi.se/raspberry-pi/raspberry-pi-2-model-b.html
    * GPS Addon Board http://ava.upuaut.net/store/index.php?route=product/product&path=59_60&product_id=95
    * Active GPS Antenna http://ava.upuaut.net/store/index.php?route=product/product&product_id=54
    * Carbon Fibre decorated box http://www.deltaco.se/products/items/itemid/%28RPI-BOX11%29/index.aspx

    I had to use my wire cutter to cut off a bit of the plastic on the box in order to get the antenna cable out. Otherwise it fitted perfectly.

    Then in short what I've done to get it working to provide me with timekeeping for ntpd:

    Down and install rpi_gpio_ntp from here: http://vanheusden.com/time/rpi_gpio_ntp/

    apt-get install gpsd gpsd-clients
    cat > /etc/default/gpsd
    4 people like this.
  2. Elite Override

    Elite Override /etc/passwd: No such file or directory. Staff Member

    Very interesting, would you mind explaining these parameters?

    server minpoll 4
    fudge time1 0.304 refid NMEA
    server minpoll 4 maxpoll 4 prefer
    fudge refid PPS
    Do you plan on adding it to the public list of NTP servers or just for your datacenter?
  3. tux

    tux The mighty penguin! :P

    I'd like to link:


    But to explain just my numbers above:

    minpoll/maxpoll - Minimum/Max seconds to poll the server as a power of two (default is 10 meaning 1,024 seconds)
    time1 - Hardware specific count relative to the PPS of my GPS unit

    The IP addresses are not really IP addresses, the 28 is a NTP driver specifier (28 is shared memory).
    And the 0 and 1's specifies which shared memory area of the shared NTP memory areas.

    The rpi_gpio_ntp program reads the specified gpio header (pin 18 for my chip) and shares it with ntpd using shared memory.
    2 people like this.
  4. tux

    tux The mighty penguin! :P

    One more interesting thing, I got much better precision for my timekeeping by running these: (and of course adding to /etc/rc.local)

    2 people like this.
  5. Elite Override

    Elite Override /etc/passwd: No such file or directory. Staff Member

    Thanks, this is really cool. I might consider doing the same some day.
  6. Nadeem

    Nadeem (╯°□°)╯︵ ┻━┻ Staff Member

    This is pretty great, I just got my Pi delivered as well.
  7. tux

    tux The mighty penguin! :P

    And it's now live in action, reachable on ntp.hedbergproductions.com. (Both v4/v6 of course.)

    However it's not going to do you very good if you sync from outside of Sweden to that machine as the network delay will be to much.

Share This Page