Live data from Hacker News

Ask HN: Advice for creating a USB device linking 2 computers

news.ycombinator.com

11–20 of 46 posts

Re: Ask HN: Advice for creating a USB device linking 2 computers

#11
Most keyboards run on standard ARM chips and firmware is a mini OS. Check out one of open source keyboard firmwares and you can adapt related code to run on your laptop and pretend to be keyboard over USB port. If you run Linux on laptop you maybe don't even need separate device.

Re: Ask HN: Advice for creating a USB device linking 2 computers

#16
Intuitively, connecting two computers over USB seems like it should be easy.

The reason it is not simple is USB is asymmetric. There’s one host and multiple clients. And computers are approximately always built as hosts.

But if you are going to add hardware, a pair of usb network adapters (wired (or wireless)) has the same architecture.

And you won’t have custom software below the application layer. Good luck.

Re: Ask HN: Advice for creating a USB device linking 2 computers

#18
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.

Re: Ask HN: Advice for creating a USB device linking 2 computers

#20
I don't think you can tackle this purely from a hardware side. If you want to send input from the laptop to another system, there's no kind of USB profile available to collect input from a system.

You're going to need software on the laptop to gather the input. That seems necessary. You're not going to invent a purely hardware based solution here.

Given that, I'd abandon your starting requirement of needing two usb device ports. That doesn't seem to help you out here, doesn't actually buy you much.

I'd look at the field of existing software out there that can ship input between systems. Use ethernet, wifi, or BT for connectivity if possible (perhaps via usb-ethernet adapters which are very cheap!), and if absolutely required you can build a little rpi-zero with a usb-gadget to act like a virtual keyboard. https://github.com/input-leap/input-leap https://github.com/feschber/lan-mouse https://github.com/lkundrak/btkbdd

Post reply on HN