USB host mode for Droid

There’s a simple hack to use your Motorola Droid phone as a USB host. It is a hardware-only hack that doesn’t require you to crack open your phone, root it, or even to change firmware (although device drivers in the stock Android image may be quite limited). The dongle above is used as a key to enable the mode while the phone is booting. This was repurposed from a car charging cable by removing the wires and resistor and shorting the resistor pads. Once the phone is in host mode the dongle is swapped for a simple USB-mini to USB-A socket adapter, built from two cables you probably have lying around. Now you can plug in any device you want.

[Thanks Freezer90]

Comments

  1. lowlysoundtech says:

    so are we talking input peripherals here or maybe external HDs, USB thumb sticks? Ideas?

  2. taylor says:

    Is this just a USB On-The-Go cable?
    USB OTG is an interface that never really got much steam, but it allows a device, such as a phone, to act as both a host or a slave, depending on what is plugged in. It indicates that to the device by shorting together two pins on the 5 pin plug.
    I just bought a USB OTG cable last week for a Windows CE handheld i am working on. Got it here:

    http://www.lindy-usa.com/2m-usb-otg-cable-transparent-type-mini-a-to-mini-b/31634.html

    Of course, sadly, i think the droid is Micro USB, isn’t it?

    And I did notice that it plugs into my G1 (USB OTG is shaped differently and won’t plug into a normal USB mini jack, to avoid confusion), I wonder if it has this mode?

    I’ll try it out and report back, but work is busy so I don’t know when that will be!
    -Taylor

  3. MS3FGX says:

    You could use any USB device, but Android doesn’t have software support for anything (obviously, as the phone was never intended to be used this way). The idea is that alternate ROMs could add kernel modules for basic devices like USB storage and HID.

    Interesting how simple this is, but a shame it needs to be redone every time you want to connect another device. Sort of kills any practical use, though maybe that can be fixed in software as well.

  4. cde says:

    Just the droid? No G1 Love? Frak.

    Anyway, while this turns on USB Host mode, does Stock android do anything with it? Can you plug in a flash drive and will Android mount it automatically?

    Wouldn’t you need a rooted device to be able to use it?

    From the article.
    //Unsurprisingly there’s not much driver support for USB peripherals in the standard Android kernel (I couldn’t mount a USB key for example)//

    Useless without root, unless you want to charge something FROM your already low capacity phone battery.

    On a more positive note, instead of hacking up an ugly cable.

    http://www.dealextreme.com/details.dx/sku.28991

    http://www.dealextreme.com/details.dx/sku.26783

    A dollar and change each for a molded piece that you can use instead.

  5. Sahal says:

    can someone figure this out for the palm devices? i.e.: pre and pixi? i was actually just hoping for something like this about 3 hours ago, then i saw this, and i was like “d00d!”

  6. taylor says:

    Update: I read TFA, and yes, it is USB OTG. I tried with with my G1, but after reading the article saw that it doesn’t work with *anything*, so I had no indication of if it worked.

    The article says to “use dmesg” in a terminal, so i typed dmesg, but got a *lot* of text and don’t have time to really mess with it right now, so I don’t know if it worked.

    If someone gives me more clear instructions on what to do to verify it works, i can use my factory USB OTG cable to test it with a G1.

    I’ll check back here for any responses. I would love to be a part of discovering some of this functionality.

    Thanks,
    -Taylor

  7. MS3FGX says:

    Plug something in, and then read the last ~10 lines shown by “dmesg”. If the kernel shows messages about a new device being connected, then it works.

  8. barry99705 says:

    @Sahal
    People still buy Palm devices?? ;)

  9. andrew says:

    Or, alternatively to what taylor wrote, type dmesg and look at the last 10 lines or so, plug in the device, then type dmesg again to see if anything new appears.

  10. cde says:

    @ Taylor. Plug something in, and see if it powers on. Try a flash drive with an LED. Led lights, USB OTG is enabled (Atleast powering the port)

  11. Sahal says:

    @barry99705 you know what? Go die. Right now. Lol, jk

    I AM A PALM FANBOI AND PROUD OF IT!
    it is second only to mac products (sans ipad)!

  12. Mr_Bishop says:

    This is why I love the Droid as much as I do, I like the Nexus One too but other then tech specs (CPU,RAM,Screen tech)I consider the Droid better. I my only real complaint is the lack of front facing web cam, wheres the video chat love people? (But now that might be solvable although not so pretty)

  13. giskard says:

    @cde

    wow. I thought usb A male-male cables were bad. The standard faries are crying at those abominations.

  14. taylor says:

    So, so far I’ve been unable to get my G1 to indicate anything. I tried a variety of methods and none got the LED on my little hub to light up.

    I tried doing it like the article suggests – connecting the USB OTG cable at boot – when the G1 logo shows, but disconnecting it when the android logo shows, and then reconnecting it when booted. – No LED.

    I also tried leaving it connected the whole time during boot. No LED.

    I tried leaving the cable connected but not the hub, and then plugging in the hub after the system booted. No LED.

    I’ll mess with it some more, but this one might be something the kernel hackers have to figure out.
    -Taylor

  15. taylor says:

    Oh, and i also tried looking at dmesg but obviously since I didn’t even get power on my hub, I didn’t see anything. I’d try it without the hub, but I don’t have many slave devices that take a mini USB, which is what my USB OTG cable gives me.
    -Taylor

  16. cde says:

    @ Giskard, the standard faeries created OTG in the first place :P

  17. MS3FGX says:

    @taylor
    Is there some reason you think the G1 is actually capable of this in the first place? If you read the article he mentions that the Droid’s USB controller specifically is capable of USB-OTG, it just isn’t utilized by default.

    There is no obvious reason to assume the G1 is the same, and I would seriously doubt they share any hardware components, considering the time between their development and different manufacturers.

  18. drew says:

    @cde

    I don’t think those adapters will work for the droid – they’re mini usb, not micro. This one should work though:

    http://www.dealextreme.com/details.dx/sku.2646

    Although, that site had some rather sketchy stuff on it: USB firewire “adapter” cable, VGA NTSC cable (w/audio!)

  19. drew says:

    aww, it removed my arrows. that should read “USB to firewire” and “VGA to NTSC”

  20. taylor says:

    @MS3FGX
    No, except that my USB OTG cable plugs into it, and according to the USB spec, that’s normally only supposed to work if its supported, but I don’t know how rigidly they enforce that, and I don’t think it applies to special connectors like HTC’s mini USB connector.

    More so than anything i just figured it would be worth a shot.

  21. adq says:

    Hi, the droid cable is very cool, but unfortunately will only work on Android phones using the TI OMAP platform, for which there is already a linux USB host driver.

    The G1/HTCHero are based on the Qualcomm MSM7201A, which currently don’t have such a host driver. However, I’m in the middle of developing one (its working now on my Hero in fact). If you’re interested in helping/testing, my kernel patches are available here:

    http://groups.google.com/group/android-kernel/browse_thread/thread/c8471573d7553331

    You’ll need a special cable which can supply power to downstream USB peripherals as I’ve not yet determined if the phone can do this.

  22. Frolix says:

    HTC Droid Eris owner here, I would love to be able to use a full size keyboard with my phone! Assuming my phone has host support, could i not simply make a male usb-A mini to female usb-A cable that has a button to briefly short the data lines together at boot? will try as soon as i can find the necessary donor cables

  23. PSN Cards says:

    Nice, I wonder how far this will go and if it will be commercialized.

  24. Terc says:

    Somewhat unrelated, but I’m wondering if there’s a way to set up a linux box to do usb hosting (browse a filesystem or folder that’s available on the Linux box from another machine through USB).

    This would be really useful for me. Hopefully someone can point me in the correct direction.

  25. py says:

    Terc
    you are looking for a “nas”
    with usb host.
    there are many ways to bulid one or buy one.
    search for freenas

  26. Terc says:

    py, thanks, but I’m actually looking for software to allow me to access files over USB from another computer into my Linux NAS. I realize we get all kinds here here at hackaday, but I know what a NAS is, I build them on a relatively regular basis.

  27. Wolfman says:

    What if I just wanted to power something, and didn’t care/need a driver? Right now I’m just playing around with tring to power an LED from the USB port of any phone. Any thoughts? (And yes, there is something more than an LED I want to power…this is just a good place to start.)

  28. Nice information, thanks… But Plz fix your RSS Feed, I can not open in my chrome browser…

  29. MTPeas says:

    Precisely what I was looking for. Thanks! One question. Once switched to Host mode, is this state stored in Droid/Android/BIOS? Or is the power up process needed everytime the Droid is restarted in order to host USB devices? Also, does the OS auto mount USB memory sticks so they are accessible from whatever file browser?

  30. Gregor Miziumski says:

    @Wolfman Did you ever get an LED to light up? I’m curious about using the USB port on my Vibrant (Galaxy S) phone as a flashlight. Not sure that any of the leads are hot.

    Thx

  31. Wolfman says:

    No, have not been able to get anything to work. The USB spec seems to allude to a way in which this could be done by shorting the two data lines…however I can’t get that to work, as it may not be implemented on all devices.

  32. Steve says:

    IS there a Way to allow my Laptop to use the Droid so I can surf the Web through the DROID. SO If I dont Have internet Connection to the Laptop but Of course I do on the Droid

  33. Andy says:

    Yes, Steve. They call it Tethering. I use “EasyTether”, and I typically get pretty good performance out of it.

    You could theoretically play an online game off it, I played CrimeCraft as a test. A little laggy, but it’s not too bad. 1-2 sec lag, maybe

    EasyTether DOES require you to spend $5 on the full version, but it’s been worth it. Consider for a moment the cost of using the Verizon tethering plan. Complete BS, not worth it unless you’re a business end-user who is always on the go.

    Just spend $5 and get it if you like it. I love it, especially when my ISP is being lame and is working on hardware in my area.

  34. Chris says:

    Actually there are a few free tethering apps out there for rooted android phones(Android Wifi Tether being the most popular). One thing to note, you wont find any tethering app in the marketplace.

  35. Mr_Bishop says:

    Thats not true, the most widely used hotspot tethering app is in the Market. Here’s a link to the DR code:

    You should note Andy Chris is right though you will need root access for virtually any tethering app that allows you to not notify your cell phone service provider.

  36. Mr_Bishop says:

    QR code*

  37. mandy says:

    Anyone know of a place to find driver support once the phone is converted to host a Usb device? I’d like to use an external video camera with a program like Ustream to stream live video. I understand how to get my droid to host a device, but it seems like I still won’t be able to access the camera once it’s connected until a driver is installed. Any ideas?

  38. Peter says:

    I am working on the same problem as Mandy, but trying just to attach an external camera to stream video to concurrently view on the screen of my Droid. External camera would have to have its own power source? Possible through Bluetooth? I am not currently as tech savvy as some of those leaving comments in this blog, so please make any information as simple as possible. thanks!

  39. razrburn says:

    According to specs as far as powering goes the host only should shove out 5v@8ma in OTG Mode.. Unless I read that wrong its far from enough for many unpowered devices like flashdrives..

  40. mandy says:

    I don’t want to give up on the idea of having an external camera which could be oriented to provide a view of whatever I’m looking at. I think I have the problem solved. The simplest solution is to use the existing cmos camera and just extend the cable. In other words, remove the camera from the phone and reconnect it with a cable long enough to allow the camera to be clipped or glued to a hat.
    I think a bluetooth connection is more desirable in a lot of ways, but I have no clue how to make that happen.
    So I bought a parts droid on ebay and took it apart. The camera and mini board consist of a ccd camera module and what appears to be a 38? pin connector. My idea is/was simple. Cut the cable which ties the ccd board to the 38 pin connector and fabricate an extension cable then plug the camera back into the testbed and see if it works.
    Unfortunately, I’ve hit a snag. The wiring in the cable is VEEERY tiny and possibly double layered. The wiring appears thinner than a sharp knife, so that the whole measurement of the connector is less than the width of my pinky nail. But someone or more likely some machine made this which makes me think someone or some machine could fabricate an extension cable.
    Does anyone here have any ideas who to consult with or how to approach solving this problem of fabricating an extension cable?

  41. Shea says:

    So I have attached an LED with a small resistor to the 5v pos and neg of a mini usb male plug and plugged it into my Droid 3, which I have read has a TI-OMAP processor. Immediately the LED came on, however nothing changes in the terminal when I type in dmesg before, and after plugging except some processor power logging (apparently the Droid 3 turns off the second core when not in use). However I have made the first mini usb cable with the shorted data cables and plugged it in. After that I pulled the cable out of the phone when the Motorola logo disappeared. Once the system finished booting I plugged in a keyboard (with mini usb adapter), and I get nothing. No changes in terminal, and oddly no power to the keyboard either. Even though it powered the LED fine. My guess is that the dongle isn’t outputting enough mA. Any thoughts?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,025 other followers