←back to thread

20 points WorldDev | 1 comments | | HN request time: 0.205s | source

I want to build a little device that connects two computers together via usb, and send keystrokes from one to the other.

(I would use it to use a laptop keyboard on a headless computers).

I am looking for an easy solution, it does not have to be the cheapest.

ChatGPT points me to Arduino, but as far as I can see, there's no arduino with 2 usb ports. It also points me to Raspery pi zero, but that's a computer, not a microcontroller, so not sure if it's suitable.

If anyone with experience can give me some pointers, it would be greatly appreciated!

1. wiml ◴[] No.45706692[source]
Would a KVM switch do what you need? Or virtualizing the second machine's usb port in some way? Is there any kind of existing IPMI/ILO/etc functionality in the target machine that you could use?

If not: You need something that can act as a usb "device" (the "host" and "device" sides of a usb connection are very different). A search for "usb keyboard emulator" turns up a lot of projects in that area. I'm not sure you're going to get much simpler than a pi-zero or teensy, unless you can find someone selling a pre built device that meets your needs.

If you're lucky, your laptop has a usb port that can be configured to take the "device" role instead of the usual "host" role. In that case you could probably build a software-only solution using the Linux usb "gadget" framework to make that port act like a keyboard when attached to the target's usb port.