hid2hci
Switch Bluetooth HCI device between HID and HCI
SYNOPSIS
hid2hci [options] [device]
PARAMETERS
-i <vendor:product>, --id <vendor:product>
Specify the USB device by its Vendor ID and Product ID (e.g., 0a12:0001). This is an alternative to providing a sysfs path.
-e, --enable-driver
Re-enable the uhid driver after switching. (Less common in modern use cases, usually the default behavior is to switch drivers).
-r, --reset-device
Attempt to reset the device after performing the mode switch. This can help with some problematic devices.
-h, --help
Display a help message and exit.
-V, --version
Output version information and exit.
device
The sysfs path to the USB device (e.g., /sys/bus/usb/devices/1-2). This is the primary way to specify the target device if not using --id.
DESCRIPTION
hid2hci is a utility designed to switch certain Bluetooth devices from Human Interface Device (HID) mode to Host Controller Interface (HCI) mode. Many Bluetooth USB dongles, particularly those intended to work immediately with basic input devices (like a mouse or keyboard) during system boot or in BIOS, initially enumerate as HID devices. While in HID mode, they function primarily as simple input devices, not as a full Bluetooth host controller.
The command allows the operating system's standard Bluetooth stack to take control of the device by switching it to HCI mode, which is the standard communication protocol for Bluetooth host controllers. Once switched, the device becomes a fully functional Bluetooth adapter, capable of managing connections to various Bluetooth peripherals, rather than just simple input. This conversion often involves unbinding the device from the uhid kernel module and rebinding it to the hci_usb module, effectively re-enumerating it as a proper Bluetooth controller.
CAVEATS
Requires root privileges to execute, as it manipulates kernel-level device drivers.
Not all Bluetooth devices require or support this conversion. Many modern dongles or integrated Bluetooth modules are correctly identified as HCI devices from the start.
The device may temporarily disappear from the system or change its device node path during the conversion process.
Incorrect usage or applying to an unsupported device may render the device temporarily unusable until a system reboot or manual driver re-attachment.
USAGE EXAMPLE
To use hid2hci, you first need to identify your Bluetooth device. You can use lsusb to find its Vendor ID and Product ID, or its bus/device path.
1. Identify the device:
$ lsusb
(Look for an entry like: Bus 001 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode))
If the device is already in HID mode, it might appear differently, e.g., as a generic USB device or HID device.
2. Execute the command (using ID):
$ sudo hid2hci -i 0a12:0001
Or, if you know the sysfs path (e.g., from lsusb -t or udevadm info -q path -n /dev/hidrawX):
$ sudo hid2hci /sys/bus/usb/devices/1-2
After successful execution, the device should reappear as a standard Bluetooth HCI device, and you can then manage it with bluetoothctl or hciconfig.
AUTOMATIC SWITCHING VIA UDEV
Modern Linux distributions often include udev rules that automatically handle the HID-to-HCI conversion for known problematic devices. These rules typically reside in /lib/udev/rules.d/ and are named similarly to 97-hid2hci.rules. If your device isn't automatically switching, it might be that the device's Vendor ID and Product ID are not listed in these rules, or there's an issue with the udev setup. Manually running hid2hci can bypass these automatic mechanisms for one-time troubleshooting or for unsupported devices.
HISTORY
hid2hci is part of the BlueZ Bluetooth stack utilities for Linux. It emerged to address specific hardware quirks of certain Bluetooth dongles that initially presented themselves as HID devices. As kernel drivers and udev rules have evolved, the need for manual execution of hid2hci has somewhat diminished, with many systems now automatically handling the HID-to-HCI conversion via udev rules (e.g., udev rules like /lib/udev/rules.d/97-hid2hci.rules). However, it remains a valuable tool for troubleshooting or for devices that aren't automatically switched.
SEE ALSO
hciconfig(8), hcitool(1), lsusb(8), bluetoothctl(1), udev(7)