fhorinek / SkyDrop

SkyDrop combined variometer
http://skybean.eu/
GNU General Public License v2.0
87 stars 42 forks source link

USB-OTG support? #336

Open ziritrion opened 6 years ago

ziritrion commented 6 years ago

I'm trying to connect the SkyDrop to my Pixel 2 XL using the included USB cable and a USB-C OTG adapter I bought on Amazon. When I connect the Skydrop to the phone, the screen will say "charging" but it will never switch to USB mode, and on the phone there is an option in the notification menu to choose whether you want to charge the device or transfer files, but when I choose to transfer files, nothing at all happens.

I've also noticed that when I connect the SkyDrop to my computer (MacBook Pro), it takes a while for the SkyDrop to switch from Charging to USB mode.

Am I doing something wrong? Is USB-OTG supported?

fhorinek commented 6 years ago

The drop act as device and actually does not care if you connect to id via computer or OTG phone. We are using standard massstorage driver. Drop will always display Charging in usb mode until there is communication request from master.

ziritrion commented 6 years ago

Understood. Apparently my phone's USB port is not behaving correctly; I've had issues with a few devices already.

nfedera commented 5 years ago

Same issue here. @fhorinek Have you ever managed to transfer a file from to an modern Android Phone via USB OTG? I highly doubt it. The issue is that modern (as in for several years already) Android devices only charge connected USB devices per default. The user then has to switch to file transfer mode manually. However, this step causes the SkyDrop to disconnect and reconnect. Android then is again in default charging only mode. This is sad because on my trips without notebook I have no option (other than disassembling the device to access the sd card) to upload or backup my track logs.

This Android default is documented behavior since Android 6 (Marshmallow):

Device connections through the USB port are now set to charge-only mode by default. To access the device and its content over a USB connection, users must explicitly grant permission for such interactions. If your app supports user interactions with the device over a USB port, take into consideration that the interaction must be explicitly enabled.

bubeck commented 5 years ago

Yes, I successfully used USB-OTG with a Google Nexus 5X running unmodified Android 8.1 :) The reconnect did not happen, instead it directly asked for browsing the files.

I typically see the question about "loading" or "using as MTP" or "Using PTP" when I connect my phone to a (host) computer, without OTG. For me it seems, that OTG does not ask but directly use.

So at least some phones seem to work. Regardless of this, I will try to look into the code for a better handling.