Dive data import error with Hollis DG03

Rick Walsh rickmwalsh at gmail.com
Wed Mar 26 06:38:35 PDT 2014


On 26 March 2014 23:38, Jef Driesen <jef at libdivecomputer.org> wrote:
>
> For a non C programmer, you're doing very well. ;-)
>

Thanks


>
> There is still a failure early on, so I doubt the 100ms delay at the end of
> the open call (e.g. the one you patched above) changed anything. But as I
> already suspected, the fixed 100ms delay before the retry after the NAK
> causes the retry to succeed immediately. And from then on, the extra 4ms
> does the trick for all later packets. Excellent.
>

I think the reason for the early failure may actually be that zero
delay (the initial value) between calls just isn't enough, at least
some of the time, so it fails early on. After the first failure, the
delay increases to 1ms, which is ok, at least with my computer / dive
computer. So, I tried setting the initial delay value to 1ms (line 437
of oceanic_atom2.c).

    // Set the default values.
    device->port = NULL;
    device->delay = 1;

Now I get zero errors, and the total time is under 1 minute. That's 7
seconds less than on Windows, which also had no errors. Boo ya.

[0.000041] DATETIME 2014-03-26T13:09:52Z (1395839392)
[0.000083] VERSION 0.5.0-devel (fa90009c293a9ca1a4eaf49a478b381477695c0a)
[0.000109] Opening the device (Oceanic Atom 1.0, /dev/ttyUSB0).
[0.000131] INFO: Open: name=/dev/ttyUSB0
[0.005535] INFO: Configure: baudrate=38400, databits=8, parity=0,
stopbits=1, flowcontrol=0
[0.007811] INFO: Timeout: value=3000
[0.007868] INFO: Sleep: value=100
[0.108057] INFO: Flush: queue=3, input=0, output=0
[0.108117] INFO: Sleep: value=1
[0.110571] INFO: Write: size=2, data=8400
[0.112589] INFO: Read: size=1, data=5A
[0.115682] INFO: Read: size=17, data=484F4C4C44473033203142203531324BB3
[0.115765] INFO: Sleep: value=50
[0.165915] Registering the event handler.
[0.165975] Registering the cancellation handler.
[0.165989] Downloading the memory dump.
[0.166107] Event: vendor=484F4C4C44473033203142203531324B
[0.166169] Event: progress 0.00% (0/65536)
[0.166218] INFO: Sleep: value=1
[0.169426] INFO: Write: size=4, data=B1000000
[0.169466] INFO: Read: size=1, data=5A
[0.180606] INFO: Read: size=17, data=0516110804110000444D000481006B01CB
[0.180629] Event: progress 0.02% (16/65536)
[0.180652] INFO: Sleep: value=1
[0.183519] INFO: Write: size=4, data=B1000100
[0.183545] INFO: Read: size=1, data=5A
[0.194574] INFO: Read: size=17, data=6B01B8061204AE066407A106FF0FAABE7C
...
[59.883580] Event: progress 99.98% (65520/65536)
[59.883596] INFO: Sleep: value=1
[59.886560] INFO: Write: size=4, data=B10FFF00
[59.886596] INFO: Read: size=1, data=5A
[59.897591] INFO: Read: size=17, data=001227031404081B0E034C00570200002D
[59.897623] Event: progress 100.00% (65536/65536)
[59.900338] Closing the device.
[59.900357] INFO: Sleep: value=1
[59.903538] INFO: Write: size=4, data=6A05A500
[59.903559] INFO: Read: size=1, data=A5
[59.910558] Result: Success


More information about the subsurface mailing list