Re: some more feedback on the statistics widgets we have

2021-01-12 Thread Peter Zaal via subsurface
On Tue, Jan 12, 2021 at 9:57 PM Dirk Hohndel via subsurface <
subsurface@subsurface-divelog.org> wrote:

> - when closing the statistics on desktop, the dividers aren't restored to
> their previous positions
>   We talked about completely replacing the dividers with something better,
> but I'm not sure if you had time to think about this at all
>

Yes, saw this as well at some point. WIth me it restores to a layout which
is almost the same as my normal layout, so didn't notice it at first.

Additionally, if you don't close the statistics with the Close button, but
choosing another View from the menu there are some issues.
If you select View -> All (Ctrl + 1) it only shows the Dive list and
Profile, the Statistics are in the upper left instead of the Info, and the
Filter is in the lower right instead of the Map.
I think this only makes all 4 parts visible, and does not replace the Info
and Map parts with their respective widgets?
I now see this is the same issue with using the Filter and switching views:
from 'normal' view (all 4 parts Info, Profile, Dive List and Map are
visible), then select Filter. The Map is now replaced with the Filter. If
you select View -> All or View -> Map, then the Map is not shown, but
instead the Filter stays active.
Mentioned this before, but just again so it's on the radar. Or should I
create an issue for this?

Peter
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Can't Import dives from Mares Quad Air

2021-01-12 Thread Jef Driesen via subsurface

On 11/01/2021 20:49, Linus Torvalds via subsurface wrote:

On Mon, Jan 11, 2021 at 11:37 AM Markus Hinkelmann via subsurface
 wrote:


I tried to import my dives from my Mares Quad Air using the Interface „Mares 
BLUELINK Pro“ to subsurface.


I'm afraid that the Mares BlueLink Pro has been the most problematic
piece of BLE hardware we have ever seen.

It has been known to work - often very very slowly - but it has always
been extremely flaky. I've never figured out why.


The Bluelinkpro is indeed trouble.

There is the outstanding issue of sending the commands "all at once" versus "in 
two pieces". In some cases the former seems to work better, while in other cases 
it's the other way around. So far I haven't been able to find any pattern. It 
could depend on the dive computer model, the operating system, the bluetooth 
stack, etc.



The computer was able to connect to the interface using the mode „BT-classic“ 
but the import fails.


I didn't even know that it supported BT-classic at all. I've only ever
seen it do BLE.

I was going to say that BT-classic cannot possibly work, but:


Both log files have transport=32, so that means BLE was used. Maybe subsurface 
automatically falls back to BLE if rfcomm isn't available?



A dump file was not created, but I was able to create a libdivecomputer log 
file (see attachment).


Strangely, it actually partially does seem to have worked. There are a
few valid reply packets with the valid '0xAA' packet reply byte, and
the communication actually starts. Color me I'm surprised.

So that log shows us sending several commands to it, and starting to
do a data transfer.  Yeah, we get a few NAK packets (0xEA) back
instead of 0xAA, and a couple of "no reply at all" cases, but even
then the re-try ends up working a few times.

But then at some point, even when retrying, it just returns an
all-ones (0xff) answer, and after five failres for that command we
just give up.

Honestly, this _might_ be one of those cases where "if you try again,
eventually it might work".


I suspect the single byte 0xEA response, indicates the device received the 
command packet, but can't answer for some reason. Maybe the received command was 
corrupted, and couldn't be interpreted as a valid command, or the dive computer 
wasn't ready yet to process the next command? But it's still responding somewhat 
normal, and retrying usually works just fine.


Then we have a few cases where we have no response at all. Difficult to tell 
what is going on behind the scenes. Retrying often seems to work at first, but I 
have the impression it all starts to go downhill from here. After a while we 
start to receive garbage data, and we aren't able to recover anymore. We're 
probably out of sync with the dive computer somehow. And that garbage data is 
probably some data send by the dive computer in response to one of the earlier 
commands that happens to arrive too late?


One thing that could contribute to the problem is that the iconhd protocol 
doesn't use any form of checksums. So it's nearly impossible to detect corrupt 
packets. Only the commands have a small protection in the sense that the type 
byte is repeated (with the second byte xor'ed with 0xA5). That could explain why 
it's difficult to recover once things start to go wrong. Of course that doesn't 
explain why things start to go wrong in the first place.



But equally honestly, I've pretty much given up on the Mares BlueLink
adapter. I don't know why it's so flaky. The Mares mobile app seems to
be able to talk to it, but when I did a packet trace, I didn't see it
do anything special, so I don't know what is going on. It might be
some very subtle timing issue that the Mares app is aware of.


If I remember correctly, we haven't seen any errors at all in the traces from 
the Mares application. I also have no idea why it seems to just work there, but 
not for us. It looks like they just don't seem to hit this problem. Strange.


The Mares applications sends the command in two parts:

W: CMD CMD ^ 0xA5
R: ACK(0xAA)
W: CMD_DATA
R: RSP_DATA
R: EOF(0xEA)

I've always assumed this is done because the dive computer first acks the 
command byte to indicate it's ready to receive the command payload. At this 
point it knows how many bytes to expect, and is ready with whatever it needed to do.


The only thing that could screw up is some extra latency (due to a slow BLE 
link) that exceeds some internal timeout. In that case the dive computer will 
see the CMD bytes without the payload. Of course we did still send those bytes, 
and the dive computer will get those later. And then it will probably start to 
interpret those as the next command.


If we send the whole command at once, without first waiting for the ack, we 
avoid the extra roundtrip latency. But depending how this is implemented in the 
firmware and the amount of buffering, the command payload could be arriving too 
fast, before the firmware is ready to receive those byte, and they could 

some more feedback on the statistics widgets we have

2021-01-12 Thread Dirk Hohndel via subsurface
Berthold,

I know you know this, but just documenting it here so I don't forget:
- when closing the statistics on desktop, the dividers aren't restored to their 
previous positions
  We talked about completely replacing the dividers with something better, but 
I'm not sure if you had time to think about this at all
- I'd love a way to move the legend box around and even hide it completely - 
definitely the latter for mobile
- I realized that we could simulate the 'hover' results on desktop with 'tap on 
the graph' in mobile - but haven't spent time on how hard that would be - 
especially since you had planned to change the statistics graph into multiple 
independent components, anyway

I'm sure there's a ton more, but I keep not writing things down and then 
forgetting... hence this email :-)

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


iOS build 4.9.10.334 with dive statistics

2021-01-12 Thread Hartley Horwitz via subsurface
I've been away from testing for months.  I just downloaded the new iOS
release with an early view of the statistics.   I'll check it out properly,
but the initial impressions are excellent.  Very usable on my iPhone6
running iOS 12.5.1. I played around with a variety of views, binning.

Great job to the developers. Diving really dropped last year, but now I'm
excited to walk through my log again.

Hartley
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface