Skip to content

lwip2: stability and time management #3808

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

Closed
wants to merge 3 commits into from
Closed

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Nov 7, 2017

sync with upstream lwip2:
expose sntp_set_system_time() for external RTC without NTP server
fix #1679 (time() works from start)
fix #2505 (honour DST in configTime())
fix lwip2 crashing with WiFi.softAPConfig(ip,ip,ip)

@d-a-v
Copy link
Collaborator Author

d-a-v commented Nov 7, 2017

I found nowhere in the docs where configTime() is mentionned.
I would be worth mentionning sntp_set_system_time() which allows to use an external RTC.
This function has always been existing but was not exposed.

Current version of lwipopts (v2) allows only one ntp server. Should it allows 3 servers (as per configTime()) ?

Also, timezone and DST are only taken into account when sntp_set_system_time() is called, which can happen:

  • by user
  • by configTime() (but takes effect once an IP address is setup )
  • by dhcp client (if dhcp server provides ntp server)

Currently the API does not let the user decide to refuse the ntp server provided by dhcp (ntp was not fed by dhcp with lwip1.4).

@Juppit
Copy link
Contributor

Juppit commented Nov 7, 2017

configTime() filles only the structures in sntp.h
Note that sntp_set_daylight() is still not in sntp.h where it supposed to be.

@d-a-v
Copy link
Collaborator Author

d-a-v commented Nov 7, 2017

You are perfectly right about sntp_set_daylight() missing declaration. I just realized that we have also Wno-implicit-function-declaration in gcc options. We would then have to declare millis(), micros() too. I think this should go to another PR.
This PR is all about lwip2 currently only in master. configTime() calls sntp_set_daylight() which is implemented there.

edit: previous comment fixed about configTime()

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.

configTime and time seem to ignore DST time() does not work without active NTP server
2 participants