Closed vladak closed 6 months ago
Before this is done, it might be useful to try running the code multiple times and try to measure the time between the initial start and the time of the safe mode entry due to the internal watchdog timer, ideally with higher precision (minutes/seconds).
To do this reliably, the code that shortens the period based on the battery capacity will have to be disabled.
Looks like the time.monotonic()
gets reset on deep sleep (changed the code to publish both the time.monotonic()
and time.monotonic_ns()
to the MQTT topic and made sure to disconnect the board from USB and performed a reset), so this is likely a false trace.
The
enter_sleep()
uses the imprecisetime.monotonic()
. Consider using something liketime.monotonic_ns() // 1_000_000_000
instead. This might have contributed to the "internal watchdog timeout" issue seen with CP 9.0.0.