SubSurface Mobile and OTG

Thomas Fänge thomas.fange at gmail.com
Wed May 23 23:23:52 PDT 2018


Hi!

Tested yesterday with several different phones and tablets (all Sony), but
none of them worked. Some models doesn't enable OTG without restarting the
phone with the cable inserted (to avoid powerleakage with nothing
connected), but all phone "detects" the DC (at least the cable led turns
from green to red when connected) when the USB-port is enabled.
I can see in the log that the phone wants to use "SERIAL" interface, asks
for available interfaces and the phone responds with "SERIAL USB USBHID",
but shortly after the error DC_STATUS_UNSUPPORTED is reported and the
DCDownloadThread stops.

Just quickly looking into the code, I think the error originates from
divecomputer_device_open, where "SERIAL" is requested and supported by the
phone.

If serial (as in this case), the following code is executed
(core/libdivecomputer.c):

  if (transports & DC_TRANSPORT_SERIAL) {
    rc = dc_serial_open(&data->iostream, context, data->devname);
    if (rc == DC_STATUS_SUCCESS)
      return rc;

  #ifdef SERIAL_FTDI
    if (!strcmp(data->devname, "ftdi")) {
      rc = ftdi_open(&data->iostream, context);
      if (rc == DC_STATUS_SUCCESS)
        return rc;
    }
  #endif
  }
  ...
  return DC_STATUS_UNSUPPORTED;

I have not digged to far, but I guess that it is this errorcode
(DC_STATUS_UNSUPPORTED) that we see.
So, either dc_serial_open or ftdi_open fails (can't see any error from them
in the log), but I could try to dig deeper ...

Related question: where can I find the log? I can show the log on the
display (from menu "Developer/App log"), but I can't copy text from that
view - is it stored somewhere? I looked for it in the filesystem, but can't
find it ...

Cheers!
Thomas


tors 24 maj 2018 kl 06:33 skrev Miika Turkia <miika.turkia at gmail.com>:

> On Wed, May 23, 2018 at 11:55 AM, Guillaume Gardet <
> guillaume.gardet at free.fr> wrote:
>
>> Hi,
>>
>> Le 23/05/2018 à 07:29, Miika Turkia a écrit :
>>
>> This does work for some divecomputers, depending on the ftdi chip that is
>> used on the cable. We also have some trouble with Android OS as some newer
>> Android versions prevent us from accessing the USB devices. What versions
>> of DC, cable (the serial chip), phone and Android you are using? (I have
>> used OTG on Nexus 7 tablet and Suunto Vyper Air DC successfully, don't
>> remember the Android version on the tablet.)
>>
>>
>> Does it still work? Because Vyper Air on a Nexus 7 fails for me. :(
>>
>
> Couldn't find the original cable for Vyper air, but tested with D4. Failed
> :(
>
> miika
> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20180524/66f55933/attachment.html>


More information about the subsurface mailing list