Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PPS source support #1776

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add PPS source support #1776

wants to merge 14 commits into from

Conversation

michielp1807
Copy link
Contributor

@michielp1807 michielp1807 commented Dec 19, 2024

Builds on #1768 to be able to use Pulse Per Second devices in ntpd-rs using the pps-time crate, closing #1633.

Example config:

[[source]]
mode = "sock"
path = "/run/chrony.ttyAMA0.sock"
measurement_noise_estimate = 1e-6

[[source]]
mode = "pps"
path = "/dev/pps0"
measurement_noise_estimate = 1e-14

TODO:

  • Add documentation for using PPS sources in ntpd-rs
  • During testing I noticed it would run into this debug assert when using GPSD. It would probably be good to do some more testing 🙂
  • For some reason (likely precision problems?) things go wrong with low noise estimates (e.g. 1e-14), it does seem to work with a 1e-8 noise estimate -> could this be due to rounding errors with NtpDuration, where to_seconds / from_seconds are not exact?
  • Update ntp-ctl status to also show PPS/Sock sources

@michielp1807 michielp1807 linked an issue Dec 19, 2024 that may be closed by this pull request
@michielp1807 michielp1807 marked this pull request as ready for review January 10, 2025 11:37
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 81.38007% with 170 lines in your changes missing coverage. Please review.

Project coverage is 81.49%. Comparing base (419832f) to head (101704c).

Files with missing lines Patch % Lines
ntpd/src/daemon/pps_source.rs 0.00% 90 Missing ⚠️
ntpd/src/daemon/system.rs 0.00% 24 Missing ⚠️
ntpd/src/daemon/spawn/pps.rs 80.00% 15 Missing ⚠️
ntp-proto/src/system.rs 23.52% 13 Missing ⚠️
ntp-proto/src/algorithm/kalman/source.rs 97.94% 11 Missing ⚠️
ntpd/src/daemon/config/ntp_source.rs 45.45% 6 Missing ⚠️
ntpd/src/force_sync/algorithm.rs 0.00% 6 Missing ⚠️
ntpd/src/daemon/config/mod.rs 0.00% 2 Missing ⚠️
ntpd/src/daemon/spawn/mod.rs 50.00% 2 Missing ⚠️
ntpd/src/force_sync/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1776      +/-   ##
==========================================
- Coverage   81.55%   81.49%   -0.06%     
==========================================
  Files          66       68       +2     
  Lines       20690    21485     +795     
==========================================
+ Hits        16874    17510     +636     
- Misses       3816     3975     +159     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement linux kernel pps reading
2 participants