ESP32s Bluetooth Proxy not working (?)

Hi,

I’m looking for weeks now why my setup is not showing any bluetooth device popup in ESPHome. I’m at the point thinking there is something wrong with the ESP32 board. This is an ESP32s (do not know what the s stand for). I flashed it via the webinterface, adopted it in ESPHome and edit some values for testing.
This is my current script:

---
substitutions:
  device_name: esp32-bluetooth-proxy-107888
  device_description: "Bluetooth proxy"
esphome:
  name: ${device_name}
  comment: "${device_description}"
esp32:
    board: nodemcu-32s
   
# Enable logging
logger:
  level: DEBUG
# Enable Home Assistant API
api:
ota:
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  domain: .iot.local
esp32_ble_tracker:
bluetooth_proxy:

The complete output flashing the device:

INFO Reading configuration /config/esp32-bluetooth-proxy-107888.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-bluetooth-proxy-107888 (board: nodemcu-32s; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 1.0
|-- ESPmDNS @ 1.0
|-- Update @ 1.0
RAM:   [==        ]  16.2% (used 53000 bytes from 327680 bytes)
Flash: [========  ]  79.8% (used 1464722 bytes from 1835008 bytes)
Building .pioenvs/esp32-bluetooth-proxy-107888/firmware.bin
esp32_create_combined_bin([".pioenvs/esp32-bluetooth-proxy-107888/firmware.bin"], [".pioenvs/esp32-bluetooth-proxy-107888/firmware.elf"])
Wrote 0x175a00 bytes to file /config/.esphome/build/esp32-bluetooth-proxy-107888/.pioenvs/esp32-bluetooth-proxy-107888/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 9.70 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of esp32-bluetooth-proxy-107888.iot.local
INFO  -> 192.168.10.21
INFO Uploading /config/.esphome/build/esp32-bluetooth-proxy-107888/.pioenvs/esp32-bluetooth-proxy-107888/firmware.bin (1464832 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from esp32-bluetooth-proxy-107888.iot.local using esphome API
INFO Successfully connected to esp32-bluetooth-proxy-107888.iot.local
[11:50:56][I][app:102]: ESPHome version **2022.9.3** compiled on Oct  6 2022, 11:45:40
[11:50:56][C][wifi:502]: WiFi:
[11:50:56][C][wifi:360]:   Local MAC: C4:DE:E2:10:78:88
[11:50:56][C][wifi:361]:   SSID: 'IOT'[redacted]
[11:50:56][C][wifi:362]:   IP Address: 192.168.10.21
[11:50:56][C][wifi:364]:   BSSID: BA:FB:E4:77:B6:81[redacted]
[11:50:56][C][wifi:365]:   Hostname: 'esp32-bluetooth-proxy-107888'
[11:50:56][C][wifi:367]:   Signal strength: -74 dB ▂▄▆█
[11:50:56][C][wifi:371]:   Channel: 11
[11:50:56][C][wifi:372]:   Subnet: 255.255.255.0
[11:50:56][C][wifi:373]:   Gateway: 192.168.10.254
[11:50:56][C][wifi:374]:   DNS1: 192.168.0.251
[11:50:56][C][logger:275]: Logger:
[11:50:56][C][logger:276]:   Level: **DEBUG**
[11:50:56][C][logger:277]:   Log Baud Rate: 115200
[11:50:56][C][logger:278]:   Hardware UART: UART0
[11:50:56][C][esp32_ble_tracker:787]: BLE Tracker:
[11:50:56][C][esp32_ble_tracker:788]:   Scan Duration: 300 s
[11:50:56][C][esp32_ble_tracker:789]:   Scan Interval: 320.0 ms
[11:50:56][C][esp32_ble_tracker:790]:   Scan Window: 30.0 ms
[11:50:56][C][esp32_ble_tracker:791]:   Scan Type: ACTIVE
[11:50:56][C][esp32_ble_tracker:792]:   Continuous Scanning: True
[11:50:56][C][bluetooth_proxy:140]: Bluetooth Proxy:
[11:50:56][C][mdns:094]: mDNS:
[11:50:56][C][mdns:095]:   Hostname: esp32-bluetooth-proxy-107888
[11:50:56][C][ota:089]: Over-The-Air Updates:
[11:50:56][C][ota:090]:   Address: esp32-bluetooth-proxy-107888.iot.local:3232
[11:50:56][C][api:138]: API Server:
[11:50:56][C][api:139]:   Address: esp32-bluetooth-proxy-107888.iot.local:6053
[11:50:56][C][api:143]:   Using noise encryption: NO
[11:50:58][D][api:102]: Accepted ::FFFF:C0A8:FB
[11:50:58][D][api.connection:917]: Home Assistant 2022.9.6 (::FFFF:C0A8:FB): Connected successfully
[11:55:49][I][ota:109]: Boot seems successful, resetting boot loop counter.
[11:55:49][D][esp32.preferences:113]: Saving 1 preferences to flash...
[11:55:49][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:55:50][D][esp32_ble_tracker:264]: Starting scan...
[12:00:50][D][esp32_ble_tracker:264]: Starting scan...

As you can see the device is in DEBUG mode but no bluetooth devices are found.
The only explenation I can find is that my device is not compatible
From the esphome.io website: link

Using the configuration above, first you should see a Starting scan... debug message at boot-up. Then, when a BLE device is discovered, you should see messages like Found device AC:37:43:77:5F:4C together with some information about their address type and advertised name. If you don’t see these messages, your device is unfortunately currently not supported.

But what I do not understand. I bought a new ESP32 with bluetooth support. It should be working, right?
Or is it the ESP32s what is causing issues???

I’m totally stuck and do not understand why it is not working. Anyone an idea?

if i’m not mistaken ESP32S doesn’t have BT, only ESP32 has it.

Hi Pavel,

I don’t think you are right. I tested bluetooth with my phone using a program to turn on/off the led.

(A Beginner's Tutorial on ESP32 Bluetooth | Learn ESP32 Classic Bluetooth)

According to THIS address only ESP32-S2 doesn’t have it. It seems that you don’t have S2 then.

But, return to your problem: do you have BT adapter connected on your HA? Did you install Bluetooth integration? Does your ESP32 module “see” your BT adapter, connected to HA? ESP module acts only as intermediate point, so it MUST see BT adapter or it won’t work (same as wifi repeater).

Hi Protoncek,

Great page. According to these photo’s, I should have an ESP-WROOM-32 then, right? All those names and types :wink:


The Bluetooth integration / Missing Integrated Bluetooth or USB Bluetooth Dongle was also my thought at first. I asked this in another topic. But it should not be necessary as balloob mentioned here: link

I do not understand what you mean by: Does your ESP32 module “see” your BT adapter, connected to HA?
The ESP32 Bluetooth Proxy is added as an ESP Home device.

HA integration

But I also presume the ESP32 Bluetooth Proxy can detect and show Bluetooth Devices in the log without being integrated into Home Assistant.

What bluetooth device do you have what you want to track?

Ok, now first thing i have to do is to thank YOU for the info…i didn’t know that BT proxy works without BT adapter. That’s great news! I mean…noone ever specificycally said that proxy works without adapter, and all pictures HAVE it so it’s only natural that a man concludes it’s necesarry… i thought that esp only sends received signal to “real” BT adapter…

But, back to your problem: so you don’t need BT adapter, even better, so forget that part about “ESP not seeing adapter”.
But what BT devices you have that do not show in your HA? Are they HA compatible? Like…i have 8 of xiaomi thermo/hygrometers, flashed with pvvx firmware and “bthome” selected as data type. Since bthome IS supported in HA i have them connected and running perfectly.

@Protoncek @GSzabados

I want to use it as a BLE Tracker. And I’m curious if there are any bluetooth devices in my house which sends data what I can use. So I’m not using the Bluetooth Tracker for a specific device.

The thing is: It should find bluetooth devices. I’ve got multiple Google Home/Cast devices and all other kind of bluetooth devices all over the place. These devices should be detected. And also that is not the case.
My first step is to make these visible. Than I know the ESP32 is working as expected an can I use it to read values of do other great things with it.

I’m not sure, but i think that logger level “debug” won’t show BT connections. At least mine doesn’t - i checked my BT proxies and there’s no BT received info.
Debug is default logger mode, it may not be enough. Try to use verbose or very verbose. But, be carefull, it’s warned that very verbose on long term can cause instabiltiy… use just for testing.

1 Like

As in the same article as mentioned earlier: (link)

Using the configuration above, first you should see a Starting scan... debug message at boot-up. Then, when a BLE device is discovered, you should see messages like Found device AC:37:43:77:5F:4C together with some information about their address type and advertised name. If you don’t see these messages, your device is unfortunately currently not supported.


You can increase the log level to VERY_VERBOSE to review detailed data for each discovered BLE device. This will make ESPHome print Service UUIDs, iBeacon UUIDs, iBeacon major and minor identifiers, BLE manufacturer data, RSSI and other data useful for debugging purposes. Note that this is useful only during set-up and a less verbose log level should be specified afterwards.

So in my understanding Debug should be enough. But when I want to get more information then (Very) Verbose can be used. I can try and see what happens…

Results:

[13:26:04][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -97 dB
[13:26:04][V][bluetooth_proxy:023]: Proxying packet from  - 56:94:95:86:E4:8D. RSSI: -60 dB
[13:26:07][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -97 dB
[13:26:09][V][bluetooth_proxy:023]: Proxying packet from  - 56:94:95:86:E4:8D. RSSI: -58 dB
[13:26:10][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -96 dB
[13:26:11][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:11][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -77 dB
[13:26:11][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:11][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -71 dB
[13:26:11][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:11][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -76 dB
[13:26:12][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:12][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -77 dB
[13:26:12][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:12][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -72 dB
[13:26:13][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:13][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -77 dB
[13:26:13][V][esp32_ble_tracker:772]: Unhandled type: advType: 0x08
[13:26:13][V][bluetooth_proxy:023]: Proxying packet from  - 8C:EA:48:FA:73:EF. RSSI: -71 dB
[13:26:15][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -98 dB
[13:26:19][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -96 dB
[13:26:20][V][bluetooth_proxy:023]: Proxying packet from  - 56:94:95:86:E4:8D. RSSI: -58 dB
[13:26:22][V][bluetooth_proxy:023]: Proxying packet from  - 78:BD:BC:6E:D7:ED. RSSI: -97 dB

Not really “Found device” messages… but it is something…
Not totally sure if this is what it should be, but now I can check if these addesses can be found in Home Assistant.

I let you know. Thanks.

Bluetooth is different from BLE. Maybe that ESP supports Bluetooth but not BLE?

Also, by the way, once you get it working, you should adjust the scan window longer than 30ms. The default interval is 320ms, and the default window is 30ms. So the ESP will only be scanning for BLE items for 30ms, then will rest for 290ms, then scan again for 30ms. That’s not much scanning time, so you could miss items. You can trying raising it to 200ms or higher.

Also scan type should be set to passive unless you have some special need for an active scan.

Hopefully you can figure out the hardware part first.

By the way, I am sure that any Espressif ESP marked 32D will work. Also the espressif ESP32-C will work too. Also AI-Thinker ESP-C3-13 (clones of espressif) will work too. The clones are cheaper than Espressif originals.

@Protoncek
I think it is working! Great.

So I had to set the logger to VERBOSE to see all the bluetooth devices.

Probably I do not have any device the Bluetooth Proxy can ‘use’ in Home Assistant as monitoring device (such as xiaomi thermo/hygrometers). I think those devices will popup in DEBUG mode while Bluetooth is scanning.

I now will have to detect what addresses are used by the devices I want to track.

@BlueCharmBeacons
Your post came by while I was typing this reply.
The device I bought should have " Bluetooth: v4.2 BR/EDR en BLE"
I try to adjust the scan window. Maybe something pops up after all :wink:

Thanks all!

1 Like

I wasn’t too sure if anything was being picked up by my ESPHome bluetooth proxy.
But indeed i was only to see any activity after setting the logger to VERBOSE.
Thanks!

1 Like

I’ve got the same(?) ESPWROOM32 but it says ESP32 DEVKITV1 on the back.
I can flash it in ESPHome and it gets picked up in HA, but I can’t install firmware within ESPHome in HA.
The error reads: Component not found: bluetooth_proxy
Any help would be greatly appreciated. Especially the full code I need.
Many thanks.

I was having the same problem with an ESP32 DEVKITV1. After many hours of frustration I realised that the version of ESPHome I had installed was not the latest version. After updating to the latest version everything worked fine. Check the version in settings/add ons/ESPHome. The version that I now have is 2022.9.4

Thanks so much. Seems I was runnng the Community version which wasn’t updating. I didn’t know there was an Official version as well.

Seems to have compiled and flashed, but still not seeing any devices being discovered.

Is this code correct?

substitutions:

  name: esp32-bluetooth-proxy-202a44

packages:

  esphome.bluetooth-proxy: github://esphome/bluetooth-proxies/esp32-generic.yaml@main

esphome:

  name: ${name}

  name_add_mac_suffix: false

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

esp32_ble_tracker:

  scan_parameters:

    interval: 1100ms

    window: 1100ms

    active: true

bluetooth_proxy:

  active: true

I had no luck with the bluetooth proxy, and I wound up installing openmqttgateway on the same device that you have, and instantly found tons of stuff available via BT.

2 Likes

same problems. I’m a newbie but I’d be glad to take advice. :slight_smile:

To see these device details add the below to your yaml

text_sensor:
  - platform: ble_scanner
    name: "BLE Devices Scanner" 
1 Like