-
Notifications
You must be signed in to change notification settings - Fork 35
Intermittent hangs in NTP.get_time() #56
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
Comments
I see there was a CP 7.2.4 released last week. I have updated, but it is still flaky:
Updated again:
|
My latest theory on this is that since NTP uses UDP, on occasion the reply may be lost in transit, and the socket is stuck in a loop waiting to read a reply that isn't coming. Coincidentally, I've found a PR that sought to improve Wisnet5k UDP handling, but unfortunately it was opened against a Wiznet demo repository instead of this one. I've applied it locally, and while it doesn't solve the hanging issue, it doesn't seem to cause any ill effects either. I don't fully understand all the changes, but it looks like it's solving a mismatch between the number of sockets available and how the existing library handles tracking UDP globally. |
I've setup a ntpd daemon on my local network, and after running for a few days, this has almost completely eliminated any hanging behavior, vs using |
I'm working with the WIZnet
W5100S-EVB-Pico
. As part of troubleshooting another issue, I wanted timestamps, so I configured NTP. I saw there was no NTP example code, so here is my short example code:This works, often, like so:
However, just as often, it hangs in
NTP.get_time()
:line 294 is
gc.collect()
I've also seen this:
This is a bus_device write. Hard to tell if it was stuck there or just stuck in a busy loop in that vicinity.
I'm using the latest stable CP (as shown in the output above), and latest Wiznet5k library.
The text was updated successfully, but these errors were encountered: