←back to thread

233 points bahaaador | 4 comments | | HN request time: 0.417s | source

Hi HN! I built Bluetooth USB Peripheral Relay, a tool that lets Bluetooth devices (like keyboards and mice) connect to USB-only hosts using a Raspberry Pi Zero W.

Why? My friend needed a way to use his Bluetooth mouse and keyboard on a PC with Bluetooth disabled due to policy restrictions. This tool acts as a bridge, relaying Bluetooth input over USB. It also lets you use Bluetooth peripherals with older devices that only support USB input.

Tech: Written in Go, optimized for Raspberry Pi Zero W.

I love HN’s community and often lurk here—I’m hoping this project is useful or at least sparks some interesting discussions. Feedback and contributions are welcome!

1. AshamedCaptain ◴[] No.42125900[source]
I just miss the dual mode HID/HCI bluetooth adapters.
replies(2): >>42125911 #>>42125954 #
2. ◴[] No.42125911[source]
3. Bjartr ◴[] No.42125954[source]
What could those do special?
replies(1): >>42126048 #
4. AshamedCaptain ◴[] No.42126048[source]
Exactly the same as what this device is doing, plus more. You would put it in HCI mode, pair whichever Bluetooth devices you wanted to pair with it (keyboards, mice, etc.). Then on the next reboot it would put itself back into HID mode, where all the paired devices would appear as USB HID devices. And therefore your keyboard would be available even during pre-boot, at the BIOS setup program.

Once the operating system finished loading, it would send the adapter the command to switch to HCI mode, and the adapter would then re-appear as a normal bluetooth adapter. Under BlueZ, this operation was done by a command called hid2hci.

I have several (even Apple used to do this), but they stopped being a thing during the 2.0 EDR era (therefore zero support for LE keyboards).

In fact, if you google these keywords ("HID proxy", "HID2HCI", ...) you will find that there are several much older projects to also replicate this using RPi Zeros. I personally would like one which extends the concept to audio devices, serial ports, etc. so that I can use them from OSes without BT stack.