USB Peripheral hack

Discussion in 'Android General Discussions' started by cyber3d, Feb 11, 2010.

  1. cyber3d

    cyber3d Member

    Joined:
    Dec 12, 2009
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    Before you blast me for posting this - I did do a search on the forum.:icon_ banana:
    Second is a companion article
    And at the bottom is the original article



    Droid Hack Lets You Plug Peripherals Into Your Phone

    Alessondra Springmann, PCWorld
    Feb 10, 2010 8:59 pm
    [​IMG]
    Hacker Chris Paget figured out how to enable USB host mode on the Motorola Droid, a smartphone running the Google Android operating system.
    What's so special about USB host mode? Most smartphones and MP3 players, including the Droid, are designed to be passive devices and only act as peripherals when plugged into a host computer. But the USB On-The-Go (OTG) specification lets phones serve as the host device--supplying power and acting as a bus controller--for other peripherals, including other smartphones. This new hacks lets your phone be a host to a variety of devices, and you don't even need to root your Droid for this purely-hardware hack to work!
    To get your Motorola Droid to work as a host for other peripherals you'll need three cables: a car charging cable, a Micro USB cable, and a USB extender cable, all readily available at a Verizon store or a local electronics store. Once you've spliced, soldered, removed a resistor, and plugged the resulting FrankenCable to your phone, all you have to do is reboot and type one command into terminal to start having peripherals be recognized by your Droid.
    In addition to host mode working on the Droid, other hackers have extended USB OTG capabilities to other smartphones: Andrew de Quincey showed that you can plug a USB keyboards into the HTC Hero. While the Android kernel at present doesn't have a lot of support for peripherals, perhaps ROM developers will start adding USB drivers to their software.
    What sort of peripherals are you planning on plugging into your Droid now that you can get it to work as a USB host?



    AND THIS

    USB host mode for Droid

    posted Feb 10th 2010 12:00pm by Mike Szczys
    filed under: android hacks, cellphones hacks
    [​IMG]
    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]


    THE ORIGINAL ARTICLE

    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 [​IMG] 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:
    [​IMG]
    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:
    [​IMG]
    (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 [​IMG]
    //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…:)
    This entry was posted on Tuesday, February 9th, 2010 at 6:05 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
     
    #1 cyber3d, Feb 11, 2010
    Last edited: Feb 11, 2010
  2. jhilgart

    jhilgart New Member

    Joined:
    Jan 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    San Diego, CA
    Ratings:
    +0
    Yess!!!! I posted another thread here asking how I could connect my droid to a camera in order to view the files on an SD card(or through a USB SD card reader) and I think this may work after some tweaking...

    I have a few questions...this blurb was pulled from the article:
    "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."
    So....As soon as you plug in one feature/peripheral device(i.e. keyboard, USB stick, etc...), it sounds like the phones USB port will revert to peripheral mode where it can then be charged normally once you disconnect your attached peripheral device(keyboard, USB etc...)?

    Also, correct me if I'm wrong but it appears that if you have a Y cable you can power both the phone and the peripheral feature? once in host mode? Here is a link to an article about connecting the Y cable, keyboard, and battery pack. Also he talks about loading a custom kernel to enable USB functionality on his HTC but sounds like its very similar.

    Also, here is another great page about different connectors and where to purchase them: Specialized USB cables - Openmoko

    How hard would it be to create an app that enables/disables the phone to USB host mode or is this more of a hardware issue?
     
  3. chuck54

    chuck54 Member

    Joined:
    Sep 7, 2011
    Messages:
    121
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    Does this work on the droid x? this would be stellar !!!!!!!!
     
  4. chuck54

    chuck54 Member

    Joined:
    Sep 7, 2011
    Messages:
    121
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    Has this developing continued since then? Would love to see this come out for the bionic also....
     
Search tags for this page
android slide
,
android usb peripheral tool
,
droid razr usb host
,

droid slide

,
droids that slide
,
hack usb port smartphon
,
hacking peripherals to get
,
how to enable usb host mode motorola droid mini
,
micro usb camera android
,

micro usb camera for android