-
Notifications
You must be signed in to change notification settings - Fork 1
Raw ntp #1
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
Raw ntp #1
Conversation
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.
Thanks for picking this up! Did you verify this works with ESP32SPI still?
@tannewt Sorry, no I did not, I called that out. I don't have any way to test that. |
For posterity... the way the check for the epoch fails on esp32s2 looks like this: time.localtime(0)
OverflowError: timestamp out of range for platform time_t There is a reference to time_t in the IDF docs I didn't fully grasp: |
I couldn't get the esp32spi example to work:
Just a note too... I think it's apparent, but use of UDP for NTP on esp32-s2 is a new model from released esp32spi, which exposed the low-level IDF If I try using an esp32spi socket instead of socketpool, I get:
I think UDP is enabled only for esp32s2 currently. So I suspect that if we are to support both at this time, two different flows are needed in the library. I think I recall that UDP is possible in ESP32SPI, but it's kludgy due to the way NINA is implemented. The other change in this NTP library API is elevating RTC updates from the library to the user. (How do we manage breaking changes in libraries when they are in between major circuitpython releases?) |
Gotcha, so more work will be needed to do a full library for CP overall. |
hey folks, I've been trying this branch and things were working great until CircuitPython 6.1.0. But, not there seems to be some issue with reading from the socket, and the ntp call throws an EAGAIN. I'm not necessarily asking any of you for help. Just letting you know that this code is breaking on new releases of Circuitpython for me on an ESP32S2 board. Let me know if I can provide any more information. |
I was also getting |
@anecdata I tried setting the socket timeout as well. and it did not fix the issue. I also tried replacing the hostname with a resolved ip address, that did not fix anything either. I can try later to make another UDP request, and see if I can locate the issue. |
Based on this adafruit#16 I'm closing this PR. |
Picking up on the work by @tannewt (who did the hard part) this PR has the following:
time.gmtime()
withtime.localtime()
ntp_simpletest.py
which will works on esp32s2 boards (those with native wifi)ntp_simpletest.py
tontp_simpletest_cpython.py
Tested:
Not Tested: