13

Does the Raspberry Pi model B+ have the capabilities of acting as a Human Interface Device (HID) with no extra hardware (other than a USB to USB cable)?

I saw this question but it was about capturing output from the computer. My goal would be to trick a computer into thinking a mouse/keyboard is attached and send key presses or mouse clicks. Any ideas?

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147
NULL
  • 2,240
  • 8
  • 28
  • 49

2 Answers2

7

Even though the USB port of the RPi is technically an On-the-go (OTG) chip that should support both a reduced set of host and client functionality (and could therefore play the role of an USB slave such as an HID) the B/B+ type of the RPi does not support the device mode. That is related to the included USB hub and the fact that the ethernet is tunneled through USB (see).

But... the Human Interface Devices (HID) only need the USB 1.1 Low Speed with 1.5 MBit/s data rate (well almost they say). So there are many solutions out there that use software based USB stacks to emulate an USB device. Those examples typically use microcontrollers that are way less "powerful" than the RaspberryPi (but of course they also have a significantly lower overhead). Examples include the Igor Plug (an IR remote control receiver based on an Atmel microcontroller) or microcontroller based "fake" keyboards or "key loggers".

If we believe How fast is GPIO+DMA? Multi I2S input then 1.5 MBit/s should be possible on the GPIO with DMA.

Ghanima
  • 15,958
  • 17
  • 65
  • 125
0

This can be done with ANY kind of Pi

The least-expensive solution is to use the Pi Zero.

The text of this link is way too long to post here, but the Zero can be any kind of HID. Keyboard, mouse, flash drive, camera, whatever you can think of.

Turning your Raspberry PI Zero into a USB Gadget

enter image description here

Making it a keyboard or mouse is easy.

SDsolar
  • 2,378
  • 8
  • 26
  • 43