USB Host mode on Motorola Droid

Yes, it’s true – Android (at long last!) has access to USB Host mode. I had been waiting for this to happen on the Nexus 1 or N900 some time soon, but as it turns out it’s the Droid that takes the crown. It’s a neat little hack that I heard about at Shmoocon; I’d like to thank to Mike Kershaw from Kismet and Mike Baker from OpenWRT for sharing :) Here’s how it works.

The USB hardware on the Droid is actually capable of USB-OTG (meaning that it can act as both host and peripheral), however it only possesses a standard USB Micro-B port instead of the Micro-AB port that you would normally get from an OTG device (such as the N810). With a minimal amount of effort (and tolerance of a few bugs) it’s possible to enable the B port as a host interface (as OTG says you should be able to do), meaning it supplies power and acts as the bus controller. It’s actually pretty easy; I can easily think of about a hundred million ways to make this useful on the Droid (think: plug any USB hardware you like into your Droid, as long as it works in Linux it should work in Android).

You’ll need to make two things, a micro-dongle to enable the port (you plug it in during boot time) and a cable with the right connectors on each end (for connecting your peripheral). To do this you’ll need three cables:
- A car charging cable (off-the-shelf at the Verizon store)
- A Micro-USB cable (as above)
- A USB extender cable (the teeny ones that sometimes come free with USB keys work great)

Start with the car charging cable. Break open the micro-usb connector (it comes apart fairly easily) and look at the little PCB inside – there should be a single tiny surface-mount resistor and two wires from the charger cable. Unsolder both wires and the resistor, and then bridge the pads where the resistor used to be so that it’s completely shorted. The end result should look something like this:


This is your micro-dongle.

Next up, you need to make your connector cable. Cut the end off the USB extender cable, you want to keep the socket end and discard the plug. Cut the micro-usb cable as well, but on this one you want to keep the plug and discard the socket. You should now have a micro-usb plug that’ll fit into your droid and a usb socket that you could plug a memory stick into. Strip the wires off the ends of both cables and join them to each other, connecting like colours (and the shield) together. When it’s finished it should look something like this:


(You’ll obviously want to insulate the wires afterwards, this is just to show how the colours are connected).

You don’t even need to root your droid in order to verify it works (although I rooted mine using the instructions here anyway), just do the following:
- Turn your Droid off
- Plug the micro-dongle into the USB port
- Turn the droid on
- Unplug the micro-dongle as soon as the Motorola logo disappears (as the Droid lodo is appearing).
Once your Droid is booted, pull up a terminal and look at dmesg – after plugging in your USB peripheral using the cable you made earlier you should see the usual kernel notifications about new USB devices being connected; they’ll also turn on (or start charging) if they’re powered by USB. You’ll only be able to plug in one peripheral before the port reverts to peripheral mode; you’ll have to reboot with the micro-dongle if you want to go back into host mode. Also, if you leave the micro-dongle plugged in too long it triggers another bug, the port gets stuck supplying power to devices but not actually recognising them. Hopefully the drivers are sufficiently open-source that these are easy bugs to squash, and that dynamically switching between host mode and peripheral mode won’t be too hard to add either.

Unsurprisingly there’s not much driver support for USB peripherals in the standard Android kernel (I couldn’t mount a USB key for example), but it’s easy enough for the ROM developers to start adding drivers – I’ll be flashing Sholes shortly to see how it does. Expect to see a whole new generation of Android hackery to start soon :)

//edit: Andrew de Quincey has apparently also gotten Host mode working on the Hero, and pointed out that while the stock Android kernel may not support USB storage it does support USB keyboards. Plugging one into my Droid using the steps above, it Just Works. It’s kinda nice to have a proper keyboard on a cellphone…:)

Be Sociable, Share!

25 Responses to USB Host mode on Motorola Droid

  1. l3reak says:

    Freakin’ amazing! This is something that I thought was impossible that I had completely given up on. Does this mean it would be possible in the future to use USB gaming controllers for games on the Droid?

    This may be the killer app that finally gets me to root & start playing with custom roms.

    • Chris says:

      Very much so, and I’ve confirmed that keyboards work already. You don’t even need to root your Droid to plug in an external keyboard, just make a micro-dongle and buy or build a connector cable (I’m checking out a few places for suitable off-the-shelf parts tomorrow).

  2. adq says:

    Fantastic! In a massive coincidence, I got my usb host mode driver for the MSM7201 based android phones (Hero,G1 etc) working yesterday evening too! I even have usb storage working ;-P

    See http://adq.livejournal.com/

  3. zcar300 says:

    I’m not sure this would work but…
    If you installed a LED on your hacked micro USB dongle, it might blink on and off as the OS loads. This would give us a more accurate method for timing. So people can unplug the dongle at the appropriate time.

    • Chris says:

      I watched it with a voltmeter and it actually goes up and down a lot, hovering around 3.3v for most of the boot sequence. I’ll hook up an oscilloscope and record a trace of the boot sequence as it appears as a voltage on the USB port, and post an update in a few days.

  4. RussNelson says:

    what does shorting out the resistor do? Is that a documented part of the USB OTG spec?

    • Chris says:

      There’s a special pin in the USB connector that’s used to identify the type of cable. 0 ohms is one value it accepts, there’s a few others listed here.

  5. weirdia says:

    Does that mean other Android hardware like Nexus One dot not support USB-OTA?

  6. Chris says:

    Gahhh, and WordPress has lost all sense of threading. The first was re: RussNelson, the second was re: l3reak and the third was re: zcar300 :)

  7. BloodCoder says:

    I wonder if the Samsung Moment hardware supports this. It would be great to design and build a docking station that would allow me to plug my keyboard into my Samsung Moment.

  8. EmilianM says:

    Congratulation Chris..that this a very nice idea…

    Instead of creating that patched cable do you think that a battery hub like this one that can change the gender of the USB, can be use instead ?

    [url]http://www.everfast.com.hk/catalog/usb-hub-battery-charger-usb-hub-4-ports-p-138.html[/url]

    PS: it has also battery based charging capabilities
    PS: also a detailed tutorial with off-the-shelf components will be very nice!

  9. gowthamj says:

    what usb keyboard did you use. Coz i have not been able to get anything working in the usb host mode. All i get are musb errors on the DROID.

  10. gowthamj says:

    These are the errors i am running into with the DROID in usb host mode, http://alldroid.org/viewtopic.php?f=222&t=1228&start=20

  11. royalcs says:

    wich pins are shorted on the micro-dongle? anybody tried this on the milestone yet?

  12. kchow84 says:

    Great find! Now, I’m not so great with this type of thing yet, but would something like this do in-place of your homemade cable: http://tinyurl.com/ycdcl7n? Thanks!

  13. kchow84 says:

    sorry, http://tinyurl.com/ycdcl7n without the question mark

  14. zcar300 says:

    What would happen if you used one of these on the go cables you see everywhere? Would you have to have it and the device plugged in while the droid boots? Here’s a cable like I’m talking about. http://www.brightonnet.co.jp/english/product/other/bbm-wireel.html

    • Chris says:

      Be careful – that cable appears to have the A connector that’s normally required for OTG to operate in host mode. I doubt that this cable would work, you need one with a B connector to fit the socket on the Droid.

  15. Kamilion says:

    Got some of these on order right now; I’ll give them a shot when they arrive.
    http://www.dealextreme.com/details.dx/sku.26783

  16. xanxitto says:

    Ok guys I have a question.. I’ve been researching about this topic and I came across this Blog. My question is, will this cable from motorola work for this Hack?
    http://www.store.motorola.com/mot/en/US/adirect/motorola;jsessionid=DD673335659C437821A85B6905C01280.mot2?cmd=catProductDetail&entryPoint=adirect&productID=SKN6252A&messageType=catProductDetail&showAddButton=true
    To me its the same as the one you hand made. Now, do you guys think I still have to make the Micro-Dongle for this hack to work if I buy that cable? I’m so down to do whatever for this to work. I just need opinions before I order that cable.
    Thanks.

  17. Stormwing says:

    Would that N810 cable that gowthamj posted or kchow’s thing work? I really want to get this working soon but I really don’t know how and haven’t soldered before. How is the dongle made (should I just make it look exactly like that photo)?

  18. gowthamj says:

    I was able to modify Chris idea and make one cable instead of a dangle and a cable. http://sites.google.com/a/gowthamj.com/www/

  19. rizdroid says:

    Followed Gowthamj instructions… thx… it works w/ Milestone: http://twitpic.com/1z54p6 Cheers, @RizDroid