QUERY · ISSUE
utime.sleep_us() overflow
docs
>>> from utime import sleep_us
>>> sleep_us(24*3600*1000_000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: overflow converting long int to machine word
It's not documented about any limits on the argument. Either fix in documentation or fix. Fixing is better.
CANDIDATE · ISSUE
utime.sleep(24*3600) sleeps only 500 seconds on ESP32
bugport-esp32
MicroPython v1.19.1 on 2022-06-18; ESP32 module with ESP32
boot.py:
from utime import sleep, time
while True:
print(time())
sleep(24 * 3600 - 499) # without - 499 will print every 500 seconds
will print a line roughly at every 1-2 seconds:
1
2
4
6
7
9
11
...
I guess, it's overflow+wraparound issue.