pull/1085/head
Maxim Devaev 10 months ago
parent 12778e7bcd
commit 9f5c393e4e

@ -179,7 +179,7 @@ Programming assumes the Arduino is powered via USB, either from the connected ho
As of the latest package release, the kdmd service supports SPI. It should be sufficient to ensure the packages are up-to-date with the latest release, the programmer is installed, and the SPI device overlay is loaded at boot.
* Switch the filesystem to read-write mode with `rw`
* Update the system and nstall the avrdude programmer `pacman -Syu avrdude-svn`
* Update the system and install the avrdude programmer `pacman -Syu avrdude-pikvm`
* Add `dtoverlay=spi0-1cs` to `/boot/config.txt`
* Reboot with `reboot` or `systemctl reboot`

@ -14,6 +14,7 @@ When using relative mode, the browser will exclusively capture your mouse when y
When you press `Esc`, the browser releases the mouse.
-----
## Important notes
The relative mouse generates a huge number of events that can be poorly transmitted over the network or very slowly perceived by the BIOS/UEFI driver. To solve this problem, mouse events are optimized using a vector sum. This mode is enabled by activating the below first and is available in the web menu `System -> Squash mouse moves`. You can try disabling this if you have problems with mouse acceleration. This is the best and most reasonable compromise right now.
@ -22,6 +23,7 @@ Also currently the relative mouse mode is not supported by [PiKVM VNC server](vn
We expect to implement this in [TigerVNC](https://github.com/TigerVNC/tigervnc/issues/619). The relative mode is also not supported by mobile browsers.
-----
## Relative mouse on V2+ platform (OTG HID)
!!! info
@ -34,6 +36,7 @@ We expect to implement this in [TigerVNC](https://github.com/TigerVNC/tigervnc/i
device: ""
```
### Dual mode
Using dual mouse mode you can switch between the absolute and relative mouse in the `System` menu without reloading.
@ -81,12 +84,7 @@ This is more convenient, but for compatibility reasons it is disabled by default
5. Don't forget to perform `reboot`.
## Relative mouse on V0 platform (Arduino HID)
Mode switching for [Arduino HID](arduino_hid.md) can be performed on-the-fly starting with KVMD 2.6 and the corresponding firmware. No additional actions are required.
## Fixing the absolute mouse on Windows 98
### Fixing the absolute mouse on Windows 98
Due to an ancient buggy driver, the absolute mouse on Windows 98 moves only within the upper-left quarter of the screen. To fix this, you need to activate some magic workaround. Due to the specifics of the implementation, you will have to turn on the relative mouse too. Write it in `/etc/kvmd/override.yaml`:
@ -100,3 +98,9 @@ kvmd:
```
... and run `systemctl restart kvmd`. After that, you will get 3 new buttons with mouse modes in the **System** menu in Web UI. Switch it to **Abs-Win98**.
-----
## Relative mouse on V0-V1 platform (Arduino/Pico HID)
Mode switching for [Arduino HID](arduino_hid.md) and [Pico HID](pico_hid.md) can be performed on-the-fly starting with KVMD 2.6 and the corresponding firmware. No additional actions are required.

@ -0,0 +1,117 @@
!!! warning "This page is under custruction"
# Raspberry Pi Pico HID
The Pico HID is a part of DIY PiKVM V1 platform and performs keyboard and mouse emulation.
It has excellent compatibility, and by default emulates USB, including two mouse modes: absolute and relative.
The scope of the Pico HID is not limited to V1 platform, it can also be used with V2 and even V3 platform
if you need to emulate a PS/2 keyboard and mouse or use [legacy multiport KVM switch](https://github.com/pikvm/pikvm/issues/7)
which does not fully support USB standards.
This page explains how to build, connect and use all the features of the Pico HID.
-----
## Making the Pico HID
If you are building the PiKVM V1, then all the necessary components should already be at your fingertips.
If you are making the Pico HID for V2 or V3, then here is what you will need:
* Raspberry Pi Pico board with soldered pins. [An official green board](https://pico.pinout.xyz) is recommended.
* *x1* USB-A to Micro-USB cable.
* *x10* dupont wires female-female.
* Optional: *x1* 1N5819 diode. But any similar one will do.
* Optional: *x1* male-female dupont for the diode.
!!! tip
If you know how to solder, you can buy the Pico without pins and no dupond wires, and just solder everything.
!!! warning
The diode is needed to provide the power to the Pico HID regardless of the host state,
and prevents backpowering problem. Do not connect the red wire (the `VSYS (Pico) -> 5V (Pi)` line) without a diode.
If you can't find the diode, don't connect this wire at all.
Connect all the parts according to the scheme:
??? example "Simple wiring diagram"
<img src="basic_breadboard.jpg" />
??? example "Electrical schematic diagram for advanced users"
<img src="basic_scheme.jpg" />
-----
## Configuring the HID modes
By default, Pico HID emulates a USB keyboard and an absolute or relative mouse
(read [here](mouse.md) about the difference between mouse modes).
For most cases, nothing needs to be changed here. However, if you need something special
(like Windows 98 support), you can do it without reflashing on the current firmware.
To achieve this, the Pico HID uses a runtime configuration, which is set by connecting
some GPIOs with Ground (`GND`) lines.
| Pin name | Description |
|----------|-------------|
| `GP2` | Enable PS/2 keyboard & mouse support (see below). |
| `GP3` | Prefer the PS/2 keyboard over USB when turning on the HID (if PS/2 enabled). |
| `GP4` | Prefer the PS/2 mouse over USB (if PS/2 enabled) |
| `GP6` | Disable USB keyboard & mouse support. This is useful if you only want to use PS/2. |
| `GP7` | Enable the special USB absolute mouse for Windows 98. |
| `GP8` | Prefer the relative USB mouse over the absolute one. |
| `GP9` | Prefer the Windows 98 USB absolute mouse over the regular absolute one (if enabled). |
??? example
To enable Windows 98 absolute mouse, just connect pin `GP9` to any `GND` [on the Pico](https://pico.pinout.xyz).
!!! warning
PS/2 is not implemented now. Soon (r) (c) (tm)
-----
## Flashing the firmware
To upload the firmware to Pico HID, you can use any computer with a USB port.
1. [Download](https://github.com/pikvm/kvmd/releases) the latest release of the firmware. The file is called `pico-hid.uf2`.
2. Press the white button on the Pico board and plug it using USB cable to the computer.
3. Release the button.
4. The Pico board appears as a flash drive on the host computer.
5. Copy the `pico-hid.uf2` file to this flash drive.
6. Safely disconnect the USB device.
-----
## The final steps
Connect the Pico HID to the host computer using the USB cable.
If you are building PiKVM V1, then no further action with the Pico HID is required.
If you are making the Pico HID for V2 or V3, add the following lines to the PiKVM configuration and reboot it.
!!! note "KVMD >= 3.241 is required for the Pico HID"
* `/boot/config.txt`
```ini
dtoverlay=spi0-1cs
```
* `/etc/kvmd/override.yaml`:
```yaml
kvmd:
hid:
type: spi
chip: 0
bus: 0
sw_cs_pin: 7
sw_cs_per_byte: true
reset_pin: 25
reset_inverted: true
reset_self: true
power_detect_pin: 16
power_detect_pull_down: true
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Loading…
Cancel
Save