Skip to content
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

Only update to the EVSE time if later than the ESP32 time. #222

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

jeremypoulter
Copy link
Collaborator

On making a connection to the EVSE we read the time as the EVSE module may have a battery backed RTC or even just it has remained on during reboot.

However it also may not have a useful time set, eg when recovering from a power cut and no battery backed RTC. In ths case there is a race condition between getting the time from NTP and the time from the EVSE. So now we only set to the EVSE time if it is later than the local ESP time.

This fixes NTP not automatically working #194.

On making a connection to the EVSE we read the time as the EVSE module may have a battery backed RTC or even just it has remained on during reboot.

However it also may not have a useful time set, eg when recovering from a power cut and no battery backed RTC. In ths case there is a race condition between getting the time from NTP and the time from the EVSE. So now we only set to the EVSE time if it is later than the local ESP time.

This fixes NTP not automatically working  #194.
@glynhudson glynhudson merged commit 136e8f3 into master Jul 26, 2021
@glynhudson glynhudson deleted the jeremypoulter/issue194 branch July 26, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants