General > General Technical Chat
Does anyone play with GPS based ntp server and have clients?
<< < (3/5) > >>
tkamiya:
Double Thank You!

I just did ntpq -crv

associd=0 status=0115 leap_none, sync_pps, 1 event, clock_sync,
version="ntpd 4.2.8p4@1.3265-o Tue Jan  7 15:08:23 UTC 2020 (1)",
processor="x86_64", system="Linux/4.4.0-146-generic", leap=00, stratum=1,
precision=-23, rootdelay=0.000, rootdisp=3.115, refid=PPS,
reftime=e560d3ad.093248ff  Sun, Dec 12 2021 15:01:49.035,
clock=e560d43a.a2258084  Sun, Dec 12 2021 15:04:10.633, peer=28071, tc=4,
mintc=3, offset=0.028966, frequency=19.454, sys_jitter=0.970294,
clk_jitter=1.024, clk_wander=0.112

So the ntpd version is 4.2.8p4

I hope this version is a "*" bug free one.
My GPS is actually this unit:
https://www.tindie.com/products/nsayer/gps-clock/
The actual GPS module is SkyTraq Venus838LPx-T based, which outputs regular NEMA sentences.

I changed the lines referencing GPS to the one you suggested.  I'll let it settle down and see how they are doing.  I have few other GPS, so if this one doesn't do it, it is an easy matter to switch it out.
jav:

--- Quote from: tkamiya on December 12, 2021, 08:13:00 pm ---So the ntpd version is 4.2.8p4

--- End quote ---
That version has some security issues. You'll be fine as long as you're only giving access to trusted clients. Don't open it up to the Internet.

Also, please note that you cannot use driver 46 (gpsd json) with that version. Not really needed, just don't spend time trying.

gpsd do support SkyTraq binary format, so if your run into any issue, make sure which protocol it's really using before trying to debug it. "cgps" can help you there.
tkamiya:
I thought it was putting out NEMA.  "cgps" shows ascii string is some sort of tagged format.  Is this JASON? 

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqklqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x    Time:       2021-12-12T20:44:36.000Z   xxPRN:   Elev:  Azim:  SNR:  Used: x
x    Latitude:    28.600000 N               xx  16    81    342    45      Y   x
x    Longitude:   81.400000 W               xx   4    53    322    46      Y   x
x    Altitude:   144.4 ft                   xx 138    46    225    44      N   x
x    Speed:      0.0 mph                    xx  26    44    038    46      Y   x
x    Heading:    244.4 deg (true)           xx  27    38    152    47      Y   x
x    Climb:      0.0 ft/min                 xx   3    34    240    43      Y   x
x    Status:     3D FIX (74 secs)           xx 133    29    246    46      N   x
x    Longitude Err:   +/- 8 ft              xx  22    24    217    40      N   x
x    Latitude Err:    +/- 9 ft              xx  31    22    075    40      Y   x
x    Altitude Err:    +/- 30 ft             xx   8    19    180    30      Y   x
x    Course Err:      n/a                   xx   9    17    319    37      Y   x
x    Speed Err:       +/- 12 mph            xx  32    01    138    00      N   x
x    Time offset:     1.005                 xx                                 x
x    Grid Square:     EL98gq                xx                                 x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
{"class":"PPS","device":"/dev/ttyS0","real_sec":1639341870, "real_nsec":0,"clock_sec":1639341870,"clock_nsec":4865140,"precision":-20}
{"class":"TPV","device":"/dev/ttyS0","mode":3,"time":"2021-12-12T20:44:30.000Z","ept":0.005,"lat":28.600000000,"lon":-81.400000000,"alt":44.000,"epx"
:2.646,"epy":2.771,"epv":9.200,"track":244.4000,"speed":0.000,"climb":0.000,"eps":5.54,"epc":18.40}
{"class":"PPS","device":"/dev/ttyS0","real_sec":1639341871, "real_nsec":0,"clock_sec":1639341871,"clock_nsec":4866205,"precision":-20}
{"class":"SKY","device":"/dev/ttyS0","xdop":0.71,"ydop":0.74,"vdop":1.60,"tdop":1.30,"hdop":0.90,"gdop":2.51,"pdop":1.80,"satellites":[{"PRN":16,"el"
:81,"az":342,"ss":45,"used":true},{"PRN":4,"el":53,"az":322,"ss":46,"used":true},{"PRN":138,"el":46,"az":225,"ss":44,"used":false},{"PRN":26,"el":44,
"az":38,"ss":45,"used":true},{"PRN":27,"el":38,"az":152,"ss":47,"used":true},{"PRN":3,"el":34,"az":240,"ss":43,"used":true},{"PRN":133,"el":29,"az":2
46,"ss":45,"used":false},{"PRN":22,"el":24,"az":217,"ss":40,"used":false},{"PRN":31,"el":22,"az":75,"ss":41,"used":true},{"PRN":8,"el":19,"az":180,"s
s":28,"used":true},{"PRN":9,"el":17,"az":319,"ss":37,"used":true},{"PRN":32,"el":1,"az":138,"ss":0,"used":false}]}
{"class":"TPV","device":"/dev/ttyS0","mode":3,"time":"2021-12-12T20:44:31.000Z","ept":0.005,"lat":28.600000000,"lon":-81.400000000,"alt":44.000,"epx"
:2.646,"epy":2.771,"epv":9.200,"track":244.4000,"speed":0.000,"climb":0.000,"eps":5.54,"epc":18.40}
{"class":"PPS","device":"/dev/ttyS0","real_sec":1639341872, "real_nsec":0,"clock_sec":1639341872,"clock_nsec":4867045,"precision":-20}
{"class":"TPV","device":"/dev/ttyS0","mode":3,"time":"2021-12-12T20:44:32.000Z","ept":0.005,"lat":28.600000000,"lon":-81.400000000,"alt":44.000,"epx"
:2.646,"epy":2.771,"epv":9.200,"track":244.4000,"speed":0.000,"climb":0.000,"eps":5.54,"epc":18.40}

Right now, I'm showing this too:
# ntpq -np
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
x127.127.28.0    .GPS.            0 l    1   16  377    0.000  -215.86   6.976
x127.127.22.0    .PPS.            0 l   15   16  377    0.000   -4.836   0.043

----- rest omitted ----

I had this working for few months before I lost a hard disk.  So I'm trying to re-install this.  Something is awfully off.  How do you know NTP so much?  Are you part of development team?

By the way, this is inside my firewall.  I have no intent to open up to the whole world.
jav:
No, I'm not part of the development team. I just put quite some work fine-tuning it and had to write some patches :-)

If you updated your system when your disk crashed, you may be dealing with new features (and bugs) that you didn't have before. I've upgraded from Debian buster to bullseye and took me some time to fine-tune it back again.

So, being so much off isn't the issue right now as it needs to settle down. You can use "gpsmon" for a more "raw" output. You'll get a line with device details. In my case:

{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyAMA0","driver":"u-blox","subtype":"SW ROM CORE 3.01 (107888),HW 00080000","subtype1":"FWVER=SPG 3.01,PROTVER=18.00,GPS;GLO;GAL;BDS,SBAS;IMES;QZSS","activated":"2021-12-12T:30:14.575Z","flags":1,"native":1,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00,"mincycle":0.02}]}

The "driver": "u-blox" is what you're looking for.

Two things to do now:

1.- Make sure that the pps signal is working. If you're using kernel pps, use "ppstest /dev/pps0"
2.- Keep looking at the jitter of the GPS line. It should keep at that level (or below).

If both of them are fine, ntp should remove the falseticker ("x") from both lines and begin steering the clock to the PPS. Once it's there, you can fix the GPS offset using the time1 parameter: Take a bunch of samples for the GPS offset, average them and put the resulting value in time1 (change sign and divide by 1000).

If the falseticker stays there, there's some issue with the data delivered from gpsd: Missing messages, fluctuating times or wrong data. In that case, "ntpshmmon" will help you understand the data delivered to ntp. It should be nicely periodic (don't worry about the -215 ms offset as long as it doesn't fluctuate much). If there's something wrong there, you'll need to analyze the messages from gpsd using "gpsmon".
Halcyon:
Unless you specifically wanted to share your exact home address with the rest of the world, I've modified your last post (in bold) to remove your exact coordinates. Feel free to change it back if this was your intention.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod