ESPHome BLE Gateway and other BLE components

I’m trying to get this working on a Switchbot Plug Mini (ESP32-C3) and when I add the ble_gateway config and install, I get errors saying: “undefined reference to `vtable for esphome::ble_gateway::BLEGateway’”

Is there something obvious that I’m doing wrong?

HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40407.240606 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Reading CMake configuration...
No dependencies
Linking .pioenvs/sbotplug-ab1fdc/firmware.elf
/data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: .pioenvs/sbotplug-ab1fdc/src/main.o: in function `setup()':
/data/build/sbotplug-ab1fdc/src/main.cpp:287: undefined reference to `vtable for esphome::ble_gateway::BLEGateway'
/data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/build/sbotplug-ab1fdc/src/main.cpp:287: undefined reference to `vtable for esphome::ble_gateway::BLEGateway'
/data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/build/sbotplug-ab1fdc/src/main.cpp:288: undefined reference to `vtable for esphome::ble_gateway::BLEGateway'
/data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/build/sbotplug-ab1fdc/src/main.cpp:288: undefined reference to `vtable for esphome::ble_gateway::BLEGateway'
collect2: error: ld returned 1 exit status
*** [.pioenvs/sbotplug-ab1fdc/firmware.elf] Error 1
========================= [FAILED] Took 14.78 seconds =========================

Hello,

Should works, similar problem can happened with ESP-IDF if you add new component and not cleanup build files. In ESPHome dashboard select … for this device choose Clean Build Files and try to install again.

But be very careful with ESP32-C3 and Bluetooth, device can fail to boot. Do you use Bluetooth in this device before? Please read my post here

Hi everyone, first of all, let me thank the developer who created this great component.

Currently I have created one BLE gateway and using it well.
But I want to add a new Passive BLE device LYWSD03MMC that is far away from the gateway (i.e. on the opposite side of the house).

My question here is, is it okay to add another ESP32 with BLE gateway installed, so that there are a total of 2 ESP32 with BLE gateways installed in the house?

Of course I know I can just do it, but I’m writing this to reduce trial and error.

Yes yo can!
If you want more info watch this:

and read this:

Just saw this, this is exactly what I need for a couple projects. Thanks OP!

Thank you so much. I’ll give it a try soon.

Sure, this is exactly how this designed, to extend BLE range you can install as many gateway/proxy as you need.

Instead of adding a ble gateway in a remote location, would it be enough to just put an esp32 board there with the bluetooth_proxy: option set?

Yes, but keep in mind that BLE Gateway and BLE Proxy (bluetooth_proxy) it’s a different things. BLE Gateway can only receive BLE data and send it to Passive BLE Monitor integration for decode. BLE Proxy it’s a part of Home Assistant and use build-in BLE devices plugins for decode data and can also send data back to BLE devices (if you specify active: true in its configuration).

So if you already familiar with BLE Gateway and has it configured, you can just add extra ESP32 with same BLE Gateway configuration as one which you already have.

Ah, that makes sense now, thanks for the detailed explanation.