Page 1 of 1

RPi 3 as Windows 10 HID?

Posted: Sun Oct 15, 2017 6:41 pm
by Metal_Muffin
Ok, let me see if I can explain:

I have a Pi3 with the Pi 7 inch capacitive touch screen. I am using Python and Kivy to create a GUI that I would like to send key-presses to a windows machine as a keyboard and/or game controller. I would also like to incorporate real-world hardware (encoders, switches, LEDs) thru the GPIO. I would like this to happen via USB. I do not want to use wifi (VNC). Bluetooth would be ok if it would be the only and/or best way, but really I'd like to keep things wired for my application.

I am aware that I can not use the USB ports due to the architecture of the USB BUS, but is there some way to use the GPIO?

Should I use, say, I2C with an Arduino nano which can be loaded to act as an USB HID?

I've been struggling with this for a minute and any advice would be helpful.

Re: RPi 3 as Windows 10 HID?

Posted: Sun Oct 15, 2017 9:44 pm
by drgeoff
The voltage levels of RPi GPIOs are not directly compatible with USB even if you had software to bit bang the waveforms, decode the responses and implement a USB stack.

A more promising approach might be to get a USB to 3.3 volt serial converter. Plug the USB into the PC and connect the serial side to serial on the RPi GPIO. Agreed not HID.

Re: RPi 3 as Windows 10 HID?

Posted: Mon Oct 16, 2017 1:34 pm
by obcd
Using an arduino is indeed a good approach as you need an usb client device. If you use something like a leonardo, it can appear to the host as hid keyboard, mouse or gamepad. It can also appear as serial device. Some chinese clones are even cheaper than a ftdi serial cable. Just be carefull with the voltage levels. Most arduino's use 5V and the pi gpio's are 3V3 only.

Re: RPi 3 as Windows 10 HID?

Posted: Mon Oct 16, 2017 1:42 pm
by fredoll
Why not use a Pi Zero: it can be used as a USB gadget, I suppose HID is not too far away ?

Re: RPi 3 as Windows 10 HID?

Posted: Mon Oct 16, 2017 5:44 pm
by DirkS
fredoll wrote:
Mon Oct 16, 2017 1:42 pm
Why not use a Pi Zero: it can be used as a USB gadget, I suppose HID is not too far away ?
Indeed. I'm currently playing with a Zero in Gadget mode, using both ethernet and HID gadgets at the same time (keyword: libcomposite).
Good documentation (meaning something that I can understand ;) )is not easy to come by. though.