esp-idf: ESP32-S3 BLE cannot be scanned by IOS provisioning app (IDFGH-7093)

Environment

  • Development Kit: ESP32-S3 Devkit C + ESP32-C3devKitC02
  • IDF version v4.4 c29343eb94d2f2ca17b3a5b38c82452e556147f2

Problem Description

ios provisioning app is not able to scan S3 but successfully scans C3. Using ios 15.4 on Iphone SE + Galaxy S21

I picked C3 as comparisong because they both are BLE 5.0 chipsets.

Also, both examples are using the same BLE settings, with Bluedroid - Dual mode selected, the rest is default.

Steps to reproduce

simply compile from esp-idf\examples\provisioning\wifi_prov_mgr for both C3 and S3, then flash devices.

C3 will popup in the BLE app for ios, S3 will not. Both are visible in android BLE app.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

@Weijian-Espressif , as expected, the issue is related to the protocomm component.

By comparing code of simple_ble.c and example_ble_sec_gatts_demo.c i was able to find which is the discrepancy which is causing this issue.

In example_ble_sec_gatts_demo.c the code relies on esp_ble_gap_config_adv_data for configuring the scan response. Instead, in protocomm_ble.c your colleagues used raw_adv_data for both advertising and scan response. The raw data is then set in simple_ble.c using esp_ble_gap_config_scan_rsp_data_raw.

Apparently, something in the raw data is missing -> bug.

Please check out these changes: https://github.com/KonssnoK/esp-idf/commit/a9e06bc7d88b42c07eab16b54d5ec08e1d3ff364

In this code, instead of using a raw data, function esp_ble_gap_config_adv_data is used. In this way the name of the device gets updated immediately also with provisioning app.

I didn’t create a fix but just a proof of fault, as can be seen from

        static uint8_t test_manufacturer[3]={'E', 'S', 'P'};
        static esp_ble_adv_data_t heart_rate_scan_rsp_config = {
            .set_scan_rsp = true,
            .include_name = true,
            .manufacturer_len = sizeof(test_manufacturer),
            .p_manufacturer_data = test_manufacturer,
        };
        ret = esp_ble_gap_config_adv_data(&heart_rate_scan_rsp_config);

Also, some of the changes were made just to make the code look more similar to example_ble_sec_gatts_demo.c (example, using ret = esp_ble_gap_config_local_privacy(true);)

Please forward to your colleagues for fixing.

Thanks!