Hi Paul! Beware: long e-mail ahead!
On 6 December 2011 14:49, Paul Duncan <p...@noc.ac.uk> wrote: > Hi Miguel, > > Thanks very much for getting back to me. No problem. I've been helped before so I'll do my best to help you. > > Okay, so I have mostly copied yours and this is what I am using now: > > # Modified ntp.conf from Miguel Goncalves > > server 127.127.20.0 prefer mode 2 minpoll 4 maxpoll 4 > fudge 127.127.20.0 flag1 1 flag2 0 flag3 1 flag4 1 time2 0.195 > > peer ntp.my-inbox.co.uk > > > tos mindist 0.250 > > statistics loopstats > statsdir /var/log/ntp/ > filegen loopstats file loop type delay enable > > restrict 127.0.0.1 > restrict 139.166.0.0 mask 255.255.0.0 > > restrict default nomodify notrap nopeer > > So, questions: > > 1) The peer line just needs to be another NTP server somewhere, right? > Peer creates a symmetric relationship with another NTP machine. We can get the time from them and they can get the time from us. I am a time nut and I have three different GPS receivers that peer with each other: backup# ntpq -pn remote refid st t when poll reach delay offset jitter ============================================================================== +192.168.111.1 .GPS. 1 u 16 16 377 0.255 -0.041 0.011 +192.168.111.2 .GPS. 1 u 11 16 377 0.258 -0.051 0.006 *192.168.111.3 .PPS. 1 u 13 16 377 0.269 -0.065 0.009 > 2) What does the line starting "tos" do? > It allows a difference of 250 ms between the PPS and the NMEA string. Sometimes the NMEA output from the receiver has a bit of jitter and the PPS is decoupled from the NMEA data. The default is 10 ms. It should be increased in situations like this. It's not advisable to set it to a large number: as low as possible is the best. Either way, it does not seemed to work. Output from ntptime and ntpq below: > > oot@darkstar:/etc# ntpq -p > > remote refid st t when poll reach delay offset > jitter > ==============================**==============================** > ================== > *GPS_NMEA(0) .GPS. 0 l 15 16 377 0.000 -67.594 > 13.658 > root@darkstar:/etc# ntptime Apparently the NMEA data is being received. I am not familiar with Linux and PPS but I believe your kernel should have a PPS patch applied. Did you do it? ntp_gettime() returns code 0 (OK) > time d288a989.f40bfde0 Tue, Dec 6 2011 14:47:37.953, (.953308550), > maximum error 8175995 us, estimated error 13079 us, TAI offset 0 > > ntp_adjtime() returns code 0 (OK) > modes 0x0 (), > offset -64.840 us, frequency -0.564 ppm, interval 1 s, > maximum error 8175995 us, estimated error 13079 us, > status 0x2001 (PLL,NANO), > time constant 4, precision 0.001 us, tolerance 500 ppm, > root@darkstar:/etc# > Definitely no PPS there. I have a machine that has GPS receiver and I configured it differently: server 127.127.20.0 mode 18 prefer minpoll 4 maxpoll 4 prefer fudge 127.127.20.0 flag1 0 flag4 0 time2 0.404 server 127.127.22.0 minpoll 4 maxpoll 4 fudge 127.127.22.0 flag2 0 flag3 1 tos mindist 0.25 Let me explain: there's the NMEA driver (127.127.20.0) with PPS disabled (flag1 0) and with a 404 ms fudge for the serial NMEA data. Additionally there's the PPS from the GPS (127.127.22.0). Note the prefer on the first driver. You could check that your PPS is not working if you use something like server 127.127.22.0 minpoll 4 maxpoll 4 fudge 127.127.22.0 flag2 0 flag3 1 server a.close.ntp.server prefer tos mindist 0.25 The server you'll be using can be a stratum 2, 3 or even greater. NTP will only use it to number seconds and find out about leap seconds and other "stuff". You'll get great accuracy from the PPS you are getting from the PPS. If you use this configuration don't forget to add the symlink in /dev (/dev/pps0 should point to your serial/parallel port). If this does not work you are not getting the PPS signal into your server. So, I'm now thinking that the mistake must be in the way I have run the > configure script when building the software. I think I just used > --enable-NMEA. Should I have done something else? > --enable-NMEA is enough. My configuration uses kernel PPS and that should be enabled in the kernel. In FreeBSD it's quite easy: I just add a line OPTIONS PPS_SYNC to the kernel configuration file, recompile and reboot. I believe the most recent Linux kernels already have this patch but you should look for it. Did you read http://time.qnan.org/? > Thanks! > > Paul. > You're welcome! Cheers, Miguel _______________________________________________ questions mailing list questions@lists.ntp.org http://lists.ntp.org/listinfo/questions