On Wed, Dec 15, 2021 at 12:52:46PM -0800, Thangalin wrote: > When you mention "chronyc commands", do you mean we can send UDP messages > to chronyd that are equivalent to the chronyc commands (so we needn't > execute the chronyc binary)?
Yes. > When you wrote about "chrony's own protocol", does that mean we can't use a > Java-based NTP client that sends UDP messages to extract the information we > need? I guess you could use the normal client-server mode of NTP and check the refid, reference time, and root delay+dispersion instead of the chrony-specific tracking command, but the resolution of the root delay+dispersion is only 15 microseconds. > Here's my understanding of how this could work: > > 1. Java initializes Apache NtpClient (uses NTPUDPClient.java) If that is https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ntp/NTPUDPClient.html that should work the same with chrony as with ntpd, but it doesn't seem to provide the data I mentioned above. BTW, chronyd sets the maximum and estimated errors for ntp_gettime(), but there won't be anything with the PPS signal. > 2. Java sends a NTP/UDP message to chronyd to get PPS lock status. I don't see how would that work. > 3. Java sends a NTP/UDP message to chronyd to get PPS signal loss status. > - Requires configuring the polling interval to 1 second (e.g., > /etc/chronyd.conf?). Same here. > 4. Java sends a chrony/UDP message to chronyd to get PPS estimated > error via REQ_TRACKING command. > 5. Java receives a UDP message from chronyd that includes the > current_correction, root_delay, and root_dispersion. > 6. Java computes the threshold using: > - fabs(current_correction) + root_delay / 2 + root_dispersion The rest looks ok. > - Where do we read the PPS signal loss status? (What struct, what field?) You can check only reachabilty of the source (the "reachability" field in RPY_Source_Data). > - Is there documentation (not a header file) that describes the fields Just the header file. -- Miroslav Lichvar -- To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the subject. Trouble? Email listmas...@chrony.tuxfamily.org.