Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ntpd stratum 1 funny offset with NetBSD 6 branch



Hi Simon !

OK, kernel tty driver is fine from pps-api output - good news.

From the code you should be seeing refclock_pps: messages
once a second when you run ntpd at debug level 2 (-d -d).

Also the code expects the captured PPS timestamp to be not
older then 1.5 seconds and within 0.45 seconds of the actual time.

As you should be picking up PPS time stamps once a second the
1.5 second restriction is met.

From your billboards I see a systematic offset of 650ms. This
driver needs to know the time offset at the end of the line.
See file:///usr/share/doc/html/ntp/drivers/driver20.html
time 2 - Specifies the serial end of line time offset calibration factor, in seconds and fraction, with default 0.0.)

So you might want to try to fudge time2 to 0.650 in your case. (I hope I analyzed the code correctly)

Frank

On 07/19/13 18:12, Simon Burge wrote:
Hi Frank!

Frank Kardel wrote:

Hi Simon  !

Two observations:
NetBSD 5 has 4.2.4p6.

NetBSD 6+current have 4.2.6p5.
I did try 4.2.4p6 (from NetBSD 5) on NetBSD 6 and behaves the same
broken way.

Just for kicks, I tried a NetBSD 6 kernel on NetBSD 5 but ntpd reports

        refclock_nmea: time_pps_setparams failed: Inappropriate ioctl for device

which I'm guessing is 64-bit time_t lossage as a timespec would be
larger in NetBSD 6 and it doesn't appear that the PPS ioctls are
versioned.

Also note that the PPS samples seems to be ~two seconds apart and there is
also a difference of ~2 seconds between now and the asser time stamp.
The ATOM driver should be just using the difference between the fictive
integral second and the time stamp. So from the data given ATOM's behavior
looks strange here. Even more so as the other peers seem to indicate
basically
good synchronization.

Further step:
Verify that PPS is picked up correctly:
      - go to /src/external/bsd/ntp/dist/util and make pps-api
      - call pps-api with your PPS device
pps-api seems happy (after fixing the printf formats and adding a "now"
timestamp):

               now               assert                clear
1374243213.014227 1374243213.000706506          0.000000000  1  0 -1374243213.
1374243213.044193 1374243213.000706506 1374243213.040716223  1  1  0.040009717
1374243214.004211 1374243214.000707691 1374243213.040716223  2  1 -0.959991468
1374243214.044193 1374243214.000707691 1374243214.040709742  2  2  0.040002051
1374243215.004256 1374243215.000719951 1374243214.040709742  3  2 -0.960010209
1374243215.044235 1374243215.000719951 1374243215.040717408  3  3  0.039997457
1374243216.004255 1374243216.000709099 1374243215.040717408  4  3 -0.959991691
1374243216.044239 1374243216.000709099 1374243216.040711668  4  4  0.040002569
1374243217.004302 1374243217.000710099 1374243216.040711668  5  4 -0.959998431
1374243217.044281 1374243217.000710099 1374243217.040712297  5  5  0.040002198
1374243218.004283 1374243218.000711247 1374243217.040712297  6  5 -0.959998950
1374243218.044265 1374243218.000711247 1374243218.040713038  6  6  0.040001791
1374243219.004329 1374243219.000716543 1374243218.040713038  7  6 -0.960003505
1374243219.044300 1374243219.000716543 1374243219.040726372  7  7  0.040009829
1374243220.004297 1374243220.000712877 1374243219.040726372  8  7 -0.959986505
1374243220.044281 1374243220.000712877 1374243220.040714927  8  8  0.040002050
1374243221.004344 1374243221.000710507 1374243220.040714927  9  8 -0.959995580
1374243221.044324 1374243221.000710507 1374243221.040727594  9  9  0.040017087
1374243222.004321 1374243222.000714544 1374243221.040727594 10  9 -0.959986950
1374243222.044303 1374243222.000714544 1374243222.040716742 10 10  0.040002198

Both the PPS assert and clear timestamps look very regular, and also are
appearing every second (not every second second as was seemingly being
reported by ntpd).  I think (hope!) this is telling me that the hardware
CD interrupt stuff is working fine.

However, I do only see NMEA sentences every second second:

$GPRMC,160808,A,3810.2933,S,14418.4083,E,000.0,000.0,190713,011.5,E,A*0F
$GPGGA,160808,3810.2933,S,14418.4083,E,1,07,1.0,78.0,M,-2.1,M,,*79
$GPGSA,A,3,02,04,12,15,17,24,28,,,,,,2.3,1.0,2.0*3B
$GPGSV,3,1,09,02,26,004,46,04,48,044,35,12,28,242,47,15,19,299,26*78
$GPGSV,3,2,09,17,47,135,51,24,54,239,47,28,16,089,19,09,10,029,00*7C
$GPGSV,3,3,09,26,09,339,00*44
$PGRME,3.0,M,6.6,M,7.3,M*29
$GPRMC,160810,A,3810.2933,S,14418.4083,E,000.0,000.0,190713,011.5,E,A*06
$GPGGA,160810,3810.2933,S,14418.4083,E,1,07,1.0,78.0,M,-2.1,M,,*70
$GPGSA,A,3,02,04,12,15,17,24,28,,,,,,2.3,1.0,2.0*3B
$GPGSV,3,1,09,02,26,004,46,04,48,044,35,12,28,242,47,15,19,299,26*78
$GPGSV,3,2,09,17,47,135,51,24,54,239,47,28,16,089,20,09,10,029,00*76
$GPGSV,3,3,09,26,09,339,00*44
$PGRME,3.0,M,6.5,M,7.2,M*2B
$GPRMC,160812,A,3810.2933,S,14418.4083,E,000.0,000.0,190713,011.5,E,A*04
$GPGGA,160812,3810.2933,S,14418.4083,E,1,07,1.0,78.0,M,-2.1,M,,*72
$GPGSA,A,3,02,04,12,15,17,24,28,,,,,,2.3,1.0,2.0*3B
$GPGSV,3,1,09,02,26,004,46,04,48,044,35,12,28,242,47,15,19,299,25*7B
$GPGSV,3,2,09,17,47,135,51,24,54,239,47,28,16,089,22,09,10,029,00*74
$GPGSV,3,3,09,26,09,339,00*44
$PGRME,3.0,M,6.5,M,7.1,M*28

Is that enough to confuse ntpd?

Cheers,
Simon.



Home | Main Index | Thread Index | Old Index