[kwlug-disc] Emulating USB keyboard using ???

Andrew Kohlsmith (mailing lists account) aklists at mixdown.ca
Sat Dec 5 11:46:26 EST 2015


> On Dec 5, 2015, at 11:12 AM, William Park <opengeometry at yahoo.ca> wrote:
> Do you know a way to emulate a USB keyboard using Raspberry Pi,
> BeagleBone Black, ODROID, or some other embedded board?  That is, as far
> as PC is concerned, it's receiving keypresses from some keyboard.

The USB ports on BBB/RPi are host ports, so what you’re after isn’t possible. The SoC itself has OTG capability but the way it’s wired removes the possibility.

Depending on how far down the rabbit hole you want to go, you could always take a little PIC/AVR or ARM and configure *it* to show up as a HID device and then talk to it with the RPi/BBB over serial.

Not ideal, but reasonably fast time to implementation.

> I know those boards have UART pins.  But, even if I connect the pins to
> a serial-to-USB cable, the USB end of the cable will show up as serial
> (/dev/ttyUSBx) and not as keyboard.  I have such a cable, and that's
> what I see.

Correct, because the device (FT232 or whatever)’s descriptors describe it as a serial port, and it implements the endpoints of a serial device.

Some devices which you can get to do this (with various levels of functionality):
https://www.maximintegrated.com/en/products/interface/controllers-expanders/DS3900H2EVKIT.html
https://www.tindie.com/products/eStop_Robotics/custom-control-interface-cci/
https://www.tindie.com/products/bobricius/picoduino/
https://www.sparkfun.com/tutorials/337

If you’ve already got an Arduino: https://www.pjrc.com/teensy/td_keyboard.html

-A.






More information about the kwlug-disc mailing list