From 7f2ca4445c651e717a8e57ccbc368d9488ff5949 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 8 Nov 2020 01:56:23 +0300 Subject: [PATCH] Create bluetooth_hid.md --- pages/bluetooth_hid.md | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pages/bluetooth_hid.md diff --git a/pages/bluetooth_hid.md b/pages/bluetooth_hid.md new file mode 100644 index 0000000..2906c92 --- /dev/null +++ b/pages/bluetooth_hid.md @@ -0,0 +1,46 @@ +# Bluetooth HID +Pi-KVM is able to emulate a Bluetooth keyboard & mouse. +This is not the main case of using Pi-KVM since you still need it to pair with a remote host, but can be used for something like mobile KVM. + +:exclamation: Using Bluetooth HID requires additional configuration of the operating system. For v2, this means losing the UART port, +since it will be used by Bluetooth. Also, Bluetooth operation was tested only on RPi4 and v2 platform. Other boards may require different system service settings. + +:exclamation: Bluetooth mouse can work only in [relative mode](mouse.md). The reason is that many Bluetooth host drivers do not correctly implement HID descriptors. + +### Configuring +1. Switch filesystem to RW-mode, perform update and install some packages: + ``` + # rw + # pacman -Syu + # pacman -S bluez bluez-utils raspberrypi-bluetooth + ``` +2. Edit `/boot/config.txt` and comment these lines: + ``` + #enable_uart=1 + #dtoverlay=disable-bt + ``` +3. Create an empty directory `/var/lib/bluetooth` and add mountpoint to `/etc/fstab`: + ``` + # mkdir /var/lib/bluetooth + # echo 'tmpfs /var/lib/bluetooth tmpfs nodev,nosuid,mode=0755 0 0' >> /etc/fstab + ``` +4. Override and enable the services: + ``` + # mkdir /etc/systemd/system/bluetooth.service.d + # cat << EOF > /etc/systemd/system/bluetooth.service.d/override.conf + [Service] + ExecStart= + ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=* + EOF + # systemctl enable bluetooth + # systemctl enable raspberrypi-btuart + ``` +5. Override `kvmd` service: + ``` + # mkdir /etc/systemd/system/kvmd.service.d + # cat << EOF > /etc/systemd/system/bluetooth.service.d/override.conf + [Service] + AmbientCapabilities=CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_ADMIN CAP_SETUID CAP_SETGID CAP_CHOWN + CapabilityBoundingSet=CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_ADMIN CAP_SETUID CAP_SETGID CAP_CHOWN + EOF + ```