Closed jdimpson closed 2 years ago
(I don't think I connected the PR here correctly. Still new at this.)
Ah, in your PR, you can say "Fixes #1234" or whatever the number is, and then it will automatically link and close the issue when you merged. Something to try next time. :-)
Closed via #24
I've been running this on a qt-py-esp32-s2 for a couple days and had intermittent random code failures. It turns out that very occasionally the NTP response wasn't coming back within
socket_timeout
seconds, which manifested as anOSError
exception that caused mycode.py
to exit. Took a while to recreate but fairly obvious how to fix.In order to save others the time of having to recreate the problem in order to witness it in the REPL, I'd like to add some words to the inline documentation about both how 1) accesses to
ntp.datetime
are what cause the NTP request to be sent, and therefore 2) accesses tontp.datetime
may throw anOSError
exception, which should be caught and handled appropriately. I will (attempt to) open a PR with these changes.Thanks for making this NTP code. It was just what I needed for my project!