On Sun, 10/26/2025 2:34 PM, micky wrote:
A couple years ago I tried to use digital KVM's and they almost did what
I needed, but not quite.
I have simplified my needs, IF they make what I want.
I have two PCs, a desktop and laptop but the laptop uses an external
keyboard (and mouse). And I have two keyboards, one for each (plus the built-in laptop keyboard that I don't use.)
The keyboards are one above each other, and I'd like a simple way,
preferably hardware but software is okay, to switch PC's, so that each
PC always has a keyboard, but I can make the kb in front work with the
PC I"M using.
I don't think normal KVM switches worry about the PC that's left behind,
and I don't know what one would call this.
TIA
Apparently this is a "USB Matrix Switch" and the focus of these
seems to be mostly business and not consumer. The AI told me of a
short list of suggestions, most DIY, the Matrix Switch was supposed
to be a purchase-able device.
One of the observations about USB, is the "traffic" inside the
computer is packet based. That's how USB2 would "poll" peripherals
8000 times per second and "check" for things to do. The back and forth
there can involve packets. In VirtualBox, one of the extension
techniques is to break the USB routing to the host OS and redirect
the packet stream to a selected Guest OS. This shows us, that
successful hardware products could be designed the same (IP) way.
You hear the "boop" as the USB device "leaves" the Host OS,
and a second "boop" in the Guest OS when it recognizes it has "new" hardware. That is what happens when you redirect the stream of packets.
Earlier today, I could find some mention of "USB remoting" products
which use a length of Ethernet cable, between a "transmitter" and
a "receiver". This was not meant to imply that the cable could
be cut in two and people mess about with the packets particularly.
That is just a pt-pt solution. And it seems to violate the time
constant of the timer for USB, which puts a limit on the length of cable.
In any case, the Matrix Switcher concept, there is a claim that works
in the IP packet space as well. That the core equipment works with
intact packets transported in an IP envelope.
But the Matrix Switch products, the first ones I could find, they are
"8x8", and you just know this is a gouge to justify the $3000 price
of the box.
To DIY, this would take four RPI Zero 2W (the second version of a
PiZero, that has Wifi onboard and a single OTG USB port for protocols).
We would need four devices, because the RPi Zero is I/O bound, and
the project would be even less do-able with the original version.
There just aren't enough hardware resources to do it in style.
I don't really want to do this with Wifi either, but that is what is
on offer. You could use serial I/O and shared bus standards for
an interconnect. For now, this just illustrates a concept, and this
is not ready to build. The OS for these, has a provision for the
USB port to be run as a Master or a Slave, so the left hand RPi runs
one mode, the right hand RPi run the opposite mode. The user is
responsible for plugging in the illegal cable type, on one side
of the diagram (likely on the right).
USB USB
keyboard1 ----- RPI zero 2W --- Wifi Wifi --- RPi zero 2W ----- PC1
| |
+----------------------------------+
| GPIO(2) |
USB | | USB
keyboard2 ----- RPI zero 2W --- Wifi Wifi --- RPi zero 2W ----- PC2
That would be a Matrix Switcher for considerably less than $3000, but
it is still relying on our home router for transport.
The GPIO signals are for synchronizing switch-over between all four devices.
If sync is with Wifi messages, it won't be synchronized all that well.
*******
A lot of the USB switchers on the consumer side, are mechanical switches. Roughly the equivalent of plugging and unplugging things. If you could find mechanical switches with sufficient contacts, it could be engineered
for a criss-cross switching event.
The simplest way to do clean engineering, is to use the bus reset mechanism, tell the OS the device is unplugged, tell the OS a new device is plugged
in, and then let nature take its course. There can be significant delay from "button press" to "switched" because of this. Windows 10 would have to load
the driver, and even with a USB serial number for comfort, it likely takes
a few seconds to realize the driver is already in the OS folders.
*******
There is a danger of these solutions, violating the grounding expectations
of PC versus USB. The PC has a hard ground. The USB peripheral uses a 2 prong wall adapter, and there is no hard ground in the peripheral side. If the two devices had hard grounds, and were on some (poorly installed) house circuits,
a ground difference could exist. Current can then flow over the ground jacket of the USB cable.
On farms, sometimes the milking barn, the milk pump is at a ~1V difference
to the cows standing on damp flooring. The current flow "upsets" the cows
and affects production.
We have rules for ground, for comfort, for safety. The rules aren't normally put there for no reason at all.
The Laplink USB cable you can buy, that is not a part of USB.org . And
as far as I know, the ground is not continuous from one USB-A connector
on the device, to the other USB-A connector. There could be a 1 megohm
resistor in the path. If you buy a Laplink cable, you might take an ohmmeter and check whether there is a "hard path" between the metalwork on the
two USB-A connectors. To see how they handled the issue. The protocol
on the Laplink cable, is a first-in-first-out queue, a kind of "mailbox protocol",
and the transfer rate achieved on the USB3 version of that cable, is
decidedly uneven (varies with time, does not inspire confidence). When
a transmission standard relies upon the GND reference for integrity,
some effort has to go into making a proper (logic) GND.
Summary: Topic is lots of fun.
Paul
--- PyGate Linux v1.5
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)