ropg / heltec_esp32_lora_v3

Proper working Arduino library for the Heltec ESP32 LoRa v3 board, as well as for Wireless Stick v3 and Wireless Stick Lite v3. Uses RadioLib
MIT License
330 stars 16 forks source link

save RTC Clock #32

Closed jo-ei closed 2 months ago

jo-ei commented 2 months ago

Hi, if I have fetched the current time via LoraWAN and then made it the current system time with setTime, it is reset to 0 after a heltec_deep_sleep().

How can I prevent this and ensure that the system time is retained even after a deep_sleep?

Thanks

ropg commented 2 months ago

It's a bit out of scope for here, but whether you want to use the RTC seems to depend on whether you have an external RTC clock source. Without an added 32 kHz crystal, things are going to be very imprecise as you would depend on the built-in oscillator.

As for how to do this: Google finds various tutorials if you search for "deep sleep" ESP32 RTC