USB OTG

Search This thread

SebastianFM

Senior Member
Dec 13, 2009
640
5,305
40
Warsaw
When you connect USB OTG Adapter to the phone it is switched into USB Host mode. The board of HTC Sensation isn't capable of giving power to USB peripherals, so USB Y Cable or USB Hub with external power supply is required to connect USB peripherals to the phone. You can connect different types of USB peripherals: USB Hub, USB mass storage devices (e. g. USB HDD, USB Stick, MP3 player), USB HID devices (e. g. USB mouse, USB keyboard, Wireless mouse or keyboard with USB receiver).



Requirements:


Micro USB Host OTG Cable with USB power
or
USB OTG Adapter + USB Y Cable
or
USB OTG Adapter + USB Hub with external power supply

My Overclocked kernel (v1.5.2 or newer) for HTC Sensation
My Overclocked kernel (v1.4.0 or newer) for HTC Rezound

/sdcard/usb
Create usb directory on the root of your SD card.

/system/etc/vold.fstab
If you want to enable automatic mounting of USB mass storage devices to /sdcard/usb directory by the system, you need modified vold.fstab. This file is included in my kernel package and will be updated during install.

Tested USB peripherals:

LogiLink USB Hub with 4 USB ports.
Seagate 250GB USB HDD.
Sandisk CRUZER 4 GB USB stick.
Sandisk Sansa Clip MP3 with 2 GB storage.
Logitech USB mouse.
Logitech Wireless mouse and keyboard with USB receiver.

USB mass storage devices:

If you connect USB mass storage device then first FAT/FAT32 partition (if any) will be mounted automatically to /sdcard/usb directory and Media Library will index its content. Files can be viewed using Gallery, Music or any file manager. It won't happen if other USB mass storage device already has automatically mounted partition.

You can manually mount FAT, FAT32 and NTFS partitions.
For example, to mount first, FAT/FAT32 partition to /sdcard/usb1 directory:
Code:
[b]su
mkdir /sdcard/usb1
mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb1[/b]

To mount third, NTFS partition to /sdcard/usb2 directory:
Code:
[b]su
mkdir /sdcard/usb2
mount -t ntfs -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,dmask=0702 /dev/block/sda3 /mnt/sdcard/usb2[/b]

To unmount:
su
umount /sdcard/usb1

j5hgeNarAMvmH.jpg
jTw4Hgq2oMZdj.jpg
jn6ZTAUtGd4qK.jpg

jbu4svByQnGwyd.jpg
jbyqldwAAP07rd.jpg
jUDPdYBihMbPj.jpg

jqJyl3ybHafCS.jpg


 
Last edited:

redoano

Senior Member
Jun 15, 2008
357
126
Ankara
Yessss, this is the progress we were waiting for, thanks for your work. we need external power source on hdd, but do we also need it on usb sticks?
 
Last edited:

redoano

Senior Member
Jun 15, 2008
357
126
Ankara
No problem for me :) I always carry a usb cable with me =) From now on i will carry the one also with female standard usb socket, it seems :) Can i use it with vipers?
 
Last edited:

mike2nl

Senior Member
Jul 24, 2009
3,965
670
62
Near Utrecht
Amazing and cool.
Sebastian so as allways.
But where o can get the right sensation xe cable?
Has someone a link or a hint, thank you.
 

rawrfische

Senior Member
Aug 6, 2011
547
148
California
So in theory, you could use this with a USB y-cable and a rechargeable USB battery pack, right?

/edit

I just realized you would need a USB OTG y-cable with a male and female connector at the split. I'm not even sure such a cable exists. :p
 
Last edited:

SebastianFM

Senior Member
Dec 13, 2009
640
5,305
40
Warsaw
So in theory, you could use this with a USB y-cable and a rechargeable USB battery pack, right?
Yes, there shouldn't be any differences in connecting second plug of USB Y-cable into USB charger, USB power supply, PC, car USB charger or USB battery pack.

I just realized you would need a USB OTG y-cable with a male and female connector at the split. I'm not even sure such a cable exists.
No. You need common USB Host cable (Micro USB Male <-> USB A Female). If you haven't USB HUB with external power supply, you also need USB y-cable (2 x USB A Male <-> USB Mini Male). This is standard cable used to connect USB HDD when single USB port provides insufficient power.
To connect e. g. USB Stick, you must use USB A Female to Mini USB Female Adapter at the end.
 
Last edited:

luis4ever

Senior Member
Apr 16, 2009
1,472
812
Salamanca
Not working on ViperS 1.1.0.

Phone connected to OTG Cable, USB Male-Male from OTG to HUB. Flash Memory to HUB and HUB to power. usb created in root of SdCard. Am i missing something?
 

SebastianFM

Senior Member
Dec 13, 2009
640
5,305
40
Warsaw
Not working on ViperS 1.1.0.

Phone connected to OTG Cable, USB Male-Male from OTG to HUB. Flash Memory to HUB and HUB to power. usb created in root of SdCard. Am i missing something?
On ViperS 1.1.0 files from USB storage won't be added to Media Library because this ROM is based on HTC Ville C2 ROM and it hasn't added /sdcard/usb directory to storage list. But if you connected everything correctly, USB storage should be still automatically mounted to /sdcard/usb.
Did you flash Overclocked kernel v1.5.1?
Run command ls /dev/block in Terminal Emulator and check if output contains sda and sda1. If not, send me your logcat and dmesg log.
 
Last edited:
  • Like
Reactions: luis4ever

luis4ever

Senior Member
Apr 16, 2009
1,472
812
Salamanca
Which rom are you running with Host working? Also, should i use TE with or without OTG connected?

This is what i get without OTG connected:

 
Last edited:

SebastianFM

Senior Member
Dec 13, 2009
640
5,305
40
Warsaw
Which rom are you running with Host working? Also, should i use TE with or without OTG connected?

This is what i get without OTG connected:

With connected USB OTG cable and USB peripheral.
If output doesn't contain sda and sda1:
1. Reboot your phone.
2. Connect everything after boot.
3. Run commands: logcat -d -v time > /sdcard/logcat.txt, ls -l -R /sys > /sdcard/sys.txt, dmesg > /sdcard/dmesg.txt in Terminal Emulator.
4. Send me or upload these three files from your SD card.
 

luis4ever

Senior Member
Apr 16, 2009
1,472
812
Salamanca
I have been waiting for this months.....I'm gonna try this for sure....

Any link for buying the cable.?
Sent from my GT-I9100 using Tapatalk 2

You don't need that cable. Just use a Micro USB with 5 pin to USB Male, an adapter with 2 USB Female, an USB cable with both male and a HUB. Connect Micro USB to phone(be sure it has 5 pin), connect the adapter to Female. Then connect the Male-Male cable to adapter and HUB. Connect USB or keyboard and HUB to power. You will need more cables but they are a lot easier to find than a 2 Male-1 Female.
 
  • Like
Reactions: jazzzzzzz

luis4ever

Senior Member
Apr 16, 2009
1,472
812
Salamanca
Can we use sensations USB data cable as the 5 pin cable to USB male???

Sent from my HTC Sensation Z710e using Tapatalk 2

Do you mean the original cable that came with HTC's? At least my USB cable has 4 pin only. BB cables have 5 pin we need. This is the same config i use for the One S. Original not works and BB ones work.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 85
    When you connect USB OTG Adapter to the phone it is switched into USB Host mode. The board of HTC Sensation isn't capable of giving power to USB peripherals, so USB Y Cable or USB Hub with external power supply is required to connect USB peripherals to the phone. You can connect different types of USB peripherals: USB Hub, USB mass storage devices (e. g. USB HDD, USB Stick, MP3 player), USB HID devices (e. g. USB mouse, USB keyboard, Wireless mouse or keyboard with USB receiver).



    Requirements:


    Micro USB Host OTG Cable with USB power
    or
    USB OTG Adapter + USB Y Cable
    or
    USB OTG Adapter + USB Hub with external power supply

    My Overclocked kernel (v1.5.2 or newer) for HTC Sensation
    My Overclocked kernel (v1.4.0 or newer) for HTC Rezound

    /sdcard/usb
    Create usb directory on the root of your SD card.

    /system/etc/vold.fstab
    If you want to enable automatic mounting of USB mass storage devices to /sdcard/usb directory by the system, you need modified vold.fstab. This file is included in my kernel package and will be updated during install.

    Tested USB peripherals:

    LogiLink USB Hub with 4 USB ports.
    Seagate 250GB USB HDD.
    Sandisk CRUZER 4 GB USB stick.
    Sandisk Sansa Clip MP3 with 2 GB storage.
    Logitech USB mouse.
    Logitech Wireless mouse and keyboard with USB receiver.

    USB mass storage devices:

    If you connect USB mass storage device then first FAT/FAT32 partition (if any) will be mounted automatically to /sdcard/usb directory and Media Library will index its content. Files can be viewed using Gallery, Music or any file manager. It won't happen if other USB mass storage device already has automatically mounted partition.

    You can manually mount FAT, FAT32 and NTFS partitions.
    For example, to mount first, FAT/FAT32 partition to /sdcard/usb1 directory:
    Code:
    [b]su
    mkdir /sdcard/usb1
    mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb1[/b]

    To mount third, NTFS partition to /sdcard/usb2 directory:
    Code:
    [b]su
    mkdir /sdcard/usb2
    mount -t ntfs -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,dmask=0702 /dev/block/sda3 /mnt/sdcard/usb2[/b]

    To unmount:
    su
    umount /sdcard/usb1

    j5hgeNarAMvmH.jpg
    jTw4Hgq2oMZdj.jpg
    jn6ZTAUtGd4qK.jpg

    jbu4svByQnGwyd.jpg
    jbyqldwAAP07rd.jpg
    jUDPdYBihMbPj.jpg

    jqJyl3ybHafCS.jpg


    7
    Yessss, this is the development we were waiting for, thanks for your work. we need external power source on hdd, but do we also need it on usb sticks?
    Unfortunatelly yes. But there is one advantage of this, it saves battery. ;)
    5
    I had asked that yesterday too, but still no answer right now ;)
    You don't need any rare cables. Every USB OTG Adapter with Micro USB Male and USB A Female should work.
    There are several ways to connect USB peripherals to USB OTG Adapter, I'll describe this later in more detail.

    I found Micro USB Host OTG Cable With USB power which probably could replace both USB OTG Adapter and USB Y Cable.

    I know that many of HTC Sensation owners already uses the USB OTG, please give some feedback to the others.

    I'm still working on USB OTG. Next version of my kernel will support HID devices.
    I succesfully connected at the same time: 250 GB USB HDD, 8 GB USB stick, USB mouse, Logitech wireless keyboard and mouse with USB receiver using USB OTG Adapter and USB Hub with external power supply.
    4
    @Sebastian:

    Hi Sebastian,
    here a link (wiki, not leaks :laugh:) with more information about USB on the go. Possible something what you can add to the 1st posting.
    Then the users can't ask again about some specific OTG things *lol.

    In anyway very helpfull and some external links...

    Link Updates:
    link -> Plug and Receptacle Pinouts
    XDA link -> HowTo making of OTG cable
    external link -> HowTo making of OTG cable (my favior because the switch ;))
    external link -> specific technican info from maxim-ic
    google images link -> some nice graphical info
    external link -> info about USB devices running on OTG


    Adapter Info:
    DIY-OTG-Adapter-&-DIY-OTG-Y-Adapter.gif
    3
    is the open sensation kernel compatiable with the cm10 beta? (please excuse me if that is stupid :eek:) if not how would we approach getting a aosp kernel that can do this? aside from hope :p
    It should. But the OS kernel is not available as a standalone zip. I'll release my updated AOSP kernel later (based on the newly released 3.0.40, hopefully with the required USB-OTG changes). Currently compiling it. Release will be announced via twitter.