| Electronics > Beginners |
| One USB device on two PC's? - HELP NEEDED |
| << < (3/5) > >> |
| rstofer:
--- Quote from: Xephlon on October 31, 2019, 10:26:03 pm ---Okay. Its annoying that I cant have them run simultaneously, but ill find a solution. Cheers! --- End quote --- In general, I don't think it is possible either. HOWEVER... Since it is a keyboard and therefore receives very little information back from the PC... If you ran the keyboard to some kind of microprocessor with 3 USB ports, I don't see why code couldn't be written that would do all of the arbitration. It's easy, generally, to become a USB HID device and if we're starting with a HID device (keyboard) then it should be straightforward. One needs to figure out which PC sends what to the device but having the device send to multiple PCs should be easy. Since it is a keyboard, it should be easy to get at it in userspace under Linux. I don't know anything about writing Linux drivers but the Raspberry Pi was 4 USB ports. I'm not even sure that a driver is required. It seems more like an application with 1 keyboard input and two keyboard outputs. It could be pretty straightforward... |
| rstofer:
We would want Linux to create two USB HID output devices and listen to one input HID device. The listen part is probably pretty easy, it's a keyboard. Creating the two HID devices might take some research like: https://developer.ridgerun.com/wiki/index.php?title=Linux_USB_gadget_(g_hid) Google around for 'make linux look like HID device' or something similar. I don't pretend to know how to do it but I'm getting more certain it is possible every minute. |
| RoGeorge:
--- Quote from: Xephlon on October 31, 2019, 09:04:48 pm ---Recently I have encountered an issue with a personal project where I need to connect a keyboard to two PC's. ... I have found keyboard switches to switch between two PC's, however I want simultaneous inputs. --- End quote --- At first look that seems like a spying device (e.g. to steal what is typed at somebody else's computer, like passwords, credit cards numbers, emails and so on), and that would be illegal. Care to explain why such a device is needed for your personal project? |
| Ian.M:
--- Quote from: rstofer on November 01, 2019, 03:56:37 pm ---I don't know anything about writing Linux drivers but the Raspberry Pi was 4 USB ports. I'm not even sure that a driver is required. It seems more like an application with 1 keyboard input and two keyboard outputs. It could be pretty straightforward... --- End quote --- You are on the right track, but it would need two USB device ports and one USB host port. The Pi 4 has four host ports and one OTG port which can be used as a device port, so could concentrate up to four keyboards to one PC, not the other way round. As MCUs with multiple device or OTG ports are rarer than hen's teeth, either you need multiple MCUs with a comms bus between them, each handling one port, or possibly a FPGA that can support multiple USB 'engines'. |
| GeorgeOfTheJungle:
You can do that easily with one rpi and two arduino leonardos. https://www.arduino.cc/en/Main/Arduino_BoardLeonardo . Connect the keyboard to the rpi, the leonardos to the PCs, and forward via the serial port (or ports) the characters to the leonardos. |
| Navigation |
| Message Index |
| Next page |
| Previous page |