-
Notifications
You must be signed in to change notification settings - Fork 13.3k
lwip2 fixes and time/ntp management #3835
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
Conversation
cores/esp8266/time.c
Outdated
s_timezone_sec = timezone; | ||
s_daylightOffset_sec = daylightOffset_sec; | ||
//s_timezone_sec = timezone; | ||
//s_daylightOffset_sec = daylightOffset_sec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the variables have been removed, can these lines be removed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am i correct to assume that localtime_r and gmtime_r will still return the same result? I.e. libc doesn't know about the timezone offset?
@@ -0,0 +1,96 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a header here explaining what the example does, and the if/endif choices below. Also should include a public domain or cc0 license (like the original Arduino examples).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file also needs to be formatted same way as other sketches. Simple way to do this is to load it into arduino, then use Tools > Format sketch.
Correct: localtime() and gmtime() return both local time with isdst=0 (hence both wrong). So there are currently three bugs:
The example is updated with header, explanation, format and localtime/gmtime tests. |
@d-a-v I updated the branch and restarted travis, but it still fails. The reason seems to be a linker error about undefined reference settimeofday. |
It's because travis links against lwip1.4 where |
I'm afraid we can't update the internal timestamp without modifying lwip1.4 (every useful stuff is static in We can end up with:
|
I have an |
core: +settimeofday() core: +coredecls.h +sntp-lwip2.c core: fix clock_gettime() with micros64() core: honor DST in configTime() core: internal clock is automatically started examples: +esp8266/NTP-TZ-DST.ino lwip2: sntp client removed lwip2: fix crashing with WiFi.softAPConfig(ip,ip,ip) fix esp8266#3852
@igrr PR 3835 is squashed into a single commit |
Interestingly ping_option and ping_resp are declared correctly. |
@d-a-v my only feedback about the ping files: try to keep the lwip directory as clean as possible, so that we have fewer headaches in the future if we ever need to do another migration. In other words, all files not distributed with lwip should probably be put elsewhere. |
@devyte ping may have been distributed in lwip-v1, now it is in their lwip-contrib. |
#1679: sntp is automatically started
#2505: honor DST in configTime()
fix clock_gettime() with micros64()
add settimeofday()
new example esp8266/NTP-TZ-DST.ino
--- lwip2 (mandatory for the above):
the above fixes
remove old and unwanted definitions of millis() and gettimeofday()
fix crashing with WiFi.softAPConfig(ip,ip,ip)