T-vK / ESP32-BLE-Keyboard

Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
2.28k stars 379 forks source link

ESP-WROOM-32 Bluetooth connection flickering during pairing #188

Open cnoronh opened 1 year ago

cnoronh commented 1 year ago

When running the example program (SendKeyStrokes), the ESP-WROOM-32 Bluetooth keeps flickering (device appears briefly and disappears when paring with Windows 10). I am unable to pair unless I time it perfectly. Does anyone know what could cause this/how to fix this? I do not see this issue when running this sketch with the ESP-WROOM-32D. Could this be a firmware issue ?

ekoslav commented 1 year ago

I've seen this issue on some W10 / W11 machines. Not sure what it causes it, but if you leave it long enough, it will connect. The quick solution is to remove device, turn BT off, wait 15 -20 seconds, turn it on, and connect device. I noticed it happens after ESP32 is powered off without disconnecting bt connection.

I don't know if helps, I het a lot of these messages while flip-flopping: "lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)"

JamesCohen-awin commented 1 year ago

Out of interest was your sketch compiled with or without NimBLE?

cnoronh commented 1 year ago

I did not compile with NimBLE. This issue does not arise with the ESP-WROOM-32D so my recommendation is to use this model at minimum when using this library to avoid any headache.

pranavpa8788 commented 1 year ago

I had the same issue with ESP32 C3 DEV KIT M1. I solved this by connecting once to my android device -> turning off my android's bluetooth and reconnecting on my PC. Don't know why this works. But before this I was able to connect, but the keystrokes wouldn't work, now it works properly (I'm on windows 11 and my android version is 12)

babelmandeb124 commented 5 months ago

same issue esp32 devKit v3, win 11. Flickering then connects only with some perfect timing. With and without nimBLE