InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.71k stars 926 forks source link

[Bug]: Clock persistence fails when watch is without battery for a long time #741

Closed adocampo closed 2 years ago

adocampo commented 2 years ago

What happened?

Watch ran out of battery at night when sleeping and when I charged in the morning time and date was reset

What should happen instead?

Time and date should be persistent, no matter the time the watch is without battery

Reproduction steps

I went to sleep with which I thought it has enough battery, but I was wrong. I guess in the middle of the night it powered off , and when I awoke, and charged it back, the time and date was completely forgotten and I had to re-pair again to get the current time and date. So it seems if you let the watch battery empty for a few hours (I don't sleep more than 6h a day), it misses the clock persistence.

More details?

I'm exhausting the battery again to try to reproduce the error once again. But it will last 5 o 6 days more, so if anyone of you are running out of battery, perhaps can do the test before.

Version

1.6.0

Companion app

GadgetBridge/Siglo

Riksu9000 commented 2 years ago

The persistence only works on restarts. If the PineTime is without power, it can't tell if time has passed, so there's no way to show the correct time without resyncing.

adocampo commented 2 years ago

Oh, this is disappointing... I was expecting the persistence to be really "persistent". If at least re-syncing worked well it won't be so frustrating, but it doesn't re-connects to GB automatically (in fact, 95% of the time it's disconnected from the phone, it loses BT connectivity and never re-connects back), but it must be deleted from GB, restarted and re-paired. I wonder how other smartwatches accomplish this, on Pebble I ran out of battery many times, and it showed the time and date just fine after powering it on back. On it, synchronization with the phone was rock solid, but I didn't notice any problem with the date, and I couldn't remember any occasion I turned it on out of the reach of the phone, but I would swear I did several times as I'm not the guy who lives looking at the phone constantly and many times I don't even know where the damn device is.

Avamander commented 2 years ago

Closed as it's an inevitable result of not having any power.

Riksu9000 commented 2 years ago

@adocampo Most devices "power off" before the battery is completely drained. InfiniTime doesn't do this currently, but the proposed "off mode" in #341 could possibly be used for something similar.

adocampo commented 2 years ago

@Riksu9000 That would be a nice feature, powering off before battery gest exhausted, so this and other possible features which needs persitance (like alarms, for instance) can be saved!

geekbozu commented 2 years ago

Yeah the persistence mechanism only stores it onto volatile memory. So once the device truly powers off it is lost, just like the rest of the contents of SRAM It is done this way to prevent excessive wear on the flash.