TimeServer

From Stu2
Jump to navigation Jump to search

If you look elsewhere in this wiki, you'll see references to connecting to a Novatel GPS receiver. When I built that project, Raspberry PI didn't exist! So I thought I would take the natural step of building a time server using the GPS boards and a Raspberry PI 3. After many hours, I discovered the Novatel boards didn't output the right date! They're so old, I don't think they are Y2K compliant. The date provided by the $GPRMC line was 310399. Strange.

So I abandoned this idea and switched to Raspberry PI Zero and Ultimate GPS from Adafruit. Note, the GPS has a RTC! So the RTC I ordered will be used in some other project. These are the notes for my build. I bounced between these URLs for instructions:

http://mythopoeic.org/pi-ntp/ https://lemariva.com/blog/2018/07/raspberry-pi-preempt-rt-patching-tutorial-for-kernel-4-14-y https://www.satsignal.eu/ntp/Raspberry-Pi-quickstart.html

None of them are perfect.

  • Install Jessie Lite - enable SSH and WiFi. I had to connect the keyboard and monitor to run raspi-config because I couldn't figure out the headless WiFi config.
  • Setup the Serial Ports - https://www.raspberrypi.org/documentation/configuration/uart.md I disabled BT and moved the hardware UART to /dev/ttyAMA0 (pins 8 and 10) to reduce the load on the PI.
  • Build the RT Kernel with PPS support (not installed)
  • Build NTP with 1PPS support
  • Updated firmware (rpi-update)
  • Installed GPSD
  • Configured ntp to use driver 22 and 28. (Didn't try Driver 46) - still working on this
  • systemctl disable systemd-timesyncd
# Kernel-mode PPS reference-clock for the precise seconds
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 refid kPPS

# Coarse time reference-clock - nearest second
server 127.127.28.0 minpoll 4 maxpoll 4 iburst prefer
fudge 127.127.28.0 time1 +0.105 flag1 1 refid GPSD stratum 1