Ble keyboard connection using esp_hid_host example. (PassKey)

voidful
Posts: 2
Joined: Thu Aug 31, 2023 1:32 am

Ble keyboard connection using esp_hid_host example. (PassKey)

Postby voidful » Thu Aug 31, 2023 1:43 am

I'm testing connecting my bluetooth keyboard (BLE 5.0) to an ESP32 board.
I downloaded examples/bluetooth/esp_hid_host on the esp32 and monitored it.

If you look at the log below, it receives a passkey from the keyboard and logs it, but then it waits (~30 sec) with a connection failure message and exits.

I tried calling some APIs to send the received passkey, but the result is the same.
I want to pass a passkey to establish a connection and receive keystrokes from the keyboard.

In this sample example, which function/API is sending the passkey to the keyboard?

Code: Select all

===================================================================================================
I (1361) ESP_HIDH_DEMO: SCAN...
I (1361) main_task: Returned from app_main()
BLE: d6:e1:7a:94:47:36, RSSI: -64, UUID: 0x1812, APPEARANCE: 0x03c1, ADDR_TYPE: 'RANDOM', NAME: 'Designer Compact Keyboard'
BLE: ce:a5:78:17:21:84, RSSI: -85, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 71:a7:72:86:94:67, RSSI: -68, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 10:7c:fe:6b:e2:28, RSSI: -30, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 70:bf:a0:5b:41:8c, RSSI: -94, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 5a:5e:33:54:a3:08, RSSI: -44, UUID: 0xfef3, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 70:bf:a0:5b:41:8c, RSSI: -98, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 50:31:41:e8:15:bf, RSSI: -93, UUID: 0xfe9f, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 54:d8:a3:a3:87:8c, RSSI: -67, UUID: 0xfef3, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
BLE: 50:31:41:e8:15:bf, RSSI: -96, UUID: 0x0000, APPEARANCE: 0x0000, ADDR_TYPE: 'RANDOM'
[i]I (10221) ESP_HIDH_DEMO: SCAN: 1 results
  BLE: d6:e1:7a:94:47:36, RSSI: -64, USAGE: GENERIC, APPEARANCE: 0x03c1, ADDR_TYPE: 'RANDOM', NAME: Designer Compa ct Keyboard
[/i]I (12001) ESP_HID_GAP: ++++++++++++++++++++++++++++++++++++++++++++
[b]I (12001)[/b] ESP_HID_GAP: BLE GAP PASSKEY_NOTIF passkey:918157
I (12001) ESP_HID_GAP: ++++++++++++++++++++++++++++++++++++++++++++
[b]E (42011)[/b] ESP_HID_GAP: BLE GAP AUTH ERROR: 0x63
E (42011) BT_BTM: BTM_GetSecurityFlags false

E (42011) BT_BTM: btm_ble_link_sec_check received for unknown device
W (42021) BT_BTM: Security Manager: BTM_SetEncryption not connected

Who is online

Users browsing this forum: Bing [Bot] and 167 guests