Skip to content

ntptime Feature request: Would like to have the ntp server configurable #682

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

Open
hagenbuch opened this issue Jun 14, 2023 · 1 comment
Open

Comments

@hagenbuch
Copy link

The timeserver is hardcoded n ntptime.py:

host = "pool.ntp.org"

I would prefer to have this configurable, for several reasons:

  • There might only be a local network where the node is
  • DNS might not be available in some cases and under some error conditions
  • One might as well use a numeric values
  • Coordinated time might be more important than a real interconnection for embedded devices often involved with logging.

I'm sorry I have no idea (yet) where to start to create a full pull request..

@massimosala
Copy link

Hi Andreas

It isn't hard-coded.

It is weird they don't put the 'host' as a parameter of the function, but you can do this:

import ntptime
ntptime.host = "your choice"
ntptime.settime()

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

No branches or pull requests

2 participants