David Taylor
Posts: 13
Joined: Fri Oct 26, 2012 1:32 pm

Re: NTP PPS

Tue Jan 28, 2014 10:01 am

Completely agree with you about the default OS for the Pi having PPS support, and the NTP as well! They should also not compile with the "tickless" option as that reduces the quality of timekeeping (as judged by NTP jitter). I've got all this working, so perhaps my Web page may help?

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

David

flok
Posts: 19
Joined: Thu Dec 13, 2012 9:46 am
Location: Gouda
Contact: ICQ Website

Re: NTP PPS

Tue Jan 28, 2014 12:49 pm

k.elliott wrote:My first project for the Rpi will be to implement a stratum 1 NTP server for the house using a low cost gps from spark fun.
My question is, can the gpio pins be used for the pps signal?
It may be a matter of recompiling the ntp source to look at a different pin, which doesnt really scare me.
all I can say is gimme gimme gimme some pi.
I've done that with a gps from adafruit, won't be much different I guess. Maybe a voltage level shifter?

For the software point of view: http://vanheusden.com/time/rpi_gpio_ntp/ That program allows you to the pps without patching and rebuilding the kernel. Of course at a (small) accuracy loss.

User avatar
peterwillcn
Posts: 22
Joined: Sun Sep 09, 2012 10:21 am
Contact: Website

Re: NTP PPS - another possible GPS choice

Tue Jan 28, 2014 4:00 pm

very interested, how to buy....
jbeale wrote:Only slightly off-topic: if anyone is interested in a very inexpensive GPS (or GPS + Glonass, or GPS + Baidou) receiver with 1-pps that has 10 nsec timing resolution, there is a "Kickstarter"-type project on (at Indiegogo) called NavSpark. At $19 it will be the least expensive timing-type GPS module I'm aware of. In addition, the baseband processing runs on a 32-bit CPU which at the same time as running the GPS, can host your own programs(!) written on via Arduino-style interface. The design is coming out of SkyTraq in Taiwan, which has already made some other, more expensive GPS units.

The project is still in funding phase and hasn't shipped yet so I don't have one, but I think this could be a good choice for a R-Pi GPS-based NTP server. It comes with an external antenna, using the tiny UFL connector. For most permanent installations you'll probably want a cable adaptor and use a longer cable run of something like RG-6 up to a rooftop location.

http://www.indiegogo.com/projects/navsp ... /x/6094574

glimmer
Posts: 12
Joined: Tue Jan 28, 2014 5:43 am

Re: NTP PPS

Tue Jan 28, 2014 7:16 pm

David Taylor wrote:Completely agree with you about the default OS for the Pi having PPS support, and the NTP as well! They should also not compile with the "tickless" option as that reduces the quality of timekeeping (as judged by NTP jitter). I've got all this working, so perhaps my Web page may help?

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

David
I've got things working by making Chrony use its own PPS driver to query /dev/pps0. I was just wondering why I was having trouble getting gpsd to provide PPS data via the SHM driver. Here's my config:

Code: Select all

refclock PPS /dev/pps0 lock GPS prefer refid PPS
refclock SHM 0 offset 0.5 delay 0.1 refid GPS noselect
leapsectz right/UTC
This is nearly identical to Chrony's example configuration. I'm not entirely certain yet whether this is an optimal offset for the GPS source.

As for the tickless kernel, well, it saves power and improves speed for some workloads. Most people using the Pi are likely to care about that more than they care about jitter in time sources. :) However, I'm having trouble thinking of a reason why PPS support would be left out by default; especially because it requires an explicit flag when compiling Chrony. Still, I think I've achieved victory:

Code: Select all

localhost ~ [130]# chronyc sources ; echo ; chronyc sourcestats ; echo ; chronyc tracking
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
#* PPS                           0   4   377    17   -970ns[-1529ns] +/-  601ns
#? GPS                           0   4   377    19    -12ms[  -12ms] +/-   56ms

210 Number of sources = 2
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
PPS                        22  11   339     -0.000      0.007     -5ns   899ns
GPS                         6   3    80   -436.984   1036.484    -33ms  8266us

Reference ID    : 80.80.83.0 (PPS)
Stratum         : 1
Ref time (UTC)  : Tue Jan 28 19:12:41 2014
System time     : 0.000000026 seconds slow of NTP time
Last offset     : -0.000000572 seconds
RMS offset      : 0.000000785 seconds
Frequency       : 39.256 ppm fast
Residual freq   : -0.000 ppm
Skew            : 0.008 ppm
Root delay      : 0.000000 seconds
Root dispersion : 0.000018 seconds
Update interval : 16.0 seconds
Leap status     : Normal

glimmer
Posts: 12
Joined: Tue Jan 28, 2014 5:43 am

Re: NTP PPS

Wed Jan 29, 2014 8:03 am

Update to my own problem: failure to sync against my old local time server was caused by inadvertently enabling a couple of options on a semi-managed HP switch. The options are labeled "Storm Control" and "Auto-DoS". The Auto-DoS option works really, really well. Not sure if that's what HP's engineers really intended, though.

Now I'm just left wondering whether it's possible to get gpsd reading the PPS source on my new time server. Hoping someone can weigh in.

David Taylor
Posts: 13
Joined: Fri Oct 26, 2012 1:32 pm

Re: NTP PPS

Wed Jan 29, 2014 8:16 am

Maybe there's help here:

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

Make sure the PPS is working using sudo ppstest, then configure gpsd accordingly with sudo dpkg-reconfigure gpsd

glimmer
Posts: 12
Joined: Tue Jan 28, 2014 5:43 am

Re: NTP PPS

Wed Jan 29, 2014 8:31 am

David Taylor wrote:Make sure the PPS is working using sudo ppstest, then configure gpsd accordingly with sudo dpkg-reconfigure gpsd
Yes, I did that. ppstest was successful, and Chrony is successfully using it directly, as I explained earlier. I'm quite confident that the problem is not the PPS hardware or drivers. I'm trying to work out just exactly what the problem is, however. All I have to go on is confirmation that gpsd was compiled to use the Linux kernel PPS API and the mystery creation of a /dev/pps1 that doesn't appear to correspond to any hardware attached to the Pi.

Running gpsd in the foreground shows that it's aware of the PPS API. However, I didn't see any indication that it's attempting to access /dev/pps0.

David Taylor
Posts: 13
Joined: Fri Oct 26, 2012 1:32 pm

Re: NTP PPS

Wed Jan 29, 2014 9:06 am

I only have a /dev/pps0, so perhaps that's the first thing to resolve.

I used the gpsd downloaded with apt-get, I made no attempt to compile it myself. As I noted before, there's something about compiling the kernel which requires tickless to be disabled, otherwise kernel PPS isn't supported, or isn't properly or fully supported....

krusher
Posts: 34
Joined: Thu Oct 10, 2013 1:55 am

Re: NTP PPS

Sun Apr 13, 2014 4:26 am

It's been 95 days since a reboot on my pi, which has been running great as an NTP server. I figured it was time to back up that SD card, in case someday my SD card would quit on me. I simply re-"burn" the .img file I made and put the new card in.

But: The Win32DiskImager program I used to make the card from the .img file only works to burn the image to the SD; I can't read it back and save it.

So...has anyone here made a backup image of their NTP server's SD card? I can use Win7 again (easiest) since this is a work laptop, but I could also live boot Linux Mint (using on another desktop) if Linux is easier.

Sorry if this is OT; I'm not sure where it should be posted and figured that someone here has done this by now.

Thanks!

David Taylor
Posts: 13
Joined: Fri Oct 26, 2012 1:32 pm

Re: NTP PPS

Sun Apr 13, 2014 7:00 am

I have used Win32DiskImager successfully to read the card and write an image file, on both Windows-XP/32 and Windows-8.1/64. What exactly is the problem you are seeing? What error message do you get? You need to define the file name to which to write the card image.

krusher
Posts: 34
Joined: Thu Oct 10, 2013 1:55 am

Re: NTP PPS

Mon Apr 14, 2014 4:39 am

Thanks for the tip, I tried Win32DiskImager again and I think it was the dialogue which threw me off the first time. It asks to "Open" a file, which makes sense writing an image to the card. When reading it from the card, you're creating a new file and not opening anything. Easy fix.

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 9 guests