can't download Oceanic VT3 on linux
Jef Driesen
jef at libdivecomputer.org
Wed Mar 12 07:50:39 PDT 2014
On 2014-03-12 15:03, Hamish Moffatt wrote:
> Sorry, sent that last one to Jef only by mistake.
>
> On 13/03/14 00:52, Hamish Moffatt wrote:
>>
>> I'm starting to wonder if the dive computer needs that time and the
>> only reason it works on Windows and Mac is because the default latency
>> timer is higher which is adding that delay...
>>
> Aha. So, I increased the latency on linux (after first turning off the
> low_latency flag, which the driver sets by default):
>
> # setserial /dev/ttyUSB0 ^low_latency
> # echo 16 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
>
> Now it works. With a value of 2 in there, it mostly works (glitches
> occasionally). Here's the timing:
>
> [0.000026] DATETIME 2014-03-12T13:58:50Z (1394632730)
> [0.000052] VERSION 0.5.0-devel
> (575f2e9016ac9baa2b1b031caa6fe0bc77cdbbee)
> [0.000057] DEVICE=/dev/ttyUSB0
> [0.000065] oceanic_atom2_device_open
> [0.000073] INFO: Open: name=/dev/ttyUSB0
> [0.000812] INFO: Configure: baudrate=38400, databits=8, parity=0,
> stopbits=1, flowcontrol=0
> [0.000929] INFO: Timeout: value=3000
> [0.000940] INFO: Sleep: value=100
> [0.101016] INFO: Flush: queue=3, input=0, output=0
> [0.101439] INFO: Write: size=1, data=84
> [0.103600] INFO: Read: size=1, data=5A
> [0.107599] INFO: Read: size=17, data=4F43452056543320523244203531324BBF
> [0.107615] dc_device_dump
> [0.108581] INFO: Write: size=3, data=B10000
> [0.109599] INFO: Read: size=1, data=5A
> [0.121477] INFO: Read: size=17, data=0416041120081001425800730000000075
> [0.124581] INFO: Write: size=3, data=B10001
> [0.124596] INFO: Read: size=1, data=5A
> [0.135469] INFO: Read: size=17, data=6701DA064204E506E206DC06FF0FAAFBF6
> [0.136583] INFO: Write: size=3, data=B10002
> [0.137476] INFO: Read: size=1, data=5A
> [0.149352] INFO: Read: size=17, data=0000DC06FF0FDC06FF0F00000000AA8A14
> [0.152581] INFO: Write: size=3, data=B10003
> [0.152595] INFO: Read: size=1, data=5A
> [0.163354] INFO: Read: size=17, data=890E370D00011B0B670542053250AAE1C2
> [0.164588] INFO: Write: size=3, data=B10004
> [0.165312] INFO: Read: size=1, data=5A
> [0.177359] INFO: Read: size=17, data=300220028003500530BEB0BB0000000085
> [0.180580] INFO: Write: size=3, data=B10005
> [0.180595] INFO: Read: size=1, data=5A
> [0.191212] INFO: Read: size=17, data=A014000300002C01980805A0022100024E
> [0.192580] INFO: Write: size=3, data=B10006
> [0.193229] INFO: Read: size=1, data=5A
>
> With a value of 4 it downloaded the whole memory dump with no errors.
Good catch! We're getting closer.
I suspect that due to the higher latency on Windows and Mac OS X (16ms
seems to be the default), reading the data takes slightly longer and
that is enough delay for the next write. On linux, with the latency
timer set to 1, there is virtually no delay, and the next write happens
too fast.
Some interesting reading about the ftdi low latency stuff:
http://projectgus.com/2011/10/notes-on-ftdi-latency-with-arduino/
Jef
More information about the devel
mailing list