SmittyHalibut/EleksTubeHAX

feature request: ability to set ntp source

pedrompcaetano opened this issue · 1 comments

Hi,

Please be gentle as I'm not a developer, only a curious tinkerer :-)

I've taken my time reading the ntpclient source, and I've modified NTPClient.h to point ntp requests to a local ntp server, and it just works!

How hard would it be to fetch ntp-server value from the dhcp lease and use it on NTPClient? (it is a standard dhcp option 042)

Thank you for your time,
Pedro

Man, are other software maintainers so bad that people have gotten so flinchy filing tickets? Don't sweat it, you're good. Thank you for filing the request. 😃

That's a fantastic idea. I have no idea whether it's possible. 😆

This is using Arduino's built-in WiFi library: https://www.arduino.cc/en/Reference/WiFi . A quick poke around that documentation, I didn't find any way to get at DHCP options.

WiFi.begin() is what does the DHCP dance, and it automatically configures the stack. We don't do anything other than call .begin().

WiFi.localIP(), WiFi.subnetMask(), and WiFi.gatewayIP() will return those values, which all come from DHCP. So it seems likely that WiFi could be relatively easily enhanced to do this, but it does mean modifying the foundational WiFi library.

Read: It's not a quick-and-easy feature to add, unfortunately.

Possibilities:

  • There may be an undocumented feature that I don't know about. If anyone knows of this, please educate us. :-)
  • There may be an alternate to Arduino's WiFi library that can do this. I'm not aware of anything like this. Again, if anyone knows of this, please educate us.
  • I'm pretty sure Arduino take pull-requests to add backwards compatible features to their foundational libraries. I don't have the resources to do this right now, but if someone else does, have at it; I'd be happy to help test.

If anyone has any input on these, please re-open this ticket.

Sorry. I wish I had a better answer for you. :-/