yashsingh1/xdaforums huggingface dataset:
[HTC One S] nerd65536:
USB host lets you hook up external USB devices to your phone, like a keyboard, mouse, USB drive, etc..

Unlike devices which are designed to support USB host, the One S doesn't provide power to the peripheral. That means we need a few more adapters/cables to get it to work (and we need an external power source).

Purchase links are listed for all the required cables/adapters.

You will need:

USB Host adapter (The otherwise unused 5th pin on a micro-usb connector is grounded) dx.com/m-129671

Mini USB power Y cable (this kind of cable is often packaged with portable hard drives) dx.com/u-65630

Mini USB Female to USB A Female adapter This package comes with two, but you only need one. dx.com/u-55613

Your charger

Assemble the cable:

The micro USB of the "USB Host adapter" connects to your phone.

Your peripheral plugs into the female end of the "Mini USB Female to USB A Female adapter"

The "Mini USB power Y cable" has three connectors:

Mini USB connector - connects to the "Mini USB Female to USB A Female adapter"

Male USB A Power (the thinner wire) - connects to your charger

Male USB A - connects to the "USB Host adapter"

That's all. As long as your ROM supports the peripheral, it will work.

Some fun peripherals to try:

Powered USB hub (You can also power the adapter from one of the hub's ports)

Keyboard

Mouse (a cursor will appear on your device)

USB flash drives and USB hard drives must be FAT32. You have to run a few commands to use a USB drive. Mount manually from the shell (use Connectbot or Terminal Emulator):

su
mkdir /mnt/sdcard/usb
mount -o uid=1000,gid=1015,fmask=0702,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb

To unmount:

su
umount /mnt/sdcard/usb
[HTC One S] mrufino63:
Hello,

I'm French so please excuse me for my english.

Just one question.

I understand nothing with custom ROMs (and i don't want to modify the phone).

Do i need to do something on the phone or your solution with only a couple of cables, an adaptor, a power (i mean a battery like a TeckNet Dual-Port 7000mAh) AND my micro sd card reader (USB), all that will be sufficient to make the deal? I mean i will be able to read the files (.flac music files) of the micro sd or sd card?

Thank you
[HTC One S] nerd65536:
A battery pack (like the TeckNet) should work as the power source.

For Keyboard/mouse, you do not need to modify the phone. (Only the cables and power are needed.)

For a card reader, you must "root" the phone, because to 'mount' the USB drive, you must run 'su'.
[HTC One S] mrufino63:
So i'd have to root the HTC One S to mount external flash memory cards!

What a pity to sell phones without micro sd emplacement (so they sell you. mp3 players).

I have a 64gb micro SDXC in my HTC Desire (bravo) which works perfectly...

HTC will wait... (Perhaps i will root that one: i must learn how to do...)

Nice from you to answer me - specially on xda-developers site, i mean where the members speak of more interesting problems, like development, etc.

Thank you again
[HTC One S] setzer715:
Is this part right?

mkdir /media/sdcard/usb

My phone doesn't have a media directory. Plus on your next line you mount /mnt/sdcard/usb.

Thanks for the write up. Tried with a powered hub and couldn't get it to work. Going to order the cables I listed below and give it a shot. If I store and access movies/music from an external drive for travel that would be awesome! Will use this for power source on the plane!

Also, for other options for what to purchase you can bring it down to 2 items with these.

1 - Y-cable with female end instead of mini usb.

2 - Micro to female "host" cable. Same as what you linked, just a different place to buy so order is from same site (cheaper shipping!).
[HTC One S] nerd65536:
Yes, it should be "mkdir /mnt/sdcard/usb". I'm updating the post now.
[HTC One S] setzer715:
Yeah, that's what I figured. Thanks for updating the post.

Were you able to mount a flash drive doing this? If so, could you stream a movie from it? Just curious what all you have done with this mod.

Thanks again for the write up. I always though the issue was that the tech was not included in the kernel, not that we didn't have a powered port!
[HTC One S] nerd65536:
I am able to mount a flash drive and play movies from it. I also tested using a USB keyboard and a USB mouse.

Note: It is best to use a fast charger (1 amp or more) for powering the arrangement. The phone can charge when everything is plugged in.
[HTC One S] setzer715:
Awesome, thanks! Just ordered some cables, cant wait to try it out!
[HTC One S] setzer715:
So I have been playing with this for a bit. I can get it to mount my old 4GB USB 2.0 flash drive but not my new 32GB USB3.0 flash drive. Do you think it's a 32GB thing or a USB3 thing? I would like to order a new drive for this but not sure which to eliminate.

I would prefer to use a 32GB drive if it's just a USB3 thing but if it's the size of the drive I don't want to deal with returns.

Any ideas?

Also it will not mount my SDCard reader with 16GB card in it.

EDIT: So I found my old 16GB USB3 flash drive and it mounts that just fine. So it's looking like it just won't mount a 32GB drive. Of course my 32GB drive is a super fast USB3 (write speeds of 100Mbps+) so maybe that could have something to do with it. Either way my 16 gig is good enough for travel so I'm good.

Thanks again for the write up!
[HTC One S] nerd65536:
I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.

In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.

Troubleshooting:

Do you get a specific error when using the "mount" command? If so, please paste the error message here.

Run

ls /dev/block/

to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?

Does the phone charge while everything is plugged in?
[HTC One S] setzer715:
The error I get is "No such file or directory". It happens on this and my sdcard reader.

I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.

My 32GB flash drive is a high speed Lexor. I tried my wifes flash drive, her's is a Lexor 32GB USB3 but a slower rated one and I can see her's.

Further testing with my SDCard reader. I have a Transcend 8GB Class 6, A-Data 16GB Class 6 and Patriot 32GB Class 10 SDCards. I can see the 8GB and 32GB but not the 16GB.

Seems maybe a compatibility issue maybe? The card's/drives I couldn't read I tried formatting again, everything is FAT32. Who knows. At least I know most things work.
[HTC One S] nerd65536:
The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.

(The ideal solution would be to partition and format the drive so that it would behave like the others.)
[HTC One S] setzer715:
Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?

I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
[HTC One S] nerd65536:
It is possible to skip the partition table altogether and just start with the FAT32 data instead. This is what the manufacturer of the drive has done. (The drive doesn't have any partitions, so there is no first partition to be named "/dev/block/sda1")

You should be able to use the drive if you mount "sda" instead of "sda1". You can follow these instructions below to make it behave like the other drives:

If you have an Ubuntu LiveCD, boot from it, and open GParted (Partition Editor):

Choose your flash drive from the drop-down at the top right. Make absolutely sure you select the correct device (the size of the drive is listed), as all data on it will be erased.

In the menu: Device --> Create Partition Table... --> Apply.

Click on the "unallocated" space, to select it.

Next, menu: Partition --> New --> File system: FAT32 --> Add.

Finally, menu: Edit --> Apply All Operations

(When finished, close GParted and shutdown the liveCD)

The drive should now show up with the expected /dev/block/sda1 partition.
[HTC One S] setzer715:
I just mounted it as you previously described on sda instead of sda1 and it worked fine. I don't want to repartition it as I don't know if that will mess with the speeds. Who knows what Lexor did to make this thing so amazing fast but I want to keep it that way. It's nice to through 8gigs of movies on it in 1-2 minutes.

I'm sure partitioning has nothing to do with it and it's all based on hardware but you never know!
[HTC One S] UnkzDomain:
Would this work using a simple 5-pin male micro-USB to female USB adapter connected to a powered USB hub?
[HTC One S] markwalker84:
Just ordered an HTC One S. YAY!

I'm a little scared about potentially frying my new toy by using the wrong cables...

Would an all in one cable do the job?

(ebay search for "Micro USB Host OTG Cable With USB power")

Seems to be the same as the DIY setup mentioned in the OP just all wrapped up in a single cable.

Thanks,

Mark
[HTC One S] arses:
I'm think if we buy an extended battery which have a micro usb cable (I forget the brand) exist on amazon.

We can solder a female to the cable and use battery as power source for phone and host.

What u think???
[HTC One S] cryingfreeman86:
Hi everybody,

First of all sorry for my englisch. I have a big problem with the USB otg function. An USB mouse works well but USB drives don't work. I have copied the text from terminal emulator:

app_162@android:/ $ export PATH=/data/local/bin:$PATH

app_162@android:/ $ su

app_162@android:/ # mkdir /mnt/sdcard/usb

mkdir: can't create directory '/mnt/sdcard/usb': File exists

2 /dev/block/sda1 /mnt/sdcard/usb <

mount: mounting /dev/block/sda1 on /mnt/sdcard/usb failed: No such file or directory

255|app_162@android:/ #

I also tried sda instead of sda1. No difference.

Please could anybody help me.
[HTC One S] TerrorApple:
I've tried mounting my external 1 TB Freecom HDD (socket powered) with 800GB NTFS, 200GB FAT32. I'm trying to copy videos from the FAT32 partition to my device. I've entered the commands in Terminal Emulator, but it only tells me: Stopped (signal). I've attached a screenshot. When I use ASTRO and open the /mnt/sdcard/usb folder it tells me: no data.

What am I doing wrong?
[HTC One S] nerd65536:
Run

ls /dev/block/

to see whether any devices named like "/dev/block/sd*" are detected.

You can also plug in the drive, then run

dmesg

to see debugging messages.

Let's verify that /dev/block/sda (or sda1) is detected. It should show up when you run the command:

ls /dev/block/

Reboot the phone and try it again.
[HTC One S] TerrorApple:
Thanks for your fast reply. I've tried that command, but "sda" nor "sda1" shows up. But what does the last line in my second screenshot mean? It's the mount command again, but with a different error...

Restarting the phone didn't help either.
[HTC One S] devgee:
@OP

There is app called OTG Helper, which helps to mount usb devices without terminal commands, all you need to do is click mount,

Ill be posting the app thread and a Video !

It really helps people who are getting errors in the terminal and it is easy to use !

App ----> http://xdaforums.com/showthread.php?t=1802740

Requirements : 1) Y-Cable

2) OTG Cable

3) Power Adapter (HTC Power Adapter didnt work for me, so i used another one)

3) USB stick ( I used a 8GB Trancend)

4) HTC One S

Video: [YOUTUBE]JyBvQMHKxUY[/YOUTUBE]

:laugh::laugh::laugh::laugh::laugh::laugh:
[HTC One S] TerrorApple:
Thanks for the app. I installed BusyBox Free and started the app. It tells me everything is OK. But when I click Mount it says: No devices found.

I set up like this: Freecom HDD (Freecom Network Drive XS 1TB Mini USB) -> adapter (mumbi Mini USB Male -> USB Female) -> HTC USB cable -> HTC One S. (I'd post links to my stuff, but I need at least 10 posts here for that...) The HDD is socket powered, so I shouldn't need any other cables. I also tried another HDD (Western Digital), but it didn't work either. What am I doing wrong? Am I using wrong cables?
[HTC One S] gemarcano:
Someone correct me if I'm wrong, but I recall reading somewhere (this thread maybe) that the HTC One S doesn't provide power to USB devices, hence the need for a Y cable. I believe the first post of this thread explains the proper setup. I hope this helps.

Sent from my HTC VLE_U
[HTC One S] TerrorApple:
Yes I know I need power, but my HDD is socket powered! Do I then still need a Y-cable? Because when I plug it in to the socket I hear my HDD running. I thought you only need an Y-cable if you want to connect a USB stick or something else that does not have it's own power source?
[HTC One S] devgee:
You need a y cable and a power adapter!

Gesendet von meinem HTC One S
[HTC One S] gemarcano:
You're right, sorry. I looked up your drive and it has its own power adapter. The y cable shouldn't be needed. I don't know much about Android, but since its similar to linux... Plug the HDD in and in the terminal run "dmesg", and copy approximately the last 15 lines or so. If the phone sees the drive at all, some sd* string should appear in the dmesg output.

Also, what ROM are you using?

Sent from my HTC VLE_U
[HTC One S] TerrorApple:
But my HDD is socket powered! Or does USB need extra power?

OK I ran "dmesg" and don't really know what that all means :D I added a screenshot. But it doesn't seem like it found my HDD...

BTW my Freecom HDD is always on (no stand-by), my WD HDD has stand-by enabled. And when I connect my WD to my PC you hear it starting and beginning to work. But when I connect it to my phone and mount it doesn't wake up from stand-by. Seems like the HDD doesn't even notices I gave the mount command!

I'm using ICS 4.0.3, no custom ROM, but T-Mobile branding.
[HTC One S] gemarcano:
If you are on T-Mobile stock ROM, even if rooted, I don't think it'll work. The ROM needs USB host support, which is configured in the kernel, so a custom Rom would be the way to go (which one? Sorry, I don't know...). Of course if you can get another USB storage device to work on the stock ROM, then I'm wrong about the ROMs, haha. From the dmesg I don't see anything about any external USB device. I find that odd, since I would expect at least a blip on the dmesg, but then again, it could be related to the lack of USB host support... Could anyone verify my claims about the kernel USB support and the ROMs?

Edit: My One S isn't rooted, so I can't test this right now. I think your best bet would be to try different devices. Also, after you issue the mount command, just type the command "mount" and press enter. If it mounted it, somewhere it that long blurb there should be mention of an sd* device along with /mnt/sdcard/usb as mount point. Also check in Astro by going to /mnt/sdcard/usb after mounting to see if there is something there. Hope that helps!

Sent from my HTC VLE_U
[HTC One S] TerrorApple:
devgee posted a video with a working USB OTG: http://xdaforums.com/showpost.php?p=30791064&postcount=24 Which ROM is that? I've already tried ASTRO, it just said no data. If this all doesn't work, I'll buy a Y-cable and try a stick first, like in the video. Maybe it's just an issue with my HDDs...

And it would be really great if someone (maybe the OP?) could say, if you need a custom ROM or not.

Edit: OK, I've PM'd devgee and it seems like you need a custom ROM (ViperOneS works), a USB OTG cable and an Y-cable. No wonder it didn't work :D I'll have a closer look when I'm back from my vacation and then post here if it worked. Thanks to everyone who helped ;)
[HTC One S] nor-ric:
Do you guys think it would be possible to use the phone as a desktop this way? I mean, my idea would be:

1) connect the phone to a usb hub

2) connect the hub to a monitor through MHL

3) connect the hub to mouse and keyboard

So as to use the phone with mouse and keyboard while mirroring the screen on the external monitor.

I'm quite ignorant when it comes to MHL output, so I apologize if I'm posting silly things!:D
[HTC One S] nerd65536:
USB needs extra power. It doesn't matter that the HDD is socket powered. You will still need the Y adapter for USB power.

MHL will not work through a USB hub.

USB host works on rooted stock ROMS. In fact, you don't even need to root the phone to use a mouse or keyboard.
[HTC One S] gemarcano:
So all you need is the extra power supplied via the use of a Y cable? No custom ROM? I stand corrected. Thanks!

Sent from my HTC VLE_U
[HTC One S] nor-ric:
Lol, my dreams have just been crashed!
[HTC One S] TerrorApple:
OK, I made it work now, I used: http://www.amazon.de/dp/B005JDETZA http://www.amazon.de/dp/B0038PECX0 http://www.amazon.de/dp/B001BHVMIU and a FAT32 Intenso 16GB Stick (USB2).

Sorry for the German Amazon links, not enough time atm to find Amazon.com links...

For mounting I used this http://xdaforums.com/showthread.php?t=1802740 on ViperOneS.

Thanks to everyone!
[HTC One S] devgee:
No probs TerrorApple

Gesendet von meinem HTC One S mit Tapatalk 2
[HTC One S] uniserve:
Hi Devgee, would you mind to let me know whether your HTC One S is still with stock kernel and if yes, which module did you use to make this app working in One S?
[HTC One S] TerrorApple:
devgee used ViperOneS in this video. Kernel in this ROM is 3.0.8.
[HTC One S] devgee:
What terror apple said is true!
[HTC One S] uniserve:
Devgee and Terror Apple. Thanks for the reply. I have ordered the OTG cable. My HTC One S is still untouched and unrooted with ICS 4.0.3 and Kernel 3.0.8. Do you think the USB OTG Helper will work with my HTC ONE S? Do I have to flash a custom ROM or Kernel to make OTG work with OTG Helper?
[HTC One S] devgee:
It should be rooted and custom Rom flashed!
[HTC One S] uniserve:
Devgee, thanks again. I will see if OTG works with my phone after I have received the OTG cable. If it doesn't, I will root my phone and install a custom ROM and hopefully OTG will work. HTC ONE S is a good phone. However, I think no micro SD slot and internal battery are its major drawback.
[HTC One S] nerd65536:
OTG Helper requires root.
[HTC One S] CzarDestructo:
There isn't a list of kernels that support USB OTG? None of the custom kernels for CM10 mention if they support it.
[HTC One S] lbrfabio:
I read in the HTC One X's official jelly bean roms(leaks) it's present the full support for USB OTG and you won't need all those cables\adapter. Just the normal OTG adapter.

I think there is a real possibility that this will work with our phone too in the future with Jelly Bean
[HTC One S] motabass:
Realy hope we'll get native support on JB because carrying around tons of cables is not very comfortable.;)

_____________________________________

sent from my inbranded EU One S

CID 1111111

ViperOneS 1.2

Blackout Rc3

Hboot 1.14

Radio 1.06s
[HTC One S] motabass:
Now this kernel has full OTG support with power from usb. ;)

http://xdaforums.com/showthread.php?p=31534830
[HTC One S] TerrorApple:
Waiting for ViperOneS JB release but is it now possible using USB OTG without all these cables?
[HTC One S] devgee:
Yep, u just need the OTG Adapter!

Gesendet von meinem HTC One S mit Tapatalk 2
[HTC One S] Goatshocker:
Is this the only kernel that supports full OTG? Or does some rom like viperS have this function build in?
[HTC One S] TerrorApple:
Awesome, can't wait! :)
[HTC One S] devgee:
You can try it out in all jellybean roms including cm10, jellybam, pacman and viperone s(with zarboz latest kernel)

For cm10 and the other u need the app stickmount and this

http://item.mobileweb.ebay.de/viewitem?itemId=140893087207&index=4&nav=SEARCH&nid=67133434518

For jellybean roms u just need the adapter http://item.mobileweb.ebay.de/viewitem?itemId=140893087207&index=4&nav=SEARCH&nid=67133434518

Wish you all a wounderful New Year!

Gesendet von meinem HTC One S mit Tapatalk 2
[HTC One S] razlack:
Hi guys. This has probably been asked already but I have an unrooted HTC one s running JB. Does OTG work and provide power via the Ian port on the standard official rom with just the OTG cable?
[HTC One S] RockLee91:
Yes with the new OTA (jb) you onli need a normal OTG cable to connect any usb device (keyboard,mouse, usb key).
[HTC One S] spruggs:
USB Flash Drive

My One S is Jelly Bean 4.1.1 (un-rooted)

The problem I have is basically this.

I have a Micro-B Usb Otg On The Go Cable and Integral MicroSD USB Card Reader with a 32gb Micro SD.

When I first put all this together and plugged into the USB slot of the phone everything was fine, the little red light on the Integral MicroSD USB Card Reader was lit up. The message of Unable To Charge Device was coming up but the phone was also mounting the storage for reading via Astro File Manager no problem, so I was able to play MP3's and 4's and so on. But then it literally just stopped reading the Micro SD card and the Micro USB Card Reader is not lighting up at all.

Any help will be greatly appreciated as I am at a lost as to why it would be working perfectly one second and then not another.

Thanks you.
[HTC One S] jmcoffey:
It all depends on how much battery you have. If I remember correctly, less that 45 percent makes OTG not usable for me.
[HTC One S] Goatshocker:
Seriously? 45%? Thats worse than useless!

When I use OTG I normally use it until the device is about to die (<10%). Im not on stock JB though...
[HTC One S] Sachintha chaminda:
It shows me like this.Is it ok or some thing wrong ?

$ su

#su

# mkdir /mnt/sdcard/usb

# mount -o

option requires an argument -- oBusyBox v1.20.2-cm7 bionic (2012-07-17 15:18 +0200) multi-call binary.

Usage: mount [OPTIONS] [-o OPTS] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc.

-a Mount all filesystems in fstab

-f Dry run

-r Read-only mount

-w Read-write mount (default)

-t FSTYPE[,...] Filesystem type(s)

-O OPT Mount only filesystems with option OPT (-a only)

-o OPT:

loop Ignored (loop devices are autodetected)

[a]sync Writes are [a]synchronous

[no]atime Disable/enable updates to inode access times

[no]diratime Disable/enable atime updates to directories

[no]relatime Disable/enable atime updates relative to modification time

[no]dev (Dis)allow use of special device files

[no]exec(Dis)allow use of executable files

[no]suid(Dis)allow set-user-id-root programs

[r]shared Convert [recursively] to a shared subtree

[r]slaveConvert [recursively] to a slave subtree

[r]private Convert [recursively] to a private subtree

[un]bindable Make mount point [un]able to be bind mounted

[r]bind Bind a file or directory [recursively] to another location

move Relocate an existing mount point

remount Remount a mounted filesystem, changing flags

ro/rw Same as -r/-w

There are filesystem-specific -o flags.

# uid=1000,gid=1015,fmask=0702,dmask=

# 0702 /dev/block/sda1 /mnt/sdcard/usb1
[HTC One S] ryanshew:
To mount flash drives, just use "usb otg helper" from play store.

HTC_One_S | S-OFF | ViperOneS_2.2.0 | Black-Blue_Sense_Theme | Bulletproof_1.2
[HTC One S] aidoj:
Just the adaptor, nothing else

You don't even need that. For me, plugging in a USB stick just worked right away (though the notification tray said something about not charging).

Works seemlessly with no extra work - pictures show up in the gallery - files in the file explorer etc.

(4.1.1, unrooted)
[HTC One S] jmcoffey:
It depends on the file system of the drive.
[HTC One S] giesse1996:
charge and otg?

Dear xda,

Thanks for sharing this info, I am pallaning to make one myself. I also wanted to be able to charge it while i am using the usb port for external storage. Anyone knows how to achieve that, solder the red wire to the red wire and black to black so it will charge?

Greetings
[HTC One S] super34:
OTG Problem

Hi, I have a S3 htc one s with stock unrooted JB 4.1.1 sense 4+, my problem is connecting a pen drive over a usb otg cable it keep connecting and disconnecting. I have used few different cables, even a home made one but nothing has changed. Do you have this problem? do I need a proper Application (no root) to mount the drive? Any Help? Thanks