dr-mod/pico-solar-system

Version without RTC?

callimero opened this issue · 3 comments

I thought I can hack it to work without RTC.

Maybe use some checks and then use a time/date from the Python file.

BTW: The program runs fine from my pico-display-browser https://github.com/callimero/rp-pico/blob/main/picodisplay/ls.py

but crashes (needs reset) when I start it from Thonny.

Console is not helpfull:

`MicroPython v1.15 on 2021-05-20; Raspberry Pi Pico with RP2040

Type "help()" for more information.

%Run -c $EDITOR_CONTENT
(2021, 8, 6, 11, 12, 0, 4, 218)
1628248320
Traceback (most recent call last):
File "� �
`

Hi, I haven't used the Thonny IDE, thus won't be able to help out in terms of it.
As for Pico Solar System working without RTC, the only time the RTC module is used is during the initialization of the clock to set the internal timer:

set_internal_time(ds.read_time())

If I understand what you want to acheive correctly and you were to remove the RTC module from the equation and save the current time to flash each second, your clock would be off by the amount of time it's been powered off.

If you have saved all of the files (main.py, planets.py, pluto.py) and then comment out the following lines in main.py:

    import ds3231

    ds = ds3231.ds3231()
    set_internal_time(ds.read_time())

main.py should run when you press -D in the Thonny shell to perform a soft reset and the board will execute main.py. You can then press -C to interrupt the running program and return back to the Thonny shell.

image