sebastiannielsen
Posts: 6
Joined: Wed Jun 18, 2014 10:01 pm

Problems with NTPd on a rPI

Wed Jun 18, 2014 10:08 pm

I did follow the instructions on this page:
http://ntpi.openchaos.org/pps_pi/

Only thing that I had to do in addition to the instructions was apt-get install bc, which was not present in the Raspbian image.

The GPS module in use is:
http://ava.upuaut.net/store/index.php?r ... duct_id=95

I have got Everything up'n'running, but theres a problem:
npt.conf looks like this:

Code: Select all

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift

server 127.127.22.0 minpoll 4 maxpoll 4
fudge 127.127.22.0 flag3 1 refid PPS
server 127.127.28.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.0 time1 +0.140 refid GPS

restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict 192.168.0.0 mask 255.255.0.0
restrict ::1
ppstest /dev/pps0 returns:

Code: Select all

root@raspberrypi:~# ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1403129104.019643681, sequence: 2303 - clear  0.000000000, sequence: 0
source 0 - assert 1403129105.019684923, sequence: 2304 - clear  0.000000000, sequence: 0
source 0 - assert 1403129106.019728164, sequence: 2305 - clear  0.000000000, sequence: 0
source 0 - assert 1403129107.019770406, sequence: 2306 - clear  0.000000000, sequence: 0
source 0 - assert 1403129108.019813649, sequence: 2307 - clear  0.000000000, sequence: 0
source 0 - assert 1403129109.019856891, sequence: 2308 - clear  0.000000000, sequence: 0
source 0 - assert 1403129110.019898134, sequence: 2309 - clear  0.000000000, sequence: 0
source 0 - assert 1403129111.019941377, sequence: 2310 - clear  0.000000000, sequence: 0
source 0 - assert 1403129112.019984620, sequence: 2311 - clear  0.000000000, sequence: 0
source 0 - assert 1403129113.020028864, sequence: 2312 - clear  0.000000000, sequence: 0
source 0 - assert 1403129114.020069108, sequence: 2313 - clear  0.000000000, sequence: 0
source 0 - assert 1403129115.020113352, sequence: 2314 - clear  0.000000000, sequence: 0
cgps -s returns:

Code: Select all

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x    Time:       2014-06-18T22:05:55.000Z   xxPRN:   Elev:  Azim:  SNR:  Used: x
x    Latitude:    57.709936 N               xx   1    52    277    49      Y   x
x    Longitude:   11.993469 E               xx   3    25    179    36      Y   x
x    Altitude:   67.7 m                     xx  11    71    247    43      Y   x
x    Speed:      0.1 kph                    xx  14    42    089    22      Y   x
x    Heading:    0.0 deg (true)             xx  17    05    320    27      Y   x
x    Climb:      0.0 m/min                  xx  19    43    174    33      Y   x
x    Status:     3D FIX (3 secs)            xx  20    15    233    35      Y   x
x    Longitude Err:   +/- 2 m               xx  22    32    067    32      Y   x
x    Latitude Err:    +/- 1 m               xx  24    11    020    31      Y   x
x    Altitude Err:    +/- 6 m               xx  27    13    162    26      Y   x
x    Course Err:      n/a                   xx  28    27    295    38      Y   x
x    Speed Err:       +/- 14 kph            xx  32    52    210    38      Y   x
x    Time offset:     0.678                 xx                                 x
x    Grid Square:     JO57xr                xx                                 x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
gpsmon:

Code: Select all

localhost:2947:               Generic NMEA>
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
xTime: 2014-06-18T22:07:34.000Z Lat:  57 42' 35.999" N Lon:  11 59' 36.730" E  x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Cooked PVT qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x GPGSV GPGLL GPRMC GPVTG GPGGA GPGSA                                          x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Sentences qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
lqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
xCh PRN  Az El S/N xxTime:      220734.00        xxTime:      220734.00        x
x 0   1 277 53  42 xxLatitude:    5742.59999 N   xxLatitude:  5742.59999       x
x 1   3 179 25  26 xxLongitude:  01159.61217 E   xxLongitude: 01159.61217      x
x 2  11 245 72  43 xxSpeed:     0.018            xxAltitude:  39.5             x
x 3  14  88 42   0 xxCourse:                     xxQuality:   2   Sats: 11     x
x 4  17 320  6  37 xxStatus:    A       FAA: D   xxHDOP:      1.01             x
x 5  19 174 42  28 xxMagVar:                     xxGeoid:     38.2             x
x 6  20 233 16  42 xmqqqqqqqqqqq RMC qqqqqqqqqqqqjmqqqqqqqqqqq GGA qqqqqqqqqqqqj
x 7  22  67 31  29 xlqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x 8  24  20 11  27 xxMode: A 3                   xxUTC:           RMS:         x
x 9  27 162 13  31 xxSats: 20 32 3 19 2...4 17 2 xxMAJ:           MIN:         x
x10  28 294 27  33 xxDOP: H=1.01  V=1.21  P=1.57 xxORI:           LAT:         x
x11  32 210 53  41 xmqqqqqqqqqqq GSA qqqqqqqqqqqqjxLON:           ALT:         x
mqqqqqq GSV qqqqqqqj                              mqqqqqqqqqqq GST qqqqqqqqqqqqj


However, my problem is:

Code: Select all

root@raspberrypi:~# ntpq -np
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
x127.127.22.0    .PPS.            0 l    1   16  377    0.000   -0.659   0.279
x127.127.28.0    .GPS.            0 l   15   16  377    0.000   -1.979   1.465
root@raspberrypi:~#
BOTH are shown with a "X" in the first column which means they are excluded from sync. Whats wrong? Seems like they fall into the allowed Clock skew range (-659 µs and -1.9ms) too, with a jitter of 279µs and 1.4ms, so I can't see whats wrong.
What are causing ntp to exclude them?


I SUSPECT its the rPI system Clock that is the culprit, that the builtin Clock in rPI isnt accurate since its not a RTC, and NTP then uses the system Clock to decide if the PPS source and GPS source is good.
But then - how can I configure ntpd to "distrust" the system Clock and assume that the system Clock is "rogue", eg Always assume the system Clock stupidly wrong.

sebastiannielsen
Posts: 6
Joined: Wed Jun 18, 2014 10:01 pm

Re: Problems with NTPd on a rPI

Wed Jun 18, 2014 11:35 pm

Checked now in ntpq with the cv command.

Seems still that its nothing wrong with the PPS, but even it excludes PPS:

root@raspberrypi:~# ntpq -np
remote refid st t when poll reach delay offset jitter
==============================================================================
x127.127.22.0 .PPS. 0 l 2 16 377 0.000 -3.656 0.031
x127.127.28.0 .GPS. 0 l - 16 377 0.000 -14.932 1.841
root@raspberrypi:~# ntpq
ntpq> cv
associd=0 status=0000 , no events, clk_unspec,
device="PPS Clock Discipline", timecode=, poll=1321, noreply=0,
badformat=0, baddata=0, fudgetime1=0.000, stratum=16, refid=80.80.83.0,
flags=4
ntpq>


cv tells the PPS source is perfectly good, but still ntpd excludes it for sync.

Return to “Advanced users”