Make time setting page
Closed this issue · 14 comments
We need to deal with time setup, at the end it's watch we are dealing with :-)
Will contain:
- Manual time set (using https://docs.lvgl.io/v7/en/html/widgets/spinbox.html)
- Manual date set (using https://docs.lvgl.io/v7/en/html/widgets/calendar.html)
- Checkbox "Sync with Signal K server" - will take time from Welcome message after new connection with SK is established - will be off by at maximum few seconds
- 24 hour format toggle - default will be 12 hour format
- Set and save timezone (for use with "get time from server", below)
Manual time setup works in current code. Will focus on date and sync check box.
Date time picker works, now user can select and update date in Time settings menu.
Now I need to make toggle "24 hour format" to allow 12 hour or 24 hour time format.
@ba58smith do we want or need the NTP time sync from internet or rpi?
It would be a nice feature to get the time from the Internet, if the 'net is available. Not from the pi, however. Pi's don't have an internal battery that maintains time, so if you have to reboot your Pi when you don't have Internet (like when you're at sea), the Pi won't have the correct time. (Unless you have an add-on battery to power the clock.) Ask me how I know this!
Yeah, mine RPI have RTC connected with battery so it has correct time after reboot, also RPI does have GPS and my SK server is configured to update the time. So after all RPI might be good source of time more than less, at least in my case :-)
I need to do that! (Set it up so the time comes from GPS.) Do you have a GPS directly connected to the Pi, or do you have some other way to get the GPS time to the Pi?
Yes, I had USB GPS connected and Signal K have this plugin for sync GPS time with RPI system:
https://www.npmjs.com/package/@signalk/set-system-time
Just install it, enable it and when GPS get's fix it will set the system time of RPI.
@JohnySeven, it seems that the only use of the timezone is to automatically set the time on the clock if it's connected to wifi / Internet, correct? (Then it can use NTP to get the time automatically.)
Yes, that's correct, the zone is used mainly for automatic synchronization from NTP and maybe from SK server - need to check if the time in welcome message is in UTC or local (from RPI perspective) time.
"...the time in the welcome message..." of what? The SK Server?
Yes, when websocket is connected to server SK will send welcome server with timestamp.
As #18 was merged, I've checked Set and save timezone (for use with "get time from server", below) task. Thanks!
Moved NTP support into #40, other than that all is done here! Thanks!