0

I'm currently trying to connect 2 USB devices together, but both ends are type A plugs.

Before I buy a physical extension cords with 2 type A receptacles, I'd like to know if I can connect these 2 devices together at all by passing data "transparently" through a Linux box with >= 2 USB ports.

I'm actually trying to connect a keyboard to an Android phone, and I want to first try if it can work by using a Linux box as a "virtual" USB extension cord.

Has anybody done something like this before?

Thanks!

3
  • 2
    What kind of devices are these? If both have A type plugs they are probably both normal USB devices. You cannot connect them directly anyway, since you always need to have one host controller on the bus. You Linux box already is a host controller, no special setup needed. If however one device acts as a host controller itself, you cannot connect it to another one (your Linux box). I am not aware of a possibility to put a host controller into device mode. Jul 7, 2012 at 14:13
  • @GurkenPapst I actually want to connect a keyboard to an Android phone, but I haven't bought a keyboard with a micro-USB plug yet, so I guess I'll first try it using a Linux box as a "virtual" extension cord. Jul 7, 2012 at 14:22
  • 1
    Does the ROM (and hardware) on your Android phone allow it to run as a host controller/does it support USB On-The-Go? Does the ROM support external USB keyboards? This would be a prerequisite for a direct connection anyway. Since these requirements might not be met, it perhaps will not work this way. It however might be possible to use a external keyboard connected to another system on the phone by using the debugging capabilities built into the phone, but I guess this would be no easy solution. Jul 7, 2012 at 15:00

2 Answers 2

2

No matter how you look at it, electrically or from software, two devices attached to a Linux host is totally different from connecting them to each other. You will learn nothing useful from the experiment. (As Gurken mentioned, you need your phone to be capable of host mode, and have the right drivers for a USB HID keyboard. Neither of these will be tested by your proposed test.)

2
  • 1
    Host-side and peripheral-side USB are different hardware. The keyboard implements peripheral-side interface and expects to be connected to a host-side interface. The USB ports on phones are peripheral side. Peripheral-side to peripheral-side will NOT work.
    – LawrenceC
    Jul 9, 2012 at 20:41
  • 1
    @ultrasawblade: USB ports on smartphones are often "USB On-The-Go (OTG)" controllers that can switch between peripheral and host modes. But he won't find that out by plugging his phone into a Linux computer.
    – Ben Voigt
    Jul 9, 2012 at 20:44
2

Unfortunately, this experiment you're thinking of is likely to fail because the Android won't be able to recognize the keyboard. It might be better to just buy a cheap wireless bluetooth keyboard from amazon ~$30. That is pretty much guaranteed to work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .