zer02
Posts: 11
Joined: Mon Mar 14, 2016 2:20 am

Can I "passthrough" a keyboard (act as keyboard) on an Rpi

Fri May 25, 2018 8:34 am

Hello,

I would like to achieve following.
Rpi or (Rpi Zero) acting as USB device, I have read some articles about the zero being able to emulate as USB device, but it only has 1 USB port.

Can the Rpi do the same?

Image

User avatar
DougieLawson
Posts: 32720
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Can I "passthrough" a keyboard (act as keyboard) on an Rpi

Fri May 25, 2018 8:49 am

Not possible. The USB ports on a RPi are all host ports. To be a HID device you need a USB slave.

Use ssh with port forwarding.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

zer02
Posts: 11
Joined: Mon Mar 14, 2016 2:20 am

Re: Can I "passthrough" a keyboard (act as keyboard) on an Rpi

Fri May 25, 2018 8:56 am

DougieLawson wrote:
Fri May 25, 2018 8:49 am
Not possible. The USB ports on a RPi are all host ports. To be a HID device you need a USB slave.

Use ssh with port forwarding.
I guessed some how.

The zero allows slave port. But can I use the GPIO Usb to connectors to my "Physical Keyboard" ? I will use the USB data port as USB Slave. Or is there any PCB out there that can do such thing easier? Thanks

hippy
Posts: 3046
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Can I "passthrough" a keyboard (act as keyboard) on an Rpi

Fri May 25, 2018 10:52 am

You should be able to use two Pi Zeroes; one as a USB Host handling the physical keyboard, the other as a USB Device acting as a virtual keyboard for whatever it plugs into. The data could be passed between the two using UART serial easily enough and other GPIO mechanisms could work.

Turning that point-to-point serial link into a multi-drop or token-ting style configuration should allow multiple Hosts and Devices. All sorts of USB switching, routing and patching should be possible.

n67
Posts: 697
Joined: Mon Oct 30, 2017 4:55 pm

Re: Can I "passthrough" a keyboard (act as keyboard) on an Rpi

Fri May 25, 2018 11:27 am

DougieLawson wrote:
Fri May 25, 2018 8:49 am
Not possible. The USB ports on a RPi are all host ports. To be a HID device you need a USB slave.

Use ssh with port forwarding.
What does ssh have to do with anything???

https://www.youtube.com/watch?v=oGpFcHTxjZs
"L'enfer, c'est les autres"

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 12 guests