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

Construct NtpClock assuming network is available #24

Closed
denis-stepanov opened this issue Sep 5, 2019 · 4 comments
Closed

Construct NtpClock assuming network is available #24

denis-stepanov opened this issue Sep 5, 2019 · 4 comments

Comments

@denis-stepanov
Copy link
Contributor

I have difficulty understanding the choice to constuct NtpClock with Wi-Fi parameters. In a project which already uses Wi-Fi for other reason (e.g., running a web server), is there a way to create an NTP clock without running a Wi-Fi setup?

Thanks.

@bxparks
Copy link
Owner

bxparks commented Sep 5, 2019

That's a good point. It's because I haven't needed to use the WiFi for anything except for NTP time so far. Do you have some suggestions? Maybe another constructor that does not require the setup() method to be called? I'm happy to look at well-crafted pull requests.

@denis-stepanov
Copy link
Contributor Author

Thanks. I am thinking about constructor with no parameters; other operations should check that Wi-Fi is connected before interacting with the network. With setup() or not, it's worth doing this anyway, because Wi-Fi connection can go away any time. Perhaps, a constructor could take an optional WiFiUDP object, for projects which have already allocated it for their own use.

I'll try to submit something along these lines, but no hard promise :-)

bxparks added a commit that referenced this issue Sep 13, 2019
…t-loop completely if setup() is called with no arguments (#24)
bxparks added a commit that referenced this issue Sep 13, 2019
…fy on ESP32; use SERIAL_PORT_MONITOR consistently; other minor tweaks (#24)
@bxparks
Copy link
Owner

bxparks commented Sep 13, 2019

I made some tweaks and fixes, and pushed them to the develop branch. Things look good.

I'll leave this issue open for now, until I get back from vacation. (Will be unable to respond for a couple of weeks.)

@denis-stepanov
Copy link
Contributor Author

Thanks.

bxparks added a commit that referenced this issue Oct 3, 2019
…t-loop completely if setup() is called with no arguments (#24)
bxparks added a commit that referenced this issue Oct 3, 2019
…fy on ESP32; use SERIAL_PORT_MONITOR consistently; other minor tweaks (#24)
@bxparks bxparks closed this as completed Oct 3, 2019
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