I'm slightly OCD when it comes to clocks. My wrist watch is one of those "radio time signal" ones. Seeing wall clocks that are the wrong time drives me wild. I just can't take it. "You have *one* job, and you suck at it".
When I was at the conference hotel in Beijing last month, I reacted to how almost *every* clock I saw was off by minutes, sometimes hours. The time display in the elevator? Off by a lot. The time in the room thermostat? Completely random.
So guess what happens with dive computers? I react to them when they have clocks that run slow or fast. My old Uemis would be off by minutes when I hadn't used it in a couple of months, and it was annoying to set the right time, and boy did I notice.
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
And I just wrote the code for that for the Suunto EON Steel. Patch to libdivecomputer attached in case anybody cares (and I was happy to realize that it actually uses milliseconds for synchronization, but then noticed that it may be just a protocol thing, and the extra precision may get thrown away).
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
And yes, I know about "configure dive computer" and the "sync time" hack there. But it's really an ostc-specific hack, not something that can be used in general to synchronize the clock.
Thus the "request for discussion". I'd love to be able to pass in flags like this to dc_device_open() or add a sane "dc_device_set_feature()" interface or something..
Linus
On Wed, Jul 19, 2017 at 11:08 PM, Linus Torvalds torvalds@linux-foundation.org wrote:
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
I do like the idea, but I am hesitant about syncing the time with laptop automatically. That is because it usually takes a few days for me to update my timezone. Even with the manual time sync, it has happened to me once that I synced wrong time to my DC. Also with my tablet, there is no automatic timezone changes so the mobile version might also be missing the correct time.
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
I am thinking about a nagging popup in case we have not been diving in more than a day to remind to set the timezone correctly on computer before syncing the time (if enabled). Or something less annoying for the incompetent people who cannot keep their timezones :D Maybe just a checkbox on the download dialog to enable this feature per DC connection - maybe even remember the setting until no-fly clears.
miika
Sorry for top post.
How about when you tap the button / check the box that enables time since, we open a pop-up with the current time and ask the user to confirm? Yeah, I know. Pop-ups are evil. But this does seem like one of those cases where maybe it's worth it? Because I like the time sync idea.
There is one flaw, though, now that I think about it. Usually you download your dives after a day of diving. They may not be the best time to adjust the time zone...
/D
--
From my phone
-------- Original Message -------- From: Miika Turkia miika.turkia@gmail.com Sent: Wed Jul 19 20:45:03 PDT 2017 To: Linus Torvalds torvalds@linux-foundation.org Cc: Subsurface Mailing List subsurface@subsurface-divelog.org, Dirk Hohndel dirk@hohndel.org, Jef Driesen jef@libdivecomputer.org, devel devel@libdivecomputer.org Subject: Re: [RFD] divecomputer time/date synchronization while downloading dives
On Wed, Jul 19, 2017 at 11:08 PM, Linus Torvalds torvalds@linux-foundation.org wrote:
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
I do like the idea, but I am hesitant about syncing the time with laptop automatically. That is because it usually takes a few days for me to update my timezone. Even with the manual time sync, it has happened to me once that I synced wrong time to my DC. Also with my tablet, there is no automatic timezone changes so the mobile version might also be missing the correct time.
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
I am thinking about a nagging popup in case we have not been diving in more than a day to remind to set the timezone correctly on computer before syncing the time (if enabled). Or something less annoying for the incompetent people who cannot keep their timezones :D Maybe just a checkbox on the download dialog to enable this feature per DC connection - maybe even remember the setting until no-fly clears.
miika
On Wed, Jul 19, 2017 at 8:52 PM, Dirk Hohndel dirk@hohndel.org wrote:
How about when you tap the button / check the box that enables time since, we open a pop-up with the current time and ask the user to confirm? Yeah, I know. Pop-ups are evil. But this does seem like one of those cases where maybe it's worth it? Because I like the time sync idea.
The problem is that we don't even have an interface into libdivecomputer to even say this, and this is all inside libdivecomputer. So no popups, no nothing. We're deep in a library, with no way to ask the user at that point.
Linus
On Thu, Jul 20, 2017 at 6:52 AM, Dirk Hohndel dirk@hohndel.org wrote:
Sorry for top post.
How about when you tap the button / check the box that enables time since, we open a pop-up with the current time and ask the user to confirm? Yeah, I know. Pop-ups are evil. But this does seem like one of those cases where maybe it's worth it? Because I like the time sync idea.
I could live with the popup but it might get annoying if this pops up every time I do the sync during a dive trip.
Linus, this popup would be while selecting the timesync on Subsurface UI, or clicking the download button, depending on how it would be implemented. So not yet in libdc.
There is one flaw, though, now that I think about it. Usually you download your dives after a day of diving. They may not be the best time to adjust the time zone...
Do we get the current time from the DC. If so, we could automatically adjusting the time of the downloaded dives. Or something else cleverness. I have had one DC on incorrect time more than once at the start of dive trip. Wristwatch type DC is always set to local time but the bulky ones that are in hand luggage might get forgotten :(
miika
-- From my phone ________________________________ From: Miika Turkia Sent: Wed Jul 19 20:45:03 PDT 2017 To: Linus Torvalds Cc: Subsurface Mailing List , Dirk Hohndel , Jef Driesen , devel Subject: Re: [RFD] divecomputer time/date synchronization while downloading dives
On Wed, Jul 19, 2017 at 11:08 PM, Linus Torvalds torvalds@linux-foundation.org wrote:
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
I do like the idea, but I am hesitant about syncing the time with laptop automatically. That is because it usually takes a few days for me to update my timezone. Even with the manual time sync, it has happened to me once that I synced wrong time to my DC. Also with my tablet, there is no automatic timezone changes so the mobile version might also be missing the correct time.
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
I am thinking about a nagging popup in case we have not been diving in more than a day to remind to set the timezone correctly on computer before syncing the time (if enabled). Or something less annoying for the incompetent people who cannot keep their timezones :D Maybe just a checkbox on the download dialog to enable this feature per DC connection - maybe even remember the setting until no-fly clears.
miika
On Wed, Jul 19, 2017 at 9:12 PM, Miika Turkia miika.turkia@gmail.com wrote:
Do we get the current time from the DC. If so, we could automatically adjusting the time of the downloaded dives.
I really do *not* want to do that. Why? You may be downloading after your trip, because you were busy, and it's quite possible that your dive computer was in the right time, an dyou're now "correcting" for having moved back to your home time zone, and you go "oops, the dive computer is set for Hawaii time, but I'm obviously in Portland, so all those dives we downloaded obviously are wrong and have to be fixed up".
That's obviously horribly horribly wrong.
So no. Correcting things after the fact is something you'd do manually when you notice that you forgot to change the clock on the dive computer, and then you go and actually edit the dives. But it's *not* something you'd do based on your laptop time vs dive computer time.
have had one DC on incorrect time more than once at the start of dive trip. Wristwatch type DC is always set to local time but the bulky ones that are in hand luggage might get forgotten :(
Right, it happens to me too. I don't think we can fix that, and we already have ways to just edit the dives after the fact when we notice.
So what I want to do, and what I think we *can* do is to make it much easier to just set the time. Usually time and date setting is just pretty damn painful to do manually. So doing it from subsurface is just much easier. You still have to remember to set the time, but at least it's *easy* to do and get it set right to the second.
Particularly with the BLE dive computers and a cellphone, you can even do it on the boat on the way to the dive site. Just initiate an empty download (or another explicit action: the problem really is that we currently don't even have the interface to libdivecomputer to do this at all, so right now my EON Steel patch just always does it at dive computer "open" time).
Linus
On 19-07-17 22:08, Linus Torvalds wrote:
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
And I just wrote the code for that for the Suunto EON Steel. Patch to libdivecomputer attached in case anybody cares (and I was happy to realize that it actually uses milliseconds for synchronization, but then noticed that it may be just a protocol thing, and the extra precision may get thrown away).
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
And yes, I know about "configure dive computer" and the "sync time" hack there. But it's really an ostc-specific hack, not something that can be used in general to synchronize the clock.
Thus the "request for discussion". I'd love to be able to pass in flags like this to dc_device_open() or add a sane "dc_device_set_feature()" interface or something..
How about turning the ostc specific clock sync function into a standard function that is part of the dc_device_t interface? Then every backend that supports setting the time can easily implement it. I'm pretty sure there are more dive computers where the protocol supports this (e.g. the oceanic software has a time sync setting), so I see no reason not to support this as a standard feature.
dc_status_t dc_device_clock (dc_device_t *device, const dc_datetime_t *datetime);
And then it's up to the application to call this function or not. Doing this kind of stuff automatically from within libdivecomputer is probably a bad idea (host clock can be wrong, set to a different time zone, etc).
PS: I'm currently traveling and pretty much offline until next week. It's going to take some more time to answer emails and catch up with everything in my mail box.
Jef
On 2017-07-20 10:08, Jef Driesen wrote:
On 19-07-17 22:08, Linus Torvalds wrote:
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
And I just wrote the code for that for the Suunto EON Steel. Patch to libdivecomputer attached in case anybody cares (and I was happy to realize that it actually uses milliseconds for synchronization, but then noticed that it may be just a protocol thing, and the extra precision may get thrown away).
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
And yes, I know about "configure dive computer" and the "sync time" hack there. But it's really an ostc-specific hack, not something that can be used in general to synchronize the clock.
Thus the "request for discussion". I'd love to be able to pass in flags like this to dc_device_open() or add a sane "dc_device_set_feature()" interface or something..
How about turning the ostc specific clock sync function into a standard function that is part of the dc_device_t interface? Then every backend that supports setting the time can easily implement it. I'm pretty sure there are more dive computers where the protocol supports this (e.g. the oceanic software has a time sync setting), so I see no reason not to support this as a standard feature.
dc_status_t dc_device_clock (dc_device_t *device, const dc_datetime_t *datetime);
And then it's up to the application to call this function or not. Doing this kind of stuff automatically from within libdivecomputer is probably a bad idea (host clock can be wrong, set to a different time zone, etc).
This feature is now available in the master branch! At the moment, the new dc_device_timesync() function is implemented for the Heinrichs Weikamp backends.
Jef
On 19 July, 2017 - Linus Torvalds wrote:
I'm slightly OCD when it comes to clocks. My wrist watch is one of those "radio time signal" ones. Seeing wall clocks that are the wrong time drives me wild. I just can't take it. "You have *one* job, and you suck at it".
When I was at the conference hotel in Beijing last month, I reacted to how almost *every* clock I saw was off by minutes, sometimes hours. The time display in the elevator? Off by a lot. The time in the room thermostat? Completely random.
So guess what happens with dive computers? I react to them when they have clocks that run slow or fast. My old Uemis would be off by minutes when I hadn't used it in a couple of months, and it was annoying to set the right time, and boy did I notice.
Fun fact is that the old OSTC mk2 / 2N / 2C computers has a setting to fine tune the clock in it, so with some trail'n'error you can eliminate most of the skew.
Anyway, what this all builds up to is that I'd actually like to just set the time automatically when I connect the dive computer to my laptop (or my cellphone, for that matter - usually those end up being synchronized to the local time quite nicely).
And I just wrote the code for that for the Suunto EON Steel. Patch to libdivecomputer attached in case anybody cares (and I was happy to realize that it actually uses milliseconds for synchronization, but then noticed that it may be just a protocol thing, and the extra precision may get thrown away).
But I suspect people will hate that patch because it does that time sync thing *unconditionally*. It would be good to have a check-box and some way to actually set the "sync time" flag. But for that to happen, we'd need not just the UI side, we'd need to have the libdivecomputer interface too.
And yes, I know about "configure dive computer" and the "sync time" hack there. But it's really an ostc-specific hack, not something that can be used in general to synchronize the clock.
I almost always verify / update the settings in my dive computers via that feature before a trip, and as a part of that synchronize the clocks.
Thus the "request for discussion". I'd love to be able to pass in flags like this to dc_device_open() or add a sane "dc_device_set_feature()" interface or something..
I'm more inline with Jef here. Why just not make it a standard interface which the different backends can implement?
That way it's easy for subsurface to have a to checkbox (or maybe always) synchronize the clocks.
//Anton