espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.38k stars 7.22k forks source link

BLE full scan feature seems ineffective for BLE mesh performance on esp-idf v4.1 (IDFGH-4122) #5989

Open AlpinProgrammer opened 3 years ago

AlpinProgrammer commented 3 years ago

Environment

Problem Description

Hello, We develop a BLE mesh solution and we are currently sending BLE mesh generic onoff commands to a BLE mesh generic onoff server.

In order to assert that the command has been successful, we are expecting an ACK from the server. We already made sure that the ACK was sent by the server so we know the ESP32 doesn't receive all the ACKs.

This is why we used the BLE full scan feature (BTDM_CTRL_FULL_SCAN_SUPPORTED). We meet the direct dependencies (BTDM_CTRL_MODE_BLE_ONLY(=y) || BTDM_CTRL_MODE_BTDM(=n)).

The BLE full scan feature proved to be effective using esp-idf v4.0 release. However, using esp-idf v4.1 release, we notice similar performance regardless of BLE full scan feature being activated.

Expected Behavior

The BLE full scan feature improves BLE mesh performance in esp-idf v4.0 and v4.1.

Actual Behavior

The BLE full scan feature shows to only be effective in esp-idf v4.0.

Steps to reproduce

  1. Use an ESP32 to send generic onoff commands to a BLE mesh generic onoff server (ESP32 or nRF)
  2. Compare the percentage of status messages received with and without BLE full scan feature

Thanks

AlpinProgrammer commented 3 years ago

Has anyone noticed this issue ?

To illustrate what I observed, I launched 120 commands and observed the performance using esp-idf v4.0 and v4.1 releases:

To be accurate, I noticed that 100% of the commands were taken into account by the server. Also, the status messages are sent by the server. The problem is the ESP32 not receiving those messages. I made sure to perform both tests in the same conditions (distance client <-> server, amount of wireless devices around...)

Campou commented 3 years ago

Hi @AlpinProgrammer

Thanks for reporting this.

If convenient, could you please help to provide the commit id used for esp-idf v4.0 and esp-idf v4.1? Are they idf tag v4.0 and idf tag v4.1?

Thanks.

AlpinProgrammer commented 3 years ago

Hi @Campou Sure. For both I used the tagged release. esp-idf v4.0: 463a9d8b7f9af8205222b80707f9bdbba7c530e1 esp-idf v4.1: 5ef1b390026270503634ac3ec9f1ec2e364e23b2

So yes, I rely on the tags you sent.

AlpinProgrammer commented 3 years ago

Hi @Campou Did you make the same observation as I did ? It's important to notice that with an ESP32 as server, the results are very good both with and without full scan activated. If you can, I suggest you use an nRF server (we use an nRF52840) instead.

Thanks

AlpinProgrammer commented 3 years ago

Hello @Campou ! I have some update as I tried to do the same test on the new esp-idf v4.0.2. It seems that it gives the same results as previously: the BLE full scan feature doesn't improve the mesh performance.

It is a major issue for us as what we are trying to develop does not give a satisfactory reliability with ESP32 for the reasons described above. Don't hesitate if you need any additional information to help you reproduce the issue.

Thanks