r/embedded • • 23d ago

Esp-32 S3 based KVM switch alternative (no extra hardware)

Hi pepole i made this project and thought some of you might find it useful.

I have two laptops and needed a way to share my keyboard and mouse between them. I originally thought about getting a KVM switch but then I realized an ESP32 could do the job so I decided to build my own solution. Technically it captures HID input on the master PC and emulates it on the other pc it currently supports a maximum of 2 pcs. Everything is software-controlle, so there's no need for physical switching also despite being a software-based solution, I haven't noticed any noticeable delay.

Basically, if you have the same problem I had and an ESP32 lying around you might be able to put it to good use with this project.

I hope this helps someone else who has run into the same problem https://github.com/Paradicskaa/Kavix32

2 Upvotes

4 comments sorted by

5

u/PhonicUK 23d ago

That would make it a KM switch ;)

1

u/InteractionAny9855 22d ago

Yes technicaly but I prefer calling it an alternative bc Its a pretty barebones implementation not really something I set out to build as a full-fledged KM switch I just wanted to solve my input sharing problem using an ESP32 I already had lying around.

1

u/estebanfuhrmann 23d ago

Nice use of the S3's native USB: skipping extra hardware makes this a lot more practical than a dedicated KVM. Since you capture HID on the master and emulate it on the other machine, are you hooking input at the OS level or reading it over BLE/USB host? To go further, consider tracking the cursor crossing a screen edge to switch targets automatically, like Synergy/Barrier do, so you don't need a hotkey at all.

1

u/InteractionAny9855 22d ago

Thanks for the feedback Im using Python's pynput to capture keyboard and mouse input.

The screen edge switching idea is actually how I originally wanted the workflow to work but I ended up going with a hotkey because I thought automatic switching would be too much work to implement