Open tedder opened 1 month ago
What board are you running this on? A few small ones don't have long int support (where ints are allocated to the heap.)
It's the qtpy esp32 s2 running 9.x:
Adafruit CircuitPython 9.0.4 on 2024-04-16; Adafruit QT Py ESP32S2 with ESP32S2
Board ID:adafruit_qtpy_esp32s2
UID:[..]
Not sure if it's helpful, but:
>>> g=2147483640
>>> print(g)
2147483640
>>> g+=90000
>>> print(g)
2147573640
>>> print(type(g))
<class 'int'>
Also confused why it works some of the time. seconds
is the only value that changes in that _monotonic_start equation, I'd think.
Try printing seconds. I wonder if the struct unpack is causing the issue.
since the failure is intermittent, I'm not sure if/when I'll be able to catch it. For now, here's the type and value:
<class 'int'> 3930136863
ooo, I got one.
<class 'int'> 3930141298
<class 'int'> 0
OverflowError: overflow converting long int to machine word
Note that's two calls, the second one failed.
sending two PRs.
It's possible there's a better fix to the root cause, but these turn it into a known problem, at least.
After less than 24hrs, datetime() seems to fail right now. I haven't debugged what's causing it, though it seems to be from
self._monotonic_start
.Here's a link to the current version of the file: https://github.com/adafruit/Adafruit_CircuitPython_NTP/blob/4a5775a3d972ed9686bfde3b588c399f8e270c4d/adafruit_ntp.py#L97