xblax / flashforge_ad5m_klipper_mod

Unoffical mod for Flashforge Adventurer 5M (Pro) 3D printers to run Moonraker, custom Klipper, Mainsail & Fluidd
GNU General Public License v3.0
82 stars 4 forks source link

klipperscreen: Timezone settings to show the correct time on the clock #75

Closed consp closed 2 months ago

consp commented 2 months ago

See #74

xblax commented 2 months ago

Timezone data should be enabled in Buildroot with default UTC. Also for the base variant then to keep it consistent, not only klipperscreen.

I guess it could be configured via the user overlay - maybe we can also make the setting persistent.

consp commented 2 months ago

I guess it could be configured via the user overlay - maybe we can also make the setting persistent.

You can set TZ but that will have no effect on the clock afaik without a form of time control daemon. UTC is indeed the default but that's since nothing has been set (always defaults to utc since that's what the fake RTC runs at).

At least date does not care about it.

xblax commented 2 months ago

Afaik timezone is supported by the Kernel and just needs some user-space initialization to set the correct time zone after boot. I think the configuration is usually just manged by a symlink to the correct timezone file.

The fake-hwcloc should be kept in UTC (not in local time).

consp commented 2 months ago

The fake-hwcloc should be kept in UTC (not in local time).

True, but I was expecting date to respect TZ info. But since the TZ_INFO and the TZDATA packages is not installed it won't. I'll add them and see it helps, could add a symlink in the user config to a symlink in /usr/share/zoneinfo which again symlinks to /etc/localtime. Changing the symlink in the user config dir will alter the timezone in that way.

consp commented 2 months ago

Including TZ_INFO fixes the system ignoring the timezone. I'll add a method to alter the timezone via klipperscreen.

consp commented 2 months ago

Fixed in ec36f16, needs https://github.com/xblax/flashforge_adm5_buildroot_chroot/commit/54e4982f1bc4664721e5f0f01526d30d2ddbf75e to function and https://github.com/xblax/flashforge_adm5_klipper_mod/commit/48384a80fc2b8487fe8fea567f60ced8c10a71e7 to let klipperscreen handle timezone setting in the klipperscreen settings menu.

The feature/timezone branch should be mergable without any effect (UTC is still the default)

xblax commented 2 months ago

Looks good. Pushed this change to the master branches.