MicroPython on the Pico W doesn't (or shouldn't) reset every 24 hours. Maybe your code is causing the reset?
All of the time.ticks* functions roll over. If you use them for any time sums, be aware you need to use the special ticks_add() and ticks_diff() functions.
If you're needing timestamps for a log and you're connected to a network, the ntptime module will set the Raspberry Pi Pico W's RTC.
You can install ntptime using:Then use it something like this:This will print something like:RTC.datetime()'s return value is an 8 item list, (year, month, day, weekday, hours, minutes, seconds, subseconds). That might work better for you.
All of the time.ticks* functions roll over. If you use them for any time sums, be aware you need to use the special ticks_add() and ticks_diff() functions.
If you're needing timestamps for a log and you're connected to a network, the ntptime module will set the Raspberry Pi Pico W's RTC.
You can install ntptime using:
Code:
mpremote a1 mip install ntptimeCode:
import machineimport ntptimer=machine.RTC()print(r.datetime()) # before clock is setntptime.settime()print(r.datetime()) # after clock is setCode:
(2021, 1, 1, 4, 0, 7, 28, 0)(2025, 4, 15, 1, 18, 41, 2, 0)Statistics: Posted by scruss — Tue Apr 15, 2025 6:56 pm