BLE scanning misses some devices - how do I find the reason?

designandmake
Posts: 1
Joined: Wed Jun 09, 2021 7:47 pm

BLE scanning misses some devices - how do I find the reason?

Postby designandmake » Wed Jun 09, 2021 8:17 pm

I'm using https://github.com/espressif/esp-idf/bl ... ttc_demo.c to scan for BLE devices. I've also tried using Arduino(-ESP32) and MicroPython. I'm using ESP-IDF v4.1.

I've used nRF Connect on an Android phone to try to see any differences between the devices which are found, and those which are not. It's very clear that some devices are *always* missed by the esp32. I've tried several different esp32 developer boards (from LilyGo, m5 stack).

If I write code to run on an nRF52832, nRF52833 or nRF52840 - all of those find the 'missing' devices; only the esp32 misses them.

I've taken devices away from a building to ensure no other interference.

I assume the answer is going to be something around the "version" of BLE. Can anyone give me a tip on how to find that out, for given device? I can find the devices with BlueZ on linux OK. I see at https://www.esp32.com/viewtopic.php?t=19336 that esp32 does not have BLE 5. How can I tell if, for a particular device, BLE 5 is needed to recognise the Advertisement?

nRF Connect, I think, tells me that one of the devices which esp32 doesn't see, uses PHY of LE 1M (e.g., not the 2M of BLE 5) when I connect to it with the nRF Connect app.

In gattc_demo, I've tried increasing the scan window:

Code: Select all

    ⋮ 74 │    .scan_interval          = 0x4000,
    ⋮ 75 │    .scan_window            = 0x3000,
and also set a longer duration:

Code: Select all

    ⋮325 │        uint32_t duration = 100;

dtdobney
Posts: 1
Joined: Sat Jan 27, 2024 2:59 am

Re: BLE scanning misses some devices - how do I find the reason?

Postby dtdobney » Sat Jan 27, 2024 3:10 am

Hi,

I am using two esp32 devices; each of them simultaneously advertising and scanning.
I use NRFConnect from an Android phone to scan for troubleshooting.

NRFConnect could detect the advertisements of both esp32 devices.
My first esp32 device could not detect the the advertisement of the second esp32.
Similarly, my second esp32 device could not detect the advertisement of the first esp32.
Each esp32 could detect advertisements from Sony wireless headphones
(I had the sony headphones nearby in advertising mode, i.e. - right after they are turned on, to test the ability of esp32 to scan)
(I should add that the esp32's receipt of advertising data from the Sony headphones was sometimes only partial)
(NRFConnect detected the sony headphones as well)


However, when I bring those two esp32 devices right next to each other (~1 inch apart), in fact they can detect each other in a scan.
Then I realized that my esp32 devices don't have a strong antennae (at least not yet...I plan to add an external antenna later).
In summary, I believe the ability of the esp32's to transmit and detect is not as strong as the sony headphones and android respectively.

Seems obvious now I guess.
I hope this helps, or perhaps there is something more complicated at play in your application.

Who is online

Users browsing this forum: Baidu [Spider], HighVoltage and 111 guests