cyberman54 / ESP32-Paxcounter

Wifi & BLE driven passenger flow metering with cheap ESP32 boards
https://cyberman54.github.io/ESP32-Paxcounter/
Other
1.73k stars 404 forks source link

Set the time manually via rcommand (LORA) #958

Closed TomRottler closed 1 year ago

TomRottler commented 1 year ago

I guess, to set the time manually via rcommand (LORA) mytimesource == _set in line 137 is needed.

cyberman54 commented 1 year ago

This is intentionally.

An external RTC shall be a precise timesource. Thus, it shall only be synched if we have a precise time.

Precise time sources are LORA and GPS, because we can achieve reliable accuracy +/- 1 second from it.

Time set manually by uploading a UTC value as payload on the LORAWAN channel has no deterministic accuracy. That's why it is not used to sync an external RTC. But it is used to sync the internal RTC of ESP32, so a manually set time will persist over sleep periods.

TomRottler commented 1 year ago

ok, I understand. Thanks for your explanation. I was not sure why the remote time set option ignored an external RTC set. For our very special use case with low power management we cannot be sure to have the ESP RTC running in any case, The accurate time is not a must for us and we will follow internally with our concept because GPS and LORA are not available continuously.

cyberman54 commented 1 year ago

@TomRottler Feel free to fork this piece of open source software and taylor it to your specific use case needs!