Ryzee119 / LithiumX

A simple dashboard, mainly developed for the Original Xbox console, but it can be compiled for Windows and Linux for rapid development and testing.
MIT License
72 stars 8 forks source link

Add SNTP client #14

Closed amak79 closed 1 year ago

amak79 commented 1 year ago

Would you consider adding an SNTP client? My Xbox has the clock capacitor removed and is regularly unplugged, so I have to manually set the date/time when using LithiumX.

Ryzee119 commented 1 year ago

Can you try https://github.com/Ryzee119/LithiumX/pull/15? Artifact binary builds should be here: https://github.com/Ryzee119/LithiumX/actions/runs/3872962495

This pulls time at startup and resyncs the xbox system time. It then updates every 60 minutes thereafter.

Ive also added a clock readout to the system info screen which should offset the timezone and daylight savings time set in MS Dash to display your local time. Let me know if thats correct too.

amak79 commented 1 year ago

I gave it a quick test and it appears to work correctly. The daylight savings is offset properly as well.

Will it be possible to override the SNTP server via dash.xml?

I also noticed the date/time is displayed without a label like other system info. Perhaps if you add "Date/Time:" or "Date and Time:" it will give it a more consistent look.

Ryzee119 commented 1 year ago

Thanks for testing. Yea the plan is to allow the server IP to be configurable.

I'll add the date/time heading too ☺️

InternalLoss commented 1 year ago

Will it just be a server IP? Or will be able to support a host name too (assuming a service like NTP pool also supports SNTP) c:

Ryzee119 commented 1 year ago

I think it should work with DNS lookup but I haven't tested it.

EDIT: Looks like I need to set SNTP_SERVER_DNS to enable this feature.

Ryzee119 commented 1 year ago

Looks like this now image

Also sntp server can now use DNS lookup and is currently hardcoded to "pool.ntp.org". I will make this configurable in the future but its a bit more work.

If you could try again and if ok ill merge. Latest build artifact: https://github.com/Ryzee119/LithiumX/actions/runs/3880965778

amak79 commented 1 year ago

I did another quick test and it's working fine. It looks really nice with the header :grinning:

Thank you very much.

Ryzee119 commented 1 year ago

Merged into master