Hacker News new | ask | show | jobs
by zamadatix 1226 days ago
Anyone have a recommendation for something that can take 2 USB in and be the USB device to 2 separate up stream systems? I’d like to build something can pass through a keyboard and mouse to 2 systems but also embed some hot key actions and the like so it always works regardless if my preferred OS install is configured and booted.
4 comments

The Teensy is very popular for acting as either USB host or peripheral and there's lots of projects to draw ideas and code from. The latest one only has 2 physical USB ports, so you would have to use a hub for your use case. I don't think you'll find a microcontroller with 4 physical ports anyway.

https://www.pjrc.com/store/teensy41.html

Hub for the inputs is fine but I think I'd need 3 physical ports in that case - 1 for the hub and 2 for the separate outs.

However... it just occurred to me I could connect 2 together for cross signaling over the other pins and have 2 in and 2 out that way.

Another idea, STM32Fxxx...3 physical USARTS in at least some of them.

A project using it: https://github.com/satoshinm/pill_serial

Specs for one with 3 usbs: https://www.st.com/en/microcontrollers-microprocessors/stm32...

You want 2 or more off CH9350 - HID mouse/keyboard to serial adapters - they are designed for exactly your application. Wire back-to-back and piggyback an ESP of your choice on the serial ports to eavesdrop/intercept/augment. Available from Ali.
Why not have two microcontrollers, and have them talk to one another over serial?

I've never heard of a microcontroller that provided the feature you're looking for, unfortunately.

RaspberryPi can be both a USB host and a HID device. Sounds like a fun project!
I thought about a Pi running a RTOS but I couldn’t find a way to get it to be a HID device to two different computers at the same time.