victronenergy / venus

Victron Energy Unix/Linux OS
https://github.com/victronenergy/venus/wiki
593 stars 75 forks source link

Date and time is not written to hwclock when changed in gui #394

Closed mpvader closed 5 years ago

mpvader commented 5 years ago

Because of that, offgrid users will not be able to change the date and time; unless they do a reboot after making the change.

Complaint came via Islam; helpscout #1647. Verified by Matthijs on both v2.18~1 and v2.22.

Gui code is here: https://github.com/victronenergy/gui/blob/master/qml/PageTzInfo.qml

Note that I dont know if and why it was or is a good idea to use connman for changing the clock(s).

The only other way that the clocks are changed is by ntp, via connman. And there we have a patch on ntp.c (only) that syncs the sysclock to the hwclock upon change.

mpvader commented 5 years ago

Connman code is here: https://git.kernel.org/pub/scm/network/connman/connman.git/tree/src/clock.c

and in the end it simply uses this: https://linux.die.net/man/2/settimeofday