esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
293 stars 36 forks source link

BLE device not being detected #4056

Open kapet opened 1 year ago

kapet commented 1 year ago

The problem

I'm trying to use a BLE device (it's a Radoneye), to no avail. I have tracked this down to be a fundamental BLE issue: My phone (using 'nRF Connect') can see the device just fine when scanning, but the ESP32 next to the device reports on various other BLE devices in the vicinity, except for this one.

So the ESP32 BLE feature works in principle, also the Radoneye does send out advertisements. But for whatever reason the ESP32 does not see or report on it.

(The Radoneye sensor is not enabled right now, this is a problem with the Bluetooth/BLE stack and not the Radoneye sensor.)

Which version of ESPHome has the issue?

2022.12.3

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.1.6

What platform are you using?

ESP32

Board

az-delivery-devkit-v4

Component causing the issue

esp32_ble_tracker

Example YAML snippet

esp32:
  board: az-delivery-devkit-v4
  framework:
    type: arduino

logger:
  level: VERY_VERBOSE

esp32_ble_tracker:

Anything in the logs that might be useful for us?

example OTHER device:
[14:26:49][VV][esp32_ble_tracker:648]: Parse Result:
[14:26:49][VV][esp32_ble_tracker:665]:   Address: C9:E1:75:8E:C7:D7 (RANDOM)
[14:26:49][VV][esp32_ble_tracker:667]:   RSSI: -89
[14:26:49][VV][esp32_ble_tracker:668]:   Name: 'Hue Lamp'
[14:26:49][VV][esp32_ble_tracker:670]:   TX Power: 2
[14:26:49][VV][esp32_ble_tracker:676]:   Ad Flag: 6
[14:26:49][VV][esp32_ble_tracker:679]:   Service UUID: 0xFE0F
[14:26:49][VV][esp32_ble_tracker:693]:   Service data:
[14:26:49][VV][esp32_ble_tracker:694]:     UUID: 0xFE0F
[14:26:49][VV][esp32_ble_tracker:695]:     Data: 04.10.8F.06.06 (5)
[14:26:49][VV][esp32_ble_tracker:698]: Adv data: 02.01.06.03.02.0F.FE.08.16.0F.FE.04.10.8F.06.06.02.0A.0A.09.09.48.75.65.20.4C.61.6D.70 (29)

Additional information

according to nRF Connect, the Radoneye device advertises about every 65ms; raw advertising data as seen by my phone: 0x130946523A5232303A534E30323931202020202003190000020106020AF403032315110723D1BCEA5F782315DEEF121223150000

screenshot from parsed advertising data on phone: Screenshot_20230122-143136

kapet commented 1 year ago

Some more experiments this weekend:

  1. took a new ESP32, installed https://github.com/redakker/blecker, and it shows the 'missing' device as present, so this hardware is ok
  2. reflashed this ESP32 to ESPHome with a naive esp32_ble_tracker setup and again it does not show the missing device (but various others, e.g. Hue lamps)
  3. looked the the Blecker sourcecode and it is running with quite different scan settings. Changed my ESPHome settings to match, and now it does show the device!
esp32_ble_tracker:
  scan_parameters:
    interval: 100ms
    window: 99ms
    active: True

Maybe it's the other BLE devices in the vicinity, maybe it is something about this device, I don't know. But with the default scan_parameters it is not being found.