Port-sparc archive

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

Re: DCD as an alternate /dev device?



On 8/24/2011 01:01, Alexander Carver wrote:
So I think I'm almost to a solution for the PPS issue with ntpd. I
actually got the PPS refclock working but I can't use it with the GPS
refclock.

One person mentioned that on his system running FreeBSD (on a Soekris),
the TX/RX portion of the serial port is cuad1 (symlinked to /dev/gps0)
but the DCD signal is on some type of GPIO (in his case elan-mmcr
symlinked to /dev/pps0). However both of them point to the same physical
serial port.


Is there something similar in NetBSD?


A bit of extra information:

The system has /dev/ttyb symlinked to /dev/pps1 and /dev/gps1.

The current configuration of ntpd 4.2.6p3 (compiled from source) has:

#Pool NTP
server          us.pool.ntp.org prefer
server          us.pool.ntp.org prefer

#PPS_ATOM refclock flag2 DCD clear, flag3 kernel PPS
#opens /dev/pps1
server          127.127.22.1
fudge           127.127.22.1  flag2 1 flag3 1 refid PPS

This segment gets added if I try to use the GPS data as a clock:

#GPS_NMEA refclock mode 1 $GPRMC only
#opens /dev/gps1
server         127.127.20.1  minpoll 4 mode 1 noselect
fudge          127.127.20.1  time2 0.245 refid GPS


Adding the GPS_NMEA refclock kills PPS entirely. It seems they're both trying to access the serial port simultaneously although PPS_ATOM only wants to see DCD and GPS_NMEA wants TX/RX.

From some of the discussions on the ntpd list it appears that there should be an ability to open the port twice. However, the discussions it also appears that the port is actually split in two pieces by the underlying OS. The TX/RX is available via one device and the signals (especially DCD) is available by a separate device. One user commented that FreeBSD happens to perform this breakout.

I'm seeing the PPS_ATOM clock transmit something each second when it's actually working and I will need to investigate that. But, other than that, I'm told that having both GPS_NMEA and PPS_ATOM pointing to the same physical port is common and normally works fine. But in this case something is getting it stuck.

As of right now, I have enabled only PPS_ATOM and left GPS_NMEA fully disabled. I would like to have GPS_NMEA working again so that I can always have some type of clock data even if the network to the other servers dies. I'm just failing to understand why the two aren't working with each other when it is apparently a fairly common configuration.

NB: It seems that dual access to a single port is also the behavior when the GPS_NMEA refclock has its PPS code activated (via flag3 for kernel PPS). The PPS code tries to access the port again even though it's already open for GPS data. Consequently the GPS data goes through but the PPS data via the kernel or direct dies.

Home | Main Index | Thread Index | Old Index