2
0
mirror of https://github.com/pikvm/pikvm synced 2024-11-10 13:10:37 +00:00
pikvm/docs/pico_hid_bridge.md
Maxim Devaev 45cdd721f4 update
2023-10-29 09:31:57 +02:00

3.2 KiB

The Pico HID - PS/2 Bridge

The Pico HID Bridge is a special version of the generic Pico HID. It is a PS/2 keyboard and mouse emulator that connects to PiKVM via USB-A. Unlike generic Pico HID and legacy Arduino HID, it doesn't require SPI wiring with GPIO.

It is suitable for all devices except V4 Mini and DIY based on Zero 2 W board.

At one end it connects to USB-A on PiKVM, on the other side it has two PS/2 connectors for keyboard and mouse:

In addition, on PiKVM V2+, the use of Pico the HID Bridge does not exclude the use of a regular USB OTG port with Mass Storage emulation. Thus, on V2+ you will be able to use PS/2 and USB Mass Storage at the same time, and even switch between OTG HID and Pico HID.


Making the Bridge

  • x1 Raspberry Pi Pico board with soldered pins.
  • x1 USB-A to Micro-USB cable.
  • x1 3.3V/5V bi-directional logic level shifter like this.
  • x2 PS/2 cable with male connector.
  • x2 Small dip jumpers.

Make sure that the level shifter pinout matches the scheme, and connect everything according to the Pico pinout.

				 _________________
				|                 |
Pico GP11 ______| LV1         HV1 |______ PS/2 keyboard data
Pico GP12 ______| LV2         HV2 |______ PS/2 keyboard clock
Pico GP13 ______| LV          HV  |______ PS/2 5V
Pico  GND ______| GND         GND |______ PS/2 GND
Pico GP14 ______| LV3         HV3 |______ PS/2 mouse data
Pico GP15 ______| LV4         HV4 |______ PS/2 mouse clock
				|_________________|

You can take the 5V power line from one of the PS/2, for example from the keyboard, or from both at once, but use a multimeter to make sure that both PS/2 female connectors have the same line.

PS/2 female socket pinout on the motherboard is the same for the keyboard and the mouse. A purple socket usually corresponds to the keyboard, and a green one to the mouse. If your motherboard only has one port, it's probably universal and can be used for both the keyboard and the mouse. Most likely, it will be painted both colors.

Use a multimeter to determine the purpose of the wires in your PS/2 cables.

A good idea is to mount the level shifter on top of the Pico, as in this photo:

Finally, install DIP jumpers to soldered pins of the Pico to enable PS/2 and Bridge modes:

  • GP2 <-> GND
  • GP5 <-> GND

Like this:


Flashing the firmware

{!_pico_hid_flashing.md!}


The final steps

Connect the Pico HID to the target host using PS/2 cable and USB to USB-A port on PiKVM.

Add following lines to the PiKVM configuration and reboot it:

  • /etc/kvmd/override.yaml:
    kvmd:
        hid:
            type: serial
    		device: /dev/kvmd-hid-bridge