Ask HN: Advice for creating a USB device linking 2 computers
11–20 of 46 posts
Re: Ask HN: Advice for creating a USB device linking 2 computers
#12Using Zig to Unit-Test a C Application (2023) - https://mtlynch.io/notes/zig-unit-test-c/
Re: Ask HN: Advice for creating a USB device linking 2 computers
#13On the hardware side, it probably has what you need (and more).
Re: Ask HN: Advice for creating a USB device linking 2 computers
#14Re: Ask HN: Advice for creating a USB device linking 2 computers
#15Re: Ask HN: Advice for creating a USB device linking 2 computers
#16The 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
#17Easy way is probably two usb-serial dongles and a null modem, if you don't need huge amounts of throughput.
Re: Ask HN: Advice for creating a USB device linking 2 computers
#18If 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
#19Re: Ask HN: Advice for creating a USB device linking 2 computers
#20You'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