Skip to content

udev: match Bluetooth HID devices (fixes #10) - #29

Open
cartermccann wants to merge 1 commit into
worklouder:mainfrom
cartermccann:fix/bluetooth-hid-udev-rules
Open

udev: match Bluetooth HID devices (fixes #10)#29
cartermccann wants to merge 1 commit into
worklouder:mainfrom
cartermccann:fix/bluetooth-hid-udev-rules

Conversation

@cartermccann

Copy link
Copy Markdown

Fixes #10 (Bluetooth config not working)

Root cause

Every hidraw rule in install-udev-worklouder.sh matches on
ATTRS{idVendor}=="303a" (and 574c). ATTRS{...} walks up the device
tree looking for a parent that carries idVendor — which only exists on a
USB device. A device connected over Bluetooth (HID-over-GATT) has no
USB parent in its chain (the parent is the Bluetooth stack, BUS_BLUETOOTH),
so those rules never match a BLE-connected device.

The result: the BLE hidraw node stays root:root 0600, and the app's
node-hid fails to open it with EACCES — which surfaces as "Bluetooth
config not working". (The current comment even lists "BLE HID" as covered by
the ATTRS{idVendor} rule, which is the mistaken assumption.)

Fix

Add two rules that match the Bluetooth HID parent by kernel name instead of
by USB vendor attribute. BLE HID devices are named 0005:VVVV:PPPP.NNNN by the
kernel, where 0005 = BUS_BLUETOOTH and the VID/PID are uppercase hex:

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:303A:*", MODE="0666", GROUP="...", TAG+="uaccess"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:574C:*", MODE="0666", GROUP="...", TAG+="uaccess"

They keep the same MODE/GROUP/uaccess form as the existing USB rules, so
both systemd (uaccess → active-seat user) and non-systemd (GROUP) setups get
access. The wired USB rules are unchanged.

Verification

Confirmed on a Codex Micro (303A:8360) connected over Bluetooth, kernel
6.12. Before: node-hid open on the BLE /dev/hidrawN → permission denied.
After adding the rule: the node's uaccess ACL is granted, node-hid opens it,
and Input detects the device over Bluetooth.

The device's kernel HID name was 0005:303A:8360.xxxx, which the
0005:303A:* rule matches directly.

Scope note: verified on one BLE device (Codex Micro) on one machine. The
574C rule mirrors the existing USB Nomad rule; I don't have a BLE Nomad to
test. The mechanism (BUS_BLUETOOTH HID naming + uaccess) is standard, so
this should apply to all Work Louder BLE devices.

Follow-up (not in this PR)

Every rule in this file uses MODE="0666" (world read/write). Since uaccess
already grants the active-seat user access via ACL, tightening the whole file to
MODE="0660" would be a reasonable hardening. Left out here to keep this focused
on #10 and consistent with the existing rules.

Configuring a Work Louder device over Bluetooth fails because every hidraw
rule matches on ATTRS{idVendor}, which walks up the device tree for a USB
parent carrying idVendor. A BLE (HID-over-GATT) device has no USB parent, so
those rules never match — the hidraw node stays root-only and node-hid gets
EACCES opening it.

Add rules that match the Bluetooth HID parent by kernel name instead:
bus 0005 = BUS_BLUETOOTH, with the VID in uppercase hex (0005:303A:*,
0005:574C:*), keeping the existing MODE/GROUP/uaccess form so both systemd
(uaccess) and non-systemd (group) setups get access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluetooth config not working

1 participant