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 =========================
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, 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.
Who interested, can test ESPHome implementation of Apple AirPods/Beats status reported by BLE advertisement. It’s should work with any models but if you find that your model/color doesn’t reported correctly (shows numbers instead text description) please post it here and I will update. For headset like AirPods Max status reported as for the right bud.
I have a ChefIQ thermometer that works in Home Assistant with Passive BLE Monitor and a USB bluetooth adapter plugged into Home Assistant. This setup works great inside the house, but I want to extend bluetooth so I can use the thermometers outside. I have an ESP32 that I successfully flashed with ESPHome Bluetooth Proxy and added BLE Gateway and it shows my thermometers sending packets. Home Assistant developer tools shows events firing on esphome.on_ble_advertise, but I’m failing to understand what needs to be configured in Home Assistant so Passive BLE Monitor picks up what the gateway is sending.
You need to configure automation which receives this events and send it to Passive BLE Monitor (using service ble_monitor.parse_data), example you can find here.
PS: Passive BLE Monitor doesn’t required to have build in ESPHome Bluetooth Proxy, Bluetooth Proxy sends data to Home Assistant Bluetooth stack so you can see supported devices in Home Assistant without Passive BLE Monitor.
automation:
- alias: ESPHome BLE Advertise
mode: queued
trigger:
- platform: event
event_type: esphome.on_ble_advertise
action:
- service: ble_monitor.parse_data
data:
packet: "{{ trigger.event.data.packet }}"
gateway_id: "{{ trigger.event.data.gateway_id if trigger.event.data.gateway_id is defined else 'unknown' }}"
And do not forder to allow calling events on esphome device “configure” card (Allow device to perform Home Assistant actions.)
I guess this is way more lightweight, as it also does not log each single automation call in stdout logs.
HI to all!
And thanks for your work!
Till today(with last working ESPHome v2025.5.2) your components are working every time when I compile my project.
I even didn’t added:
external_components:
source: github://myhomeiot/esphome-components
or
external_components:
source: custom_components
because it is in my ESPHome addon custom_components directory and the compiling is finding it.
But from today(when updated ESPHome to v2025.6.0) it does not want to compile project(even if I add the external_components paragraph code to the yaml) with this error:
INFO ESPHome 2025.6.0
INFO Reading configuration config\aiosensor-kids-room.yaml…
WARNING GPIO8 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
WARNING GPIO9 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See Frequently Asked Questions — ESPHome
INFO Detected timezone ‘Europe/Kiev’
INFO Generating C++ source…
INFO Compiling app…
Processing aiosensor-kids-room (board: lolin_c3_mini; framework: arduino; platform: platformio/[email protected])
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.3.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
|-- Wire @ 2.0.0
|-- ArduinoJson @ 6.18.5
|-- SPI @ 2.0.0
|-- BME68x Sensor library @ 1.3.40408+sha.4f37df6
|-- bsec2 @ 1.10.2610+sha.0dac6ea
Compiling .pioenvs\aiosensor-kids-room\src\esphome\components\ble_gateway\ble_gateway.cpp.o
: warning: “ARDUINO_USB_CDC_ON_BOOT” redefined
: note: this is the location of the previous definition
Compiling .pioenvs\aiosensor-kids-room\src\esphome\components\esp32\preferences.cpp.o
Compiling .pioenvs\aiosensor-kids-room\src\esphome\components\esp32_ble\ble.cpp.o
Compiling .pioenvs\aiosensor-kids-room\src\esphome\components\esp32_ble\ble_advertising.cpp.o
: warning: “ARDUINO_USB_CDC_ON_BOOT” redefined
: note: this is the location of the previous definition
: warning: “ARDUINO_USB_CDC_ON_BOOT” redefined
: warning: “ARDUINO_USB_CDC_ON_BOOT” redefined
: note: this is the location of the previous definition
: note: this is the location of the previous definition
src/esphome/components/ble_gateway/ble_gateway.cpp: In member function ‘virtual bool esphome::ble_gateway::BLEGateway::parse_device(const esphome::esp32_ble_tracker::ESPBTDevice&)’:
src/esphome/components/ble_gateway/ble_gateway.cpp:62:56: error: ‘const class esphome::esp32_ble_tracker::ESPBTDevice’ has no member named ‘get_scan_result’
auto packet = scan_result_to_hci_packet_hex(device.get_scan_result());
^~~~~~~~~~~~~~~
*** [.pioenvs\aiosensor-kids-room\src\esphome\components\ble_gateway\ble_gateway.cpp.o] Error 1
========================= [FAILED] Took 17.49 seconds =========================
Could you please look at the code what is wrong?
Reverted back to ESPHome v2025.5.2 and everything is working again.
I think the new update of ESPHome v2025.6.0 has broken something at your code for ble_gateway.cpp
And what can I make to work again with ESPHome v2025.6.0?
I’m very neewbe and I cannot program, but in my understandings "there is no such member function “get_scan_result” registered.
Thanks again for your hard work!
And all of you: “Keep healthy guys!”.
And God bless you!