KVM over IP? Using Zig to Unit-Test a C Application (2023) - https://mtlynch.io/notes/zig-unit-test-c/
Ask HN: Advice for creating a USB device linking 2 computers
21–30 of 46 posts
Re: Ask HN: Advice for creating a USB device linking 2 computers
#22Earlier quoted context omitted.
I'm confused, why do you want hardware and what do you want the hardware to do? And, why not use a USB keyboard? You could use an rpi pico. It has a usb port and there is a software hack to bit bang a second usb port, iirc.
I am wondering if connecting over USB is an XY problem.
To go one step higher, I am trying to control a mac mini from the keyboard of a macBook.
Re: Ask HN: Advice for creating a USB device linking 2 computers
#23I 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 d…
Re: Ask HN: Advice for creating a USB device linking 2 computers
#24Easy 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
#25I 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 d…
That's absolutely fair, and I am fine with writing software for both computers. However, I need this software to not go via the network at all.
The one carve out I'd make: if you want to minimize the configuration at the target device, it ought be possible to make a rpi0 device that outputs a usb-gadget keyboard. Continue using one of these IP based software systems to send input to the rpi0, then usb-gadget it out to the target device.
The btkbdd project also might be up your alley: if the target system has bluetooth or can have a (very cheap!) usbbluetooth adapter added, making the laptop just send a bluetooth HID to the other device is probably one of the lowest configuration most standard paths available for this work.
Re: Ask HN: Advice for creating a USB device linking 2 computers
#26Earlier quoted context omitted.
That's absolutely fair, and I am fine with writing software for both computers. However, I need this software to not go via the network at all.
I'd still 100% recommend using ethernet, with two usb ethernet adapters on each end and a cable in-between to direct link the two. It's the most standard easiest to acquire way to link two computers, and it doesn't require any other network to work. Using more bespoke hardware is only going to make this more difficult. Using usb serial would also be acceptable I suppose, and require a little less configuration effort…
I am fine with having quite a bit of configuration on the target device (I am fine with configuration on both sides).
> it ought be possible to make a rpi0 device that outputs a usb-gadget keyboard
I like very much the idea of being able to make the host side (macBook) appear as a usb-gadget keyboard. That way I would just need to plug a single usb cable between the 2 computers. Could you give me a few pointers to get started, to do this on macOS?
Re: Ask HN: Advice for creating a USB device linking 2 computers
#27It sounds like you might want a device like a Bash Bunny or Rubber Ducky?
Re: Ask HN: Advice for creating a USB device linking 2 computers
#28After each newline, you are the "device" in the middle that unplugs the USB from the source computer and plugs it in to the destination computer.
Now we want to automate the middle, but without networking. How to do that?
See also Logitech Flow keyboard (and mouse). After each batch of commands, communicate via the shared clipboard.
Re: Ask HN: Advice for creating a USB device linking 2 computers
#29Earlier quoted context omitted.
I am wondering if connecting over USB is an XY problem.
To try and clarify a bit: I am essentially trying to have a KM (KVM without the V) over USB. To go one step higher, I am trying to control a mac mini from the keyboard of a macBook.
Re: Ask HN: Advice for creating a USB device linking 2 computers
#30Raspberry Pi definitely works! I have a project you can take a look at; you'll have to modify it slightly since you want a keyboard rather than a joystick, but they're both HID so the majority of it should work pretty much out of the box: https://github.com/saulrh/composite-joystick .