[Guide] USB Host

Search This thread

TerrorApple

Senior Member
Aug 26, 2012
416
173
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?
 

Attachments

  • Screenshot_2012-08-26-15-36-39.jpg
    Screenshot_2012-08-26-15-36-39.jpg
    30.2 KB · Views: 401
Last edited:

nerd65536

Member
Jun 10, 2009
15
16
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.

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

You can also plug in the drive, then run
Code:
dmesg
to see debugging messages.

First of all, sorry for my English.
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?

Apple

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

Reboot the phone and try it again.
 

TerrorApple

Senior Member
Aug 26, 2012
416
173
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.
 

Attachments

  • uploadfromtaptalk1346019076562.jpg
    uploadfromtaptalk1346019076562.jpg
    62.4 KB · Views: 279
  • uploadfromtaptalk1346019085971.jpg
    uploadfromtaptalk1346019085971.jpg
    53.8 KB · Views: 277
Last edited:

devgee

Senior Member
Dec 5, 2011
482
196
@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:
:laugh::laugh::laugh::laugh::laugh::laugh:
 

TerrorApple

Senior Member
Aug 26, 2012
416
173
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?
 

Attachments

  • Screenshot_2012-08-28-11-48-53.jpg
    Screenshot_2012-08-28-11-48-53.jpg
    25.1 KB · Views: 246
  • 419IxRHp9FL._SL500_AA300_.jpg
    419IxRHp9FL._SL500_AA300_.jpg
    7.3 KB · Views: 209
Last edited:

gemarcano

Member
May 22, 2012
20
3
Worcester
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?

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
 

TerrorApple

Senior Member
Aug 26, 2012
416
173
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

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?
 

gemarcano

Member
May 22, 2012
20
3
Worcester
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?

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
 

TerrorApple

Senior Member
Aug 26, 2012
416
173
You need a y cable and a power adapter!

Gesendet von meinem HTC One S

But my HDD is socket powered! Or does USB need extra power?

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

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.
 

Attachments

  • Screenshot_2012-08-28-15-09-47.jpg
    Screenshot_2012-08-28-15-09-47.jpg
    58 KB · Views: 198
Last edited:

gemarcano

Member
May 22, 2012
20
3
Worcester
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.

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
 
Last edited:

TerrorApple

Senior Member
Aug 26, 2012
416
173
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

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 ;)
 
Last edited:

nor-ric

Senior Member
Jul 9, 2012
517
86
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
 

nerd65536

Member
Jun 10, 2009
15
16
But my HDD is socket powered! Or does USB need extra power?
USB needs extra power. It doesn't matter that the HDD is socket powered. You will still need the Y adapter for USB power.

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
MHL will not work through a USB hub.

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
USB host works on rooted stock ROMS. In fact, you don't even need to root the phone to use a mouse or keyboard.
 
Last edited:
  • Like
Reactions: gemarcano

gemarcano

Member
May 22, 2012
20
3
Worcester
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
 

devgee

Senior Member
Dec 5, 2011
482
196

uniserve

Member
Jun 6, 2011
16
0
@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:
:laugh::laugh::laugh::laugh::laugh::laugh:

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?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    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:
      1. Mini USB connector - connects to the "Mini USB Female to USB A Female adapter"
      2. Male USB A Power (the thinner wire) - connects to your charger
      3. 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):
      Code:
      su
      mkdir /mnt/sdcard/usb
      mount -o uid=1000,gid=1015,fmask=0702,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb
      To unmount:
      Code:
      su
      umount /mnt/sdcard/usb
    2
    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?

    Yes with the new OTA (jb) you onli need a normal OTG cable to connect any usb device (keyboard,mouse, usb key).
    2
    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

    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 ;)
    1
    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

    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'.
    1
    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:
      1. Mini USB connector - connects to the "Mini USB Female to USB A Female adapter"
      2. Male USB A Power (the thinner wire) - connects to your charger
      3. 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):
      Code:
      su
      mkdir /mnt/sdcard/usb
      mount -o uid=1000,gid=1015,fmask=0702,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb
      To unmount:
      Code:
      su
      umount /mnt/sdcard/usb





    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