ESPHome BLE Keyboard

It is strange that the Dmitry has not yet made this correction. After all, without it, media buttons do not work at all. :roll_eyes:

I am a little lost, so this allows me to use an ESP for as virtual Bluetooth keyboard for devices? (Similar to how the Logitech remotes did?)

Also, can I switch between multiple devices, or would I need a separate ESP for each one? I have a Shield, Android TV and PC for example, can I switch between each device?

I’ve run out of ESPs, so working out how many more I need to order
Thanks :slight_smile:

Hi,
I am having the following problem:
After the ipad connects to the esp32 bluetooth, every time I restart the esp32, the ipad cannot automatically reconnect to the esp32 via bluetooth. On Android phones I don’t have this problem. Currently I have not found out the cause of the problem

How to install this?

Variant1:


Variant2:


This is cool for sure and much appreciated. Maybe its just me and a lack of imagination but, im struggling to think of any reasons to need a keyboard. Sure, you can find a use for controlling the volume on something or a few keys to toggle this or that but a full size keyboard seems overkill for those things. What am i missing or not thinking of here?

I’m having this same compile problem with EspHome 2024.3.0

Any ideas?

Compiling .pioenvs/esp-keyboard-wake/lib3d0/ESP32 BLE Arduino/BLEAdvertising.cpp.o
In file included from .piolibdeps/esp-keyboard-wake/ESP32 BLE Arduino/src/BLECharacteristic.h:19,
                 from .piolibdeps/esp-keyboard-wake/ESP32 BLE Arduino/src/BLEDescriptor.h:14,
                 from .piolibdeps/esp-keyboard-wake/ESP32 BLE Arduino/src/BLE2902.h:13,
                 from .piolibdeps/esp-keyboard-wake/ESP32 BLE Arduino/src/BLE2902.cpp:15:
.piolibdeps/esp-keyboard-wake/ESP32 BLE Arduino/src/FreeRTOS.h:61:28: error: 'ringbuf_type_t' has not been declared
  Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);
                            ^~~~~~~~~~~~~~

@Tomsdad did you ever resolve this? I am trying to use this and am getting the same error unfortunately…

I never did. I fell back to the old solution that I had that uses this: https://github.com/clubcotton/esphome/blob/main/playground/esp32_ble_keyboard.h

I had the same issue. Managed to resolve the compilation by setting use_default_libs to false.

In the example provided in the documentation, in the last line, replace true with false.

ble_keyboard:
id: mamontech_keyboard
name: “MamonTechKeyboard”
manufacturer_id: “MamonTech”
battery_level: 50
reconnect: true
buttons: true
use_default_libs: false

Your change helped it get further, but now I get a new error:

Linking .pioenvs/esphome-web-c66cb0/firmware.elf
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esphome-web-c66cb0/src/main.cpp.o:(.literal._Z5setupv+0x670): undefined reference to `vtable for esphome::esp32_ble_server::NimBLEServer'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esphome-web-c66cb0/src/main.cpp.o:(.literal._Z5setupv+0x674): undefined reference to `vtable for esphome::esp32_ble_server::NimBLEServer'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/esphome-web-c66cb0/src/main.cpp.o:(.literal._Z5setupv+0x678): undefined reference to `vtable for esphome::esp32_ble_server::NimBLEServer'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esphome-web-c66cb0/firmware.elf] Error 1
========================= [FAILED] Took 26.31 seconds =========================

Any ideas?