[LinuxPPS] ntp-dev-4.2.5p237-RC does sync with PPS for me

Rodolfo Giometti giometti at enneenne.com
Wed Oct 28 09:38:35 CET 2009


On Tue, Oct 27, 2009 at 04:52:36PM -0500, William S. Brasher wrote:
> On Tue, 27 Oct 2009, Rodolfo Giometti wrote:
> 
> > 
> > Try this patch:
> > 
> 
> 
> That patch did not work for me.  The patch was munged by the time it 
> reached me, so what I applied, which may not be what was intended, is at 
> the bottom of this post.

The patch below seems ok to me.

> With this patch ppstest prints one line each second:
> 
> source 0 - assert 1256675446.782665642, sequence: 447 - clear  1256675001.897923435, sequence: 2
> source 0 - assert 1256675447.782590639, sequence: 448 - clear  1256675001.897923435, sequence: 2
> source 0 - assert 1256675448.782516489, sequence: 449 - clear  1256675001.897923435, sequence: 2
> source 0 - assert 1256675449.782441484, sequence: 450 - clear  1256675001.897923435, sequence: 2
> 
> 
> Otherwise, ppstest prints two lines each second:
> 
> source 0 - assert 1256675616.000007948, sequence: 17523 - clear  1256675615.100006738, sequence: 17522
> source 0 - assert 1256675616.000007948, sequence: 17523 - clear  1256675616.100006246, sequence: 17523
> 
> source 0 - assert 1256675617.000006620, sequence: 17524 - clear  1256675616.100006246, sequence: 17523
> source 0 - assert 1256675617.000006620, sequence: 17524 - clear  1256675617.100006314, sequence: 17524

It should depend on PPS mode is set... maybe we should change ppstest
program as follow:

diff --git a/Documentation/pps/ppstest.c b/Documentation/pps/ppstest.c
index d911bf6..6f73a02 100644
--- a/Documentation/pps/ppstest.c
+++ b/Documentation/pps/ppstest.c
@@ -54,7 +54,7 @@ int find_source(char *path, pps_handle_t *handle,
int *avail_m
        }
        params.assert_offset.tv_sec = 0;
        params.assert_offset.tv_nsec = 675;
-       params.mode |= PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
+       params.mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
        ret = time_pps_setparams(*handle, &params);
        if (ret < 0) {
                fprintf(stderr, "cannot set parameters (%m)\n");

In order to force PPS_CAPTUREASSERT only on all sources.

Can you please try this modification?

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it



More information about the LinuxPPS mailing list