Pairing a Bluetooth Keyboard?

0xPIT32
Posts: 2
Joined: Sun Apr 30, 2017 10:26 pm

Pairing a Bluetooth Keyboard?

Postby 0xPIT32 » Sun Apr 30, 2017 10:40 pm

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

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Pairing a Bluetooth Keyboard?

Postby ESP_Sprite » Mon May 01, 2017 6:48 am

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.

Hubberthus
Posts: 6
Joined: Mon Feb 13, 2017 1:07 pm

Re: Pairing a Bluetooth Keyboard?

Postby Hubberthus » Mon May 01, 2017 9:12 am

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 :)

0xPIT32
Posts: 2
Joined: Sun Apr 30, 2017 10:26 pm

Re: Pairing a Bluetooth Keyboard?

Postby 0xPIT32 » Mon May 01, 2017 3:39 pm

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

Hubberthus
Posts: 6
Joined: Mon Feb 13, 2017 1:07 pm

Re: Pairing a Bluetooth Keyboard?

Postby Hubberthus » Tue May 02, 2017 6:21 am

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.

boernsen
Posts: 9
Joined: Tue Jul 19, 2022 7:43 pm

Re: Pairing a Bluetooth Keyboard?

Postby boernsen » Sat Sep 10, 2022 3:28 pm

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?

Who is online

Users browsing this forum: No registered users and 153 guests