Page 1 of 1

Pairing a Bluetooth Keyboard?

Posted: Sun Apr 30, 2017 10:40 pm
by 0xPIT32
Hi,

does the SDK support BT HCI, so that I could connect a regular BT Keyboard in order to capture keypresses?
I'm new to Bluetooth, are there samples available anywhere?

Thanks,

- pit

Re: Pairing a Bluetooth Keyboard?

Posted: Mon May 01, 2017 6:48 am
by ESP_Sprite
It does support a HCI, but esp-idf does not have the layers to easily interface with a HID-device yet. You can theoretically do this, but you'll have to come up with the code for the layers between it and the HCI yourself.

Re: Pairing a Bluetooth Keyboard?

Posted: Mon May 01, 2017 9:12 am
by Hubberthus
The USB shield for Arduino has code for Bluetooth dongles, and some implementation for layers, including HID keyboard and mouse.

Cutting out the part needed, throw out USB dongle behaviour, change HCI command sending/receiving with the ESP32 functions and callbacks and there you go.
Easy-peasy :)

Re: Pairing a Bluetooth Keyboard?

Posted: Mon May 01, 2017 3:39 pm
by 0xPIT32
Thanks for clarifying.

I guess this is going to be a case of `effort > freeTime`.
Plus, the USB Host shield's code is GPL, I prefer not to touch GPLed stuff anymore.

Cheers

- pit

Re: Pairing a Bluetooth Keyboard?

Posted: Tue May 02, 2017 6:21 am
by Hubberthus
Yeah, I've scratched my head because of the GPL, but I intend to make an attempt at porting it anyway, as an intermediate step.
Then based on that, make a proper C only adaptation with my own approach.
That library is nice and stuff, but has lots of "what the hell man?!"
I mean, tons of magic numbers, inconvenient coding style, Wii and other controllers' code in generic Bluetooth code, etc.
Gonna make it proper idf-style. I like it, way more clean and understandable. Also,if for example I do the SPP, and it will be then available in idf, just change to that.
Only question left is freeTime.

Re: Pairing a Bluetooth Keyboard?

Posted: Sat Sep 10, 2022 3:28 pm
by boernsen
As I am planning to pair it with a Bluetooth mouse and receive movement data, I'm quiet interested in this! Did you manage to pair the ESP32 with the Bluetooth keyboard and receive key presses?