Jump to content

[GUIDE] USB OTG / USB Host


Recommended Posts

Guest Mihail Zenkov
Posted (edited)

First bad news: u8815 ignore state of ID pin - driver cannot switch automatically to usb host mode. But we can force host mode by hands!

 

Run in adb shell (over network) or directly in android terminal:

echo host > /d/otg/mode

 

If you want check current state:

cat /d/otg/info

 

u8815 not provide power to external device. You should connect power source to it: 

http://forum.xda-developers.com/showthread.php?t=1450298

 

For return to normal (peripheral) mode:

echo peripheral > /d/otg/mode

But in this case driver ignore connect/disconnect to usb. To fix this we should patch kernel: https://github.com/MihailZenkov/android_kernel_huawei_u8815/commit/1fc2282e1e00bac8d1410872363616ff155b6c2d

 

At now I try add some kind of auto switch to host mode and back.

 

P.S. Tested on cm-10.1-20130913 (Dazzozo)

Edited by Mihail Zenkov
Guest george109
Posted (edited)

Oh my god! :D :D :D

If this works, this is massive news!

I think this should be pinned :)

Thanks :)

Edited by george109
Posted

Apologies if it's a dumb question :o but I presume that the main benefit of USB OTG is the ability to connect external storage (e.g. a flash drive)?

Presumably it will drain the battery even faster than normal (which seems to be fast enough generally with the G300 - at least in my experience)?

I'm on stock GB B895 based superslim-v1 and my /d folder is empty... 

Guest Mihail Zenkov
Posted

Apologies if it's a dumb question :o but I presume that the main benefit of USB OTG is the ability to connect external storage (e.g. a flash drive)?

Presumably it will drain the battery even faster than normal (which seems to be fast enough generally with the G300 - at least in my experience)?

I'm on stock GB B895 based superslim-v1 and my /d folder is empty... 

Sorry, I forget mention - u8815 (as and many other device) need external power for peripheral device. I add this to first post.

Posted

Sorry, I forget mention - u8815 (as and many other device) need external power for peripheral device. I add this to first post.

 

What's the worst that can happen if there's no external power? Just doesn't work or could it kill the G300!?

Guest Mihail Zenkov
Posted

could it kill the G300!?

No. Without external power host work, but don't detect any external device.

  • 1 year later...
Guest adeii
Posted

I would like to share my experience with Y300 and connected 16GB USB 2.0 flash memory.

 

+ I got Y300 with SlimKat ROM 9.0 with chil360's kernel v0.53, with OTG support since v0.33 and Y-USB cable connected to phone with USB flash mem. and other end connected to +5V power supply (USB port)!

+ I execute commands in Terminal emulator: "su" and "echo host > /d/otg/mode"

+ And with "cat /d/otg/info</", I got

   OTG State: a_wait_bcon,

   OTG mode: 1

   OTG Inputs: 1xa

+ I had installed "USB Host Check" app and got that "handheld_core_hardware.xml" is OK, and "android.hardware.usb.host.xml" is not readable.

+ I change permitions of android.hardware.usb.host.xml from r------- to r--r--r--

Restarting phone, got me nothing special. "USB Host check" got 2 OK, OTG support is manualy started, OTG State is: a_host, but still no detected USB mem. I had try even "StickMount v0.26" app but got no result.

 

Finally, after installing "USB OTG Helper" and clicking on "Mount drive", application mounted no drive, BUT drive is VISIBLE and FULLY working on path /storage/UsbOtgDrives/drive_1 !!!

To dismount USB, go to "USB OTG Helper" and clicking on "Unmount drive" and go to Terminal emulator and execute: "su" and "echo peripheral > /d/otg/mode"

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.