Closed gruenwaldi closed 3 years ago
Confirming that I am also having problems with the time.time() function after upgrading to pycom firmware version 1.20.2.r2 I am using Lopy4 board with time sync over WiFi. Time sync works correctly and the datetime tuple returned from rtc.now() is correct. Subsequent call to time.time() returrns erroneous seconds since Epoch, e.g. 3213659630 (year 2071) or 584485126 (year 1988). After downgraded firmware version to 1.20.2.r1 the returned value from time.time() after time sync is correct.
Could you do me a favor and check your reproduction with the last pygate rc version? It would help narrow down where this was introduced
Hi, the bug was introduced in transition from rc10 to rc11: https://github.com/pycom/pycom-micropython-sigfox/issues/478 However, some other user may have had a related bug already in rc7: https://github.com/pycom/pycom-micropython-sigfox/issues/459
a turnaround is "rtc.init(rtc.now())" at the begining of program. After that time.time() is working
Thank you @didilamken, the workaround works for me! Details in https://github.com/pycom/pycom-micropython-sigfox/issues/478
Unfortunately, the workaround does only work in this special case. I initialize the clock with an external source as rtc.init((2022, 1, 7, 11, 36, 57, 3, 0))
. If I do rtc.init(rtc.now())
before, the rtc.init function does not take any other time value afterwards. This is also a bug in r3. In rc10 it is still working. I will discuss details in https://github.com/pycom/pycom-micropython-sigfox/issues/478
I confirm that rtc.init() is not working on FiPy either since 1.20.2.r2. I use external DS3231 date and time data to init rtc. Works like a charm with r1. With r2 and r3 it might occasionally work on first time after powering up, but defenitely not working after deepsleep (By the way, many sd cards also stop working after deepsleep). rtc.init(rtc.now()) cannot be a solution, because nobody who reads docs cannot figure out this!!
Hi there,
within the release v.1.20.2.r4 (#514), which just happened, the problem described here may have been fixed. See also 120f929b. Thanks, @gijsio and @peter-pycom!
With kind regards, Andreas.
LOL, indeed, @amotl spots it even faster than I'm able to complete the release ;)
All affected, it should be fixed with latest release 1.20.2.r4 - please retest.
I have upgraded my Lopy4 to pycom firmware version 1.20.2.r4. The time.time() function now appears to return correct values after time sync over WiFi.
1.20.2.r1 also worked for me. 1.20.2.r2 did not work. I have not tested 1.20.2.r3.
Indeed, with 1.20.2.r4 the rtc.init() works and time.time() returns correct values.
Please include the following information when submitting a bug report:
I get a succesfull timesync, but then the time is not synced, but time.time() is 30 for example.