From 3a2f22cda43b46939007b65324672e9c4836570e Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 3 Dec 2020 10:21:59 +0300 Subject: [PATCH 1/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 60af5b03..f51efa83 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,7 @@ Happy using of Pi-KVM :) # Limitations * In very rare cases, some motherboards contain a buggy BIOS that does not understand the keyboard of the **v2** platform (below). The reason for this is that the BIOS doesn't fully implement the USB HID stack for composite devices correctly. Meanwhile, Mass Storage Drive can be detected. For this case, we suggest using the Arduino HID from the **v0** platform with **v2**. Thus the Pi-KVM will be connected by two USB cables to the motherboard: one of them will be responsible for the keyboard and mouse, the other for everything else. See [here](pages/arduino_hid.md). * A similar problem can be observed on devices with UEFI: the keyboard works fine, but the mouse does not work. This situation occurs when UEFI does not support absolute mouse mode, which prefers to use Pi-KVM. To solve this problem, [you can enable relative mouse mode](pages/mouse.md). +* To use Pi-KVM with Apple UEFI, use the [Arduino HID](pages/arduino_hid.md) even with **v2**. Apple UEFI wants the most blunt keyboard possible. Our future [v3 platform](#the-future-v3-platform-work-in-progress) will contain an optional HID module for such cases, so you won't have to build anything yourself. From c7f6d2b416ef2543e235e63978afa74b548d2a40 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 3 Dec 2020 10:40:22 +0300 Subject: [PATCH 2/3] Update arduino_hid.md --- pages/arduino_hid.md | 74 ++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/pages/arduino_hid.md b/pages/arduino_hid.md index fa3cda59..e32ea5b3 100644 --- a/pages/arduino_hid.md +++ b/pages/arduino_hid.md @@ -1,8 +1,5 @@ # Hardware Arduino HID instead of the OTG -Using Arduino HID on non-v0 platforms is useful if you need a simple and primitive keyboard/mouse emulation device. For example, when used with a hardware KVM switch wich [does not recognize composite HID](https://github.com/pikvm/pikvm/issues/7). You can use the Arduino HID firmware to emulate (at your choice): -* [USB keyboard & mouse](#usb-keyboard--mouse) -* [PS/2 keyboard only](#ps2-keyboard) -* [PS/2 keyboard & USB mouse](#ps2-keyboard--usb-mouse) +Using Arduino HID on non-v0 platforms is useful if you need a simple and primitive keyboard/mouse emulation device. For example, for Apple UEFI or when used with a hardware KVM switch wich [does not recognize composite HID](https://github.com/pikvm/pikvm/issues/7). You can also use the Arduino HID to emulate the PS/2 keyboard. ## USB keyboard & mouse * Build and connect HID according to the [diagram](../README.md#setting-up-the-v0) (the bottom part with transistor, level-shifter and Arduino). @@ -26,20 +23,55 @@ Using Arduino HID on non-v0 platforms is useful if you need a simple and primiti ## PS/2 keyboard Using the PS/2 firmware currently has the following limitations: -* The possibility of using USB HID is excluded. -* PS/2 mouse is not supported due to features of the [PS/2 protocol](https://wiki.osdev.org/PS/2_Mouse). +* The possibility of using the switchable USB HID is excluded. +* PS/2 mouse is not supported right now (but it will). -Both of these problems will be solved one way or another in the future and the two different firmware versions will be combined into one universal one. +Both of these problems will be solved in the nearest future and the two different firmware versions will be combined into one universal one. -To select the PS/2 firmware, you need to follow the instructions for USB, but with one exception. At the device firmware stage instead of commands: +To select the PS/2 firmware, you need to follow the instructions for USB, but with one exception. Befor `make` you need to edit file `platformio.ini`. Open it and find these lines: +```ini +[_common] +build_flags = + -DHID_PS2_KBD_CLOCK_PIN=7 + -DHID_PS2_KBD_DATA_PIN=5 + -DHID_USB_CHECK_ENDPOINT +# ----- The default config with dynamic switching ----- + -DHID_DYNAMIC + -DHID_WITH_USB + -DHID_SET_USB_KBD + -DHID_SET_USB_MOUSE_ABS +# ----- PS2 keyboard only ----- +# -DHID_WITH_PS2 +# -DHID_SET_PS2_KBD +# ----- PS2 keyboard + USB absolute mouse ----- +# -DHID_WITH_USB +# -DHID_WITH_PS2 +# -DHID_SET_PS2_KBD +# -DHID_SET_USB_MOUSE_ABS +# ----- PS2 keyboard + USB relative mouse ----- +# -DHID_WITH_USB +# -DHID_WITH_PS2 +# -DHID_SET_PS2_KBD +# -DHID_SET_USB_MOUSE_REL ``` -# make -# make install -``` -Use commands: -``` -# make ps2 -# make install + +By default, the firmware works with USB HID and supports dynamic mode switching. You can choose one of the other modes by commenting out some lines and uncomenting others. For example, you can use a USB mouse and PS/2 keyboard: +```ini +... +# ----- The default config with dynamic switching ----- +# -DHID_DYNAMIC +# -DHID_WITH_USB +# -DHID_SET_USB_KBD +# -DHID_SET_USB_MOUSE_ABS +# ----- PS2 keyboard only ----- +... +# ----- PS2 keyboard + USB absolute mouse ----- + -DHID_WITH_USB + -DHID_WITH_PS2 + -DHID_SET_PS2_KBD + -DHID_SET_USB_MOUSE_ABS +# ----- PS2 keyboard + USB relative mouse ----- +... ``` Next, you need to connect the Arduino pins to the female PS/2 port of your motherboard. Choose the purple port. If your motherboard only have one port, it's probably universal and can be used either for the keyboard or for the mouse. Most likely, it is painted in two colors: green and purple. You can use it either. @@ -49,14 +81,4 @@ Follow this diagram: |-------------------------------|--------| | drawing | Arduino pin 7 <-> PS/2 CLOCK
Arduino pin 5 <-> PS/2 DATA
Arduino GND pin <-> PS/2 GND | -**Connect VIN pin of Arduino to any Raspberry's 5v pin.** - - -## PS/2 keyboard & USB mouse -This is a mixed mode of HID which is a compromise for old computers. Connections are made simultaneously by both USB and PS/2 pins, as shown in the diagram above. Follow the [PS/2 instructions](#ps2-keyboard), but use these commands to build and install the firmware: -``` -# make mixed -# make install -``` - -**You don't need to connect the Arduino VIN pin if you connected USB (the Arduino will get power through it)**. +**Connect VIN pin of Arduino to any Raspberry's 5v pin for PS/2 only device. But you don't need to connect the Arduino VIN pin if you connected USB (Arduino will get power through it).** From 9ac5913767e4ac51911308c2a478a313702aded2 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 3 Dec 2020 10:46:50 +0300 Subject: [PATCH 3/3] Update arduino_hid.md --- pages/arduino_hid.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/arduino_hid.md b/pages/arduino_hid.md index e32ea5b3..5cb36ba4 100644 --- a/pages/arduino_hid.md +++ b/pages/arduino_hid.md @@ -1,5 +1,5 @@ # Hardware Arduino HID instead of the OTG -Using Arduino HID on non-v0 platforms is useful if you need a simple and primitive keyboard/mouse emulation device. For example, for Apple UEFI or when used with a hardware KVM switch wich [does not recognize composite HID](https://github.com/pikvm/pikvm/issues/7). You can also use the Arduino HID to emulate the PS/2 keyboard. +Using Arduino HID on non-v0 platforms is useful if you need a simple and primitive keyboard/mouse emulator device. For example when used with a hardware KVM switch which [does not recognize composite HID](https://github.com/pikvm/pikvm/issues/7). You can also use the Arduino HID to emulate the PS/2 keyboard. ## USB keyboard & mouse * Build and connect HID according to the [diagram](../README.md#setting-up-the-v0) (the bottom part with transistor, level-shifter and Arduino). @@ -55,7 +55,7 @@ build_flags = # -DHID_SET_USB_MOUSE_REL ``` -By default, the firmware works with USB HID and supports dynamic mode switching. You can choose one of the other modes by commenting out some lines and uncomenting others. For example, you can use a USB mouse and PS/2 keyboard: +By default, the firmware works with USB HID and supports dynamic mode switching. You can choose one of the other modes by commenting some lines and uncomenting others. This example to use a USB mouse and PS/2 keyboard: ```ini ... # ----- The default config with dynamic switching ----- @@ -74,11 +74,11 @@ By default, the firmware works with USB HID and supports dynamic mode switching. ... ``` -Next, you need to connect the Arduino pins to the female PS/2 port of your motherboard. Choose the purple port. If your motherboard only have one port, it's probably universal and can be used either for the keyboard or for the mouse. Most likely, it is painted in two colors: green and purple. You can use it either. +Next, you need to connect Arduino pins to the female PS/2 port of your motherboard. Choose the purple port. If your motherboard only have one port, it's probably universal and can be used either for the keyboard or for the mouse. Most likely, it is painted in two colors: green and purple. You can use it either. Follow this diagram: | Female PS/2 port (front view) | Pinout | |-------------------------------|--------| | drawing | Arduino pin 7 <-> PS/2 CLOCK
Arduino pin 5 <-> PS/2 DATA
Arduino GND pin <-> PS/2 GND | -**Connect VIN pin of Arduino to any Raspberry's 5v pin for PS/2 only device. But you don't need to connect the Arduino VIN pin if you connected USB (Arduino will get power through it).** +**Connect VIN pin of Arduino to [any Raspberry's 5v pin](https://pinout.xyz/pinout/5v_power) for PS/2 only device. But you don't need to connect the Arduino VIN pin if you connected USB (Arduino will get power through it).**