-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: time incoherent in Badger2040 clock.py #449
Comments
I'm not sure if your aware, but the RTC on the RP2040 doesn't have any onboard battery backup. On a stock Pi Pico it doesn't anyway. If you remove power it will reset to its default start time. I was having a similar experience when the battery died in my RV3028 RTC breakout. It's what i'm using on a Pi Pico setup that I wanted accurate date time on. |
Indeed there is no RTC battery backup, so this cannot be fixed in software Making seconds reset to zero is doable, though, for what little help that is. |
I will clarify: I mean that setting the time in the clock app, pressing "B" to clear the cursor, pressing "A"+"C" to return to the launcher, and launching the clock app again, the time isn't restored in the app. It starts again from 12:00:00 A 18650 LiPo, fully charged, is attached at all times. Since launching the clock app from Thonny shows the correct time, I know the RTC is set and time is running. Pressing "Reset" on the Badger2040 and launching the clock from the launcher fails to show the time from the RTC. At this point, the Badger2040 is still attached to the Pi. Once set, time is always wrong when restarted from the launcher, but good when started from Thonny. The clock app, when launched from any place, is expected to retrieve the time from the RTC and display it, but depending on where it's launched from, doesn't and this is the incoherence. I am well aware of the RP2040 dependence on a power source to maintain the RTC, thus the attached LiPo. Martin Boissonneault, |
The catch is that Badger 2040 doesn't rely on the not-great sleep states of the Pico, but rather cuts the power entirely. Connected battery or not, it'll lose the time since it's truly off. The buttons actually trigger the power being turned back on, in addition to being readable by the RP2040. Rather ingenious save this one unfortunate side-effect. Thonny quietly sets the clock in the background from the host PC. |
I suggest this caveat be mentioned in the clock.py source then :-) Thanks, |
Agreed! |
Badger 2040 and Badger 2040 W now live here: https://github.com/pimoroni/badger2040/ Closing this issue to keep Badger 2040 to its new home. Have made a note to look into it. |
I've edited the font used by the clock.py example to "sans" and saved it back to the root of the Badger2040. It starts correctly, but it resets to the default time on every start, even if previously set. If I manually start the modified clock.py from Thonny, the time is correctly shown, confirming that the time was correctly set previously.
EDIT: I've deleted the clock.py from the Badger and the behaviour persists.
Badger 2040 using pimoroni-badger2040-v1.19.2-micropython.uf2
clock.py = b78b292
Bonus question: Can the seconds be made to reset to "00" if selected? This would allow for accurate time setting :-)
The text was updated successfully, but these errors were encountered: