Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pps breaks when nmea is enabled for ntpd

731 views
Skip to first unread message

Richard Cagley

unread,
Jun 14, 2013, 9:03:40 PM6/14/13
to
I have a TI DM8168 processor and a u-blox gps.

If I enable an internet server and pps, then pps works great

server clock.redhat.com iburst prefer minpoll 4 maxpoll 4
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1

However, if I add an NMEA server to my ntp.conf file like this

server 127.127.20.0 mode 1
fudge 127.127.20.0 flag1 1
server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1

then pps stops working. I can kill ntpd and ppstest no longer works. It's
as though nmea is clobbering the serial port.

It sorta feels like this, but there was no resolution
http://lists.ntp.org/pipermail/questions/2011-September/030347.html

Can anyone help me. I've really been struggling with this.

David Lord

unread,
Jun 15, 2013, 11:54:07 AM6/15/13
to
I'm using NetBSD-6.1 ntpd 4.2.6p5 but have also had pps + nmea
working on ubuntu.

You probably need to determine then add time2 0.xyz sec to
your config. The time2 value is for your particular gps and
gps firmware version.

For my "Sure" gps I have:

server 127.127.20.2 mode 18 prefer
fudge 127.127.20.2 stratum 4 time2 0.417 flag1 0 refid GPSb
server 127.127.22.2
fudge 127.127.22.2 flag2 0 flag3 1 refid PPSb

From peer summary I have:
127.127.22.2 mean=0.000 rms=0.004 max=0.038

The 0.038 is mostly due to load from two cron jobs each evening.


David

David Taylor

unread,
Jun 15, 2013, 1:10:17 PM6/15/13
to
On my FreeBSD system, to enable PPS on the type 20 (NMEA) driver, I just
added flag1 and flag3 set to 1:

_________________________________________
server 127.127.20.1 mode 0 minpoll 4 maxpoll 4 prefer
fudge 127.127.20.1 flag1 1 flag3 1 refid PPS
_________________________________________

It's running ntpd 4.2.7p368, and does have Internet servers as well.
Excuse ant#y wrap....

C:\Users\David>ntpq -pn pixie
remote refid st t when poll reach delay offset
jitter
==============================================================================
o127.127.20.1 .PPS. 0 l 3 16 377 0.000 -0.002
0.002
uk.pool.ntp.org .POOL. 16 p - 1024 0 0.000 0.000
0.002
+192.168.0.1 .PPS. 1 u 29 64 377 0.150 0.029
0.041
+192.168.0.2 .PPS. 1 u 3 64 377 0.233 0.028
0.027
-91.212.90.20 89.36.197.2 3 u 1057 1024 377 18.130 3.258
4.000
-87.117.251.45 242.195.192.75 3 u 953 1024 377 19.668 2.265
4.685
-109.123.121.128 158.43.128.33 2 u 53 1024 377 22.207 -9.700
11.722
-85.119.80.233 193.47.164.28 3 u 323 1024 377 18.982 3.549
8.302
-94.125.132.7 195.66.241.10 2 u 876 1024 377 20.969 2.886
6.127
+94.125.129.7 195.66.241.10 2 u 280 1024 377 19.508 3.565
1.376


I don't know whether that helps.
--
Cheers,
David
Web: http://www.satsignal.eu

Mike S

unread,
Jun 15, 2013, 2:22:33 PM6/15/13
to
On 6/14/2013 9:03 PM, Richard Cagley wrote:
> If I enable an internet server and pps, then pps works great
>
> server clock.redhat.com iburst prefer minpoll 4 maxpoll 4
> server 127.127.22.0 minpoll 4 maxpoll 4
> fudge 127.127.22.0 flag3 1
>
> However, if I add an NMEA server to my ntp.conf file like this
>
> server 127.127.20.0 mode 1
> fudge 127.127.20.0 flag1 1
> server 127.127.22.0 minpoll 4 maxpoll 4
> fudge 127.127.22.0 flag3 1
>
> then pps stops working.

You don't say otherwise, so I assume this is all on the same serial
port. I think what's happening is that NMEA grabs the serial port first,
so the separate Atom (PPS) driver doesn't have access.

Don't use the Atom (127.127.22.0) driver, you don't need it. The NMEA
driver has its own PPS capabilities. You used "flag1 1", which enables
that support - what did you think that was doing? It doesn't make sense
to have two different PPS drivers, both driven by the same signal.

This is what I use for a Garmin 18x-LVC.

# flag1 1 = enable PPS
# flag2 0 = PPS on assert
#
server 127.127.20.0 mode 1 minpoll 4 maxpoll 4 prefer
fudge 127.127.20.0 time2 0.470 flag1 1 refid gPPS

This works better than using both drivers with different serial ports,
in my experience.

BTW, you should stop abusing redhat. It's rude to hit a public NTP
server at maxpoll 4.

Richard Cagley

unread,
Jun 15, 2013, 8:37:42 PM6/15/13
to
hmm, timeX is just a calibration factor so I don't think adding it will fix
my pps breakage. But, I do think it's important and I'm not using it.

So, question to you, I have a U-Blox NEO-6P module. How would I go about
determining the time1/time2 values for the 127.127.20.0 server? The key
words "offset" and "calibration" don't show up here
http://www.u-blox.com/images/downloads/Product_Docs/NEO-6_DataSheet_%28GPS.G6-HW-09005%29.pdf



On Sat, Jun 15, 2013 at 8:54 AM, David Lord <sn...@lordynet.org> wrote:

> Richard Cagley wrote:
>
>> I have a TI DM8168 processor and a u-blox gps.
>>
>> If I enable an internet server and pps, then pps works great
>>
>> server clock.redhat.com iburst prefer minpoll 4 maxpoll 4
>> server 127.127.22.0 minpoll 4 maxpoll 4
>> fudge 127.127.22.0 flag3 1
>>
>> However, if I add an NMEA server to my ntp.conf file like this
>>
>> server 127.127.20.0 mode 1
>> fudge 127.127.20.0 flag1 1
>> server 127.127.22.0 minpoll 4 maxpoll 4
>> fudge 127.127.22.0 flag3 1
>>
>> then pps stops working. I can kill ntpd and ppstest no longer works. It's
>> as though nmea is clobbering the serial port.
>>
>> It sorta feels like this, but there was no resolution
>> http://lists.ntp.org/**pipermail/questions/2011-**September/030347.html<http://lists.ntp.org/pipermail/questions/2011-September/030347.html>
>>
>> Can anyone help me. I've really been struggling with this.
>>
>
> I'm using NetBSD-6.1 ntpd 4.2.6p5 but have also had pps + nmea
> working on ubuntu.
>
> You probably need to determine then add time2 0.xyz sec to
> your config. The time2 value is for your particular gps and
> gps firmware version.
>
> For my "Sure" gps I have:
>
> server 127.127.20.2 mode 18 prefer
> fudge 127.127.20.2 stratum 4 time2 0.417 flag1 0 refid GPSb
> server 127.127.22.2
> fudge 127.127.22.2 flag2 0 flag3 1 refid PPSb
>
> From peer summary I have:
> 127.127.22.2 mean=0.000 rms=0.004 max=0.038
>
> The 0.038 is mostly due to load from two cron jobs each evening.
>
>
> David
>
> ______________________________**_________________
> questions mailing list
> ques...@lists.ntp.org
> http://lists.ntp.org/listinfo/**questions<http://lists.ntp.org/listinfo/questions>
>

Richard Cagley

unread,
Jun 15, 2013, 8:54:49 PM6/15/13
to
Very interesting. So, you just have this as your ntp.conf file?

server 127.127.20.1 mode 0 minpoll 4 maxpoll 4 prefer
fudge 127.127.20.1 flag1 1 flag3 1 refid PPS

When I do this I think only the GPS/127.127.20.0 line shows up in the
output. How do I know PPS is working? With just these two lines in my
ntp.conf file should I expect two lines in the output of ntpq -p?

I'll have to confirm this when I get co-located with the hardware tomorrow.




On Sat, Jun 15, 2013 at 10:10 AM, David Taylor <
david-...@blueyonder.co.uk.invalid> wrote:

> On 15/06/2013 02:03, Richard Cagley wrote:
>
>> I have a TI DM8168 processor and a u-blox gps.
>>
>> If I enable an internet server and pps, then pps works great
>>
>> server clock.redhat.com iburst prefer minpoll 4 maxpoll 4
>> server 127.127.22.0 minpoll 4 maxpoll 4
>> fudge 127.127.22.0 flag3 1
>>
>> However, if I add an NMEA server to my ntp.conf file like this
>>
>> server 127.127.20.0 mode 1
>> fudge 127.127.20.0 flag1 1
>> server 127.127.22.0 minpoll 4 maxpoll 4
>> fudge 127.127.22.0 flag3 1
>>
>> then pps stops working. I can kill ntpd and ppstest no longer works. It's
>> as though nmea is clobbering the serial port.
>>
>> It sorta feels like this, but there was no resolution
>> http://lists.ntp.org/**pipermail/questions/2011-**September/030347.html<http://lists.ntp.org/pipermail/questions/2011-September/030347.html>
>>
>> Can anyone help me. I've really been struggling with this.
>>
>
> On my FreeBSD system, to enable PPS on the type 20 (NMEA) driver, I just
> added flag1 and flag3 set to 1:
>
> ______________________________**___________
> server 127.127.20.1 mode 0 minpoll 4 maxpoll 4 prefer
> fudge 127.127.20.1 flag1 1 flag3 1 refid PPS
> ______________________________**___________
>
> It's running ntpd 4.2.7p368, and does have Internet servers as well.
> Excuse ant#y wrap....
>
> C:\Users\David>ntpq -pn pixie
> remote refid st t when poll reach delay offset
> jitter
> ==============================**==============================**
> ==================
> o127.127.20.1 .PPS. 0 l 3 16 377 0.000 -0.002
> 0.002
> uk.pool.ntp.org .POOL. 16 p - 1024 0 0.000 0.000
> 0.002
> +192.168.0.1 .PPS. 1 u 29 64 377 0.150 0.029
> 0.041
> +192.168.0.2 .PPS. 1 u 3 64 377 0.233 0.028
> 0.027
> -91.212.90.20 89.36.197.2 3 u 1057 1024 377 18.130 3.258
> 4.000
> -87.117.251.45 242.195.192.75 3 u 953 1024 377 19.668 2.265
> 4.685
> -109.123.121.128 158.43.128.33 2 u 53 1024 377 22.207 -9.700
> 11.722
> -85.119.80.233 193.47.164.28 3 u 323 1024 377 18.982 3.549
> 8.302
> -94.125.132.7 195.66.241.10 2 u 876 1024 377 20.969 2.886 6.127
> +94.125.129.7 195.66.241.10 2 u 280 1024 377 19.508 3.565 1.376
>
>
> I don't know whether that helps.
> --
> Cheers,
> David
> Web: http://www.satsignal.eu
>
>

Doug Calvert

unread,
Jun 16, 2013, 12:58:53 AM6/16/13
to
For time2 go 2/3rds the way down the configuring nmea page[1] and ook for:

"If you want a good estimation for fudge time2 (perhaps because PPS is
not an option for you) you could use the following procedure: "


I was never able to figure out the secret for time1.

[1] https://support.ntp.org/bin/view/Support/ConfiguringNMEARefclocks
> _______________________________________________
> questions mailing list
> ques...@lists.ntp.org
> http://lists.ntp.org/listinfo/questions

David Taylor

unread,
Jun 16, 2013, 1:17:45 AM6/16/13
to
On 16/06/2013 01:54, Richard Cagley wrote:
> Very interesting. So, you just have this as your ntp.conf file?
>
> server 127.127.20.1 mode 0 minpoll 4 maxpoll 4 prefer
> fudge 127.127.20.1 flag1 1 flag3 1 refid PPS
>
> When I do this I think only the GPS/127.127.20.0 line shows up in the
> output. How do I know PPS is working? With just these two lines in my
> ntp.conf file should I expect two lines in the output of ntpq -p?
>
> I'll have to confirm this when I get co-located with the hardware tomorrow.

Richard,

You know the PPS is working because the tally code changes from "*" to
"o" in the ntpq -p output:

*127.127.20.1 .PPS. 0 l 3 16 377 ....

o127.127.20.1 .PPS. 0 l 3 16 377 ....

My ntp.conf file also contains local backup stratum-1 servers, and
Internet servers, in case of failure of the GPS receiver.

BTW: please stop top-posting.

Doug Calvert

unread,
Jun 16, 2013, 1:01:16 AM6/16/13
to
On Sat, Jun 15, 2013 at 8:54 PM, Richard Cagley <rca...@gmail.com> wrote:
> Very interesting. So, you just have this as your ntp.conf file?
>
> server 127.127.20.1 mode 0 minpoll 4 maxpoll 4 prefer
> fudge 127.127.20.1 flag1 1 flag3 1 refid PPS
>
> When I do this I think only the GPS/127.127.20.0 line shows up in the
> output. How do I know PPS is working? With just these two lines in my
> ntp.conf file should I expect two lines in the output of ntpq -p?
>

If PPS is working there should be a "o" in the first column of the
ntpq billboard. (and it wont kick in right away, you have to wait a
teeny bit)

Doug Calvert

unread,
Jun 16, 2013, 2:35:57 AM6/16/13
to
On Sun, Jun 16, 2013 at 1:17 AM, David Taylor
<david-...@blueyonder.co.uk.invalid> wrote:
>
>
> BTW: please stop top-posting.

Instructions for gmail:

http://blog.jgc.org/2013/01/the-greatest-google-mail-feature-you.html

David Taylor

unread,
Jun 16, 2013, 3:06:16 AM6/16/13
to
Thanks for bottom-posting, Doug. You are actually using a gateway to a
Usenet newsgroup, that's where I'm seeing your messages, so any "gmail"
conventions may not be applicable. I find it easier to follow text from
question to answer, rather than the other way round, but I do try and
cut as much as possible from the material I'm quoting so that comment
and response both fit on one screen, with no need to scroll.

Doug Calvert

unread,
Jun 16, 2013, 3:54:01 AM6/16/13
to
I'm sorry david, I should have given more context. My post was for
anyone using gmail wondering about top/bottom posting. I am guilty of
top posting occasionally however I get just as irked as the next
veteran when I see others doing so, so I know how you feel.

Consider my gmail instructions a thank you for being so helpful to all
the people that ask questions on this list.

David Lord

unread,
Jun 16, 2013, 5:20:47 AM6/16/13
to
Richard Cagley wrote:
> hmm, timeX is just a calibration factor so I don't think adding it will fix
> my pps breakage. But, I do think it's important and I'm not using it.
>
> So, question to you, I have a U-Blox NEO-6P module. How would I go about
> determining the time1/time2 values for the 127.127.20.0 server? The key
> words "offset" and "calibration" don't show up here
> http://www.u-blox.com/images/downloads/Product_Docs/NEO-6_DataSheet_%28GPS.G6-HW-09005%29.pdf
>

I initially used "noselect" for 127.127.20.n and had one
of my other servers marked as "prefer"

I also have "tos mindist 0.4"

From peer_summary over several days I selected the mean
to use for time2.

Peer_summary for nmea over past 20 days shows wide spreads
of values: mean = -3 to 12, rms = 16 to 22, max = 63 to 88

The type 20 nmea driver can be used alone without problem
but I had been comparing pps to parallel vs serial inputs
(and did not find any significant difference).


David

Richard Cagley

unread,
Jun 16, 2013, 3:51:08 PM6/16/13
to
On Sat, Jun 15, 2013 at 10:17 PM, David Taylor <
david-...@blueyonder.co.uk.invalid> wrote:

> You know the PPS is working because the tally code changes from "*" to "o"
> in the ntpq -p output:

After 30 min mine doesn't seem to change. If I kill ntpd and run ppstest
again it fails. It would appear I'm back to my original question. Why does
starting up the NMEA driver kill the pps line? (output below) I see this on
startup. Is it significant?
addto_syslog: refclock_ppsapi: time_pps_create: Operation not supported

/ # ntpq -p
remote refid st t when poll reach delay offset
jitter
==============================================================================
*GPS_NMEA(0) .gPPS. 0 l 1 16 377 0.000 -5.956
2.752

David Taylor

unread,
Jun 17, 2013, 12:57:45 AM6/17/13
to
Sorry, Richard, but I don't know why this should be. I'm not too
familiar with Linux systems, so I hope someone else may be able to help.

David Lord

unread,
Jun 17, 2013, 5:27:22 AM6/17/13
to
When I tried with Ubuntu a few years ago I had to install
an extra package I think it was "ppskit" or similar name.


David



Richard Cagley

unread,
Jun 17, 2013, 2:53:31 PM6/17/13
to
On Mon, Jun 17, 2013 at 2:27 AM, David Lord <sn...@lordynet.org> wrote:

> When I tried with Ubuntu a few years ago I had to install
> an extra package I think it was "ppskit" or similar name.
>

you do have a /dev/pps0 device correct? It's not clear to me whether the
NMEA driver makes this device handle or it needs to be in place before I
start ntpd.

David Lord

unread,
Jun 17, 2013, 7:12:27 PM6/17/13
to
From memory, I created symlinks to the serial port and pps
didn't work but I must have already seen reference to ppskit
and that was as easy to install as any other supported
package and gave working pps.


David
0 new messages