Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
flar2
Old
(Last edited by flar2; 1st November 2012 at 02:30 PM.)
#1  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 4570
Posts: 1,701
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Default USB Host / OTG working (UPDATE: now self powered)

Update October 28,2012:
h8rift figured out how to enable full OTG support with 5V power, no need for y-cable anymore!

You need to use a modified kernel for self powered OTG. Stock kernel has OTG but needs a y-cable connected to 5V power source, as explained below.



To enable powered OTG, you will need to use one of the following:

CM10 Nightly builds: http://forum.xda-developers.com/show....php?t=1790032

King Kang ROM: http://forum.xda-developers.com/show....php?t=1959099

rohan.kernel: http://forum.xda-developers.com/show....php?t=1892108

For Sense ROMs: http://forum.xda-developers.com/show....php?t=1967897




______________________________________________

To use OTG with stock kernel:


Here's what you need:

-an OTG cable
-a USB Y-cable
-a usb perhipheral (eg: mouse, keyboard, thumb drive, etc)


The key to this working is 5V on the uplink to the phone. Most usb hubs do not supply 5V on the uplink! This is why I suggest a Y-cable.

1. connect the perhipheral device to the Y-cable
2. connect the y-cable to the AC power adapter that came with your phone
3. connect the other end of the y-cable to an OTG cable
4. connect the OTG cable to your One X




Here's a screenshot showing the mouse pointer:




Notes:

-the OTG cable automatically sets the USB controller to host mode
-usb-hid seems to be built into the kernel, no modules need to be loaded
-usb storage works, but has to be mounted manually
-tested on stock kernel and scrosler's cleankernel
The Following 6 Users Say Thank You to flar2 For This Useful Post: [ Click to Expand ]
 
ECEXCURSION
Old
#2  
ECEXCURSION's Avatar
Senior Member
Thanks Meter 474
Posts: 2,066
Join Date: Aug 2010
Location: Michigan Tech.
Cool. Kinda sucks that you need a separate 5v source.
Previous Phones: HTC One XL w/ CleanROM 6 R2 & ElementalX-6.4, HTC Aria w/ Liberated 2.2.2, Motorola PEBL
Current Phone: HTC One (T-Mobile)

My HTC One vs One XL Review

Useful when switching ROMs: Calkulin's FORMAT ALL for One XL

My battery life eats your battery life...
 
flar2
Old
#3  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 4570
Posts: 1,701
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
^^yeah, there's not much you can do about that. I'm pretty sure there's no way the phone can supply the power.



Also, I can confirm usb storage works.

I attached a thumb drive and manually mounted it:

mkdir /mnt/usb
mount -t vfat /dev/block/sda1 /mnt/usb
 
nightrainbow
Old
#4  
nightrainbow's Avatar
Senior Member
Thanks Meter 29
Posts: 219
Join Date: Jan 2011
Location: Las Vegas
Where did you get that clock?

Sent from my HTC One X using xda premium
 
abhipati
Old
#5  
abhipati's Avatar
Senior Member
Thanks Meter 288
Posts: 853
Join Date: Jun 2012
Location: Littleton MA
Quote:
Originally Posted by flar2 View Post
^^yeah, there's not much you can do about that. I'm pretty sure there's no way the phone can supply the power.



Also, I can confirm usb storage works.

I attached a thumb drive and manually mounted it:

mkdir /mnt/usb
mount -t vfat /dev/block/sda1 /mnt/usb
Any OTG cable is fine?

Sent from my HTC One X using xda premium
HTC ONE X (AT&T)
ROM: - Nocturnal MergeX


DON'T INSTALL CMW Recovery INSTEAD USE TWRP

CWM does not officially support the AT&T One X, and may cause serious problems. TWRP is recommended!


TWRP -

-------------------------------------------Watch for updated signature with current important links --------------------------

Hit thanks if my post was helpful
 
flar2
Old
#6  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 4570
Posts: 1,701
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Quote:
Originally Posted by abhipati View Post
Any OTG cable is fine?

Sent from my HTC One X using xda premium
Any proper OTG cable (I got mine for like $3 on ebay). In an OTG cable, pin 4 on the micro usb side is grounded. This is how the device automatically senses that it should enter host mode.
 
flar2
Old
#7  
flar2's Avatar
Recognized Developer - OP
Thanks Meter 4570
Posts: 1,701
Join Date: Jun 2012
Location: Ottawa

 
DONATE TO ME
Quote:
Originally Posted by nightrainbow View Post
Where did you get that clock?

Sent from my HTC One X using xda premium
Are you being serious? (It came with the phone)
 
ECEXCURSION
Old
#8  
ECEXCURSION's Avatar
Senior Member
Thanks Meter 474
Posts: 2,066
Join Date: Aug 2010
Location: Michigan Tech.
But it has a brushed aluminum theme, no? So it's not stock.

Sent from my HTC One XL using Tapatalk 2
Previous Phones: HTC One XL w/ CleanROM 6 R2 & ElementalX-6.4, HTC Aria w/ Liberated 2.2.2, Motorola PEBL
Current Phone: HTC One (T-Mobile)

My HTC One vs One XL Review

Useful when switching ROMs: Calkulin's FORMAT ALL for One XL

My battery life eats your battery life...
 
quarlow
Old
#9  
quarlow's Avatar
Senior Member
Thanks Meter 304
Posts: 1,650
Join Date: Feb 2008
Location: Tooele, UT
The Galaxy S II supplies power for USB host with a OTG cable ... stock

This is like the way you have to do it with a TouchPad, who carries around a portable USB power supply? If HTC wasn't going to give a MicroSD slot, you would think USB OTG would be officially supported.

Sent from my HTC One X
i-mate JAQ > HTC 8525 > iPhone 3G > iPhone 3GS (it was a dark time in my life, I was confused) > Palm Pre > HTC Aria > Samsung Captivate > LG Thrill > Samsung Focus > Samsung Galaxy S II (I777) > HTC One X > Samsung Galaxy Note II (I317) + HP TouchPad
 
Shaddy-Z.
Old
#10  
Shaddy-Z.'s Avatar
Senior Member
Thanks Meter 79
Posts: 568
Join Date: Dec 2010
Does the phone at least charge in this mode so its somewhat useful?

 
Post Reply+
Tags
otg, usb host

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...