sys/net/sntp: migrate from xtimer to ztimer#21633
Conversation
|
Do we really need microsecond precision for that? Wouldn't |
|
To be honest: I don't know 🤷 |
|
Indeed RFC 5905 only mentions millisecond accuracy, so it indeed seems overkill to allow for microsecond precision here. However, the current implementation indeed gives microsecond accuracy so it is out of scope for this PR to change it IMO. A follow-up could introduce a millisecond precision (pseudo)module and deprecate the old API to be removed following the usual deprecation process. |
Well this PR changes from |
The abstract
|
|
RIOT/sys/include/net/ntp_packet.h Line 49 in ded438b should be maybe you can fix that |
Sure, but the xtimer was also power-consuming wasn't it? I would only say this is strictly in scope of this PR if it would introduce a (power consumption) regression. That said, I wouldn't mind having the change to millisecond precision in here already :) |
|
I had to put this on the backburner for some time. |
|
Changing from Microsecond to Millisecond precision would also require an API extension (because |
|
I agree that moving to milliseonds is out of scope. There actually is another benefit in moving to milliseonds: Better frequency stability of RTT compared to If we were to e.g. sync only a few times a day, using |
|
I'm personally fine with either adding a note that SNTP is not power efficient / accurate, or merging as is. Hopefully someone can find time soonish for the us --> ms shift. |
Contribution description
The
sntpmodule still uses the deprecatedxtimer. This PR migrates it toztimer64.Testing procedure
Testing is a bit non-trivial because RIOT can't access internet-based NTP servers (I think?) and systemd has an integrated NTP client, which does not act as an NTP server itself.
Therefore you have to install the good old
ntpdand run it assudo. Also a tap-network has to be setup of course.The output should look something like this. In the build log, you should see
ztimer64instead ofxtimerand the output ofntpdateshould be pretty much the same.Issues/PRs references
Progress for tracking issue #13667.