[time-nuts] GPSDO+PC as a NTP server

Fiorenzo Cattaneo fio at cattaneo.us
Wed Oct 30 20:01:24 UTC 2019


Hmm that is odd. I haven't seen the sio man page, I refer and use the directions in uart man page 

https://www.freebsd.org/cgi/man.cgi?query=uart&sektion=4&manpath=freebsd-release-ports

And set this sysctl variable in /boot/loader.conf (note that the uart man page is also wrong, you can only set pps_mode for specific devices and not for all devices):

dev.uart.0.pps_mode=0x10

To test it without having to reboot, use sysctl command.

Maybe the sio feature has been added recently, IDK, I still use FreeBSD kernel 11.1. What I know for sure is that the sysctl is actually implemented in the code -- see uart_core.c source.


For ntp.conf, I only use the NMEA refclock #20. I always had trouble with the PPS  refclock #22.

https://www.eecis.udel.edu/~mills/ntp/html/drivers/driver20.html

The entry is something like this:

Server 127.127.20.0 mode 17 flag1 1

Mode 17 tells ntpd to process RMC only and use 9600 bps. Default is 4800 bps. If you want to process all supported sentences at 9600 bps, use mode 16.
Flag1  tells ntpd to use PPS. Default is no PPS.
I also set max poll to 4.

If you are still having trouble, you can troubleshoot like this:
* set boot verbose mode in loader.conf, it will print the actual UART pps configuration.
* use cu first to double check that you are using the correct line at the correct speed, for instance:
       cu -l /dev/gps0 -s 9600
If you see NMEA sentences correctly, then you know you have the correct device at 9600bps
* download, build and run ppstest program to make sure PPS is setup correctly.

If you see NMEA sentences, but you don't see PPS, there are two possibilities (1) PPS capture is still set to the default DCD (2) PPS output from GPS receiver is disabled. The latter should not be the case with the GPSDO.


good luck!








-- Fio Cattaneo

Universal AC, can Entropy be reversed? -- "THERE IS AS YET
INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."

> On Oct 30, 2019, at 02:02, Adam Kumiszcza <akumiszcza at gmail.com> wrote:
> 
> 
> HI again!
> 
>> On Wed, Oct 23, 2019 at 9:37 PM Fiorenzo Cattaneo <fio at cattaneo.us> wrote:
>> > 2. I would like to get both NMEA and PPS signal from it on the NTP server.
>> > Currently PPS is on pin 8 (CTS) but according to
>> > http://doc.ntp.org/4.1.1/driver22.htm and
>> > https://www.satsignal.eu/ntp/NTP-on-Windows-serial-port.html it should
>> > rather be on pin 1 (DCD).
>> 
> [...] 
>> (3) use FreeBSD instead, which supports runtime configuration of
>> either DCD or CTS for PPS
>> 
>> I use the latter, as I am big fan of FreeBSD
> 
> I'm trying to make it work on FreeBSD. 
>  
> I put hint.uart.0.flags="0x10000" in /boot/device.hints as per https://www.freebsd.org/cgi/man.cgi?query=sio&sektion=4 (0x10000   PPS timestamping on CTS instead of	DCD). 
> I recompiled the kernel with PPS support.
> My devfs.conf has the following:
> link cuau0 gps0
> link cuau0 refclock-0
> link cuau0 pps0
> 
> But I still don't seem to get PPS (no "o" in ntpq -np). Which driver do you use? 127.127.22.0 or 127.127.20.0 or both? I'm only able to use 22.0, which is GPS_NMEA, but on some webpages it's the only one mentioned after discussing PPS.
> 
> Thanks in advance,
> Adam Kumiszcza



More information about the Time-nuts_lists.febo.com mailing list