BLE Scan Event Performance Issue

veyselka
Posts: 2
Joined: Fri Mar 30, 2018 9:05 am

BLE Scan Event Performance Issue

Postby veyselka » Wed Jun 13, 2018 7:33 am

Hi ,

I'm working on ESP32 IDF and , I need some information about BLE scanner performance. My Goal is Find all Beacon is specific Time. I need high pricision for counting goods person & inventory in limited Area, I can only scan object ~100 times in second.

I'm using BLE i beacon example and remove just İbeacon filter. on Scan result Event. So it must found everything..

I wonder is there any physical or theoretical limit for max. scanned device per limited time like 1 seconds. How Can I scan faster & more devices. ? I'm not using any wifi stack or command.

This is my example code , on esp_gap_cb, copy scanned BDA, Adv, RSSI to a structure and add these information to ObservedBLE list.
Another thread is flush "ObservedBLE list" and count similar object on list, and system out similar object and total object.

I'm using beacon simulator software on my mobile phone. ( 3~ mobile phone create 35 virtual beacon and also found around 5 -6 real one)



*************************** esp_gap_cb ************************************************************************

Code: Select all

   
    case ESP_GAP_BLE_SCAN_RESULT_EVT: {
        esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;
        switch (scan_result->scan_rst.search_evt) {
        case ESP_GAP_SEARCH_INQ_RES_EVT:

              memcpy(observedBLE.bda, scan_result->scan_rst.bda, sizeof(observedBLE.bda));
              memcpy(observedBLE.ble_adv, scan_result->scan_rst.ble_adv, sizeof(observedBLE.ble_adv));
              observedBLE.rssi=scan_result->scan_rst.rssi;
              counter++;
              //esp_log_buffer_hex("BDA:", observedBLE.bda, ESP_BD_ADDR_LEN );
              addBleToList(observedBLE); // check if beacon already Scanned Before
            break;
        default:
            break;
        }
        break;
    }

********************************************************************************************************************


System Out is Other task which clear list every seconds. ,

Code: Select all

(1221299) BLE: OBSERVED BLE: 94 -> 30     // response event appear 94 times in 1 sec.  , 30  different Mac
(1222299) BLE: OBSERVED BLE: 109 -> 30   // response event appear 109 times  1 sec, 30 different Mac
(1223299) BLE: OBSERVED BLE: 111 -> 32   // response event appear 109 times  1 sec, 30 different Mac


Scan parameter is

Code: Select all

static esp_ble_scan_params_t ble_scan_params = {
    .scan_type              = BLE_SCAN_TYPE_ACTIVE,
    .own_addr_type          = BLE_ADDR_TYPE_PUBLIC,
    .scan_filter_policy     = BLE_SCAN_FILTER_ALLOW_ALL,
    .scan_interval          = 0x50,
    .scan_window            = 0x50
};

chegewara
Posts: 372
Joined: Wed Jun 14, 2017 9:00 pm

Re: BLE Scan Event Performance Issue

Postby chegewara » Tue Jun 19, 2018 1:33 am

Did you setup ble settings according:
- BLE Scan Duplicate Options
- Maximum number of devices in scan duplicate filter (range 10-200)

veyselka
Posts: 2
Joined: Fri Mar 30, 2018 9:05 am

Re: BLE Scan Event Performance Issue

Postby veyselka » Tue Jun 19, 2018 10:33 am

Dear Cheguevera,

My sdkconfig file doesn't have a parameter for "CONFIG_BLE_SCAN_DUPLICATE". I add custom filter for duplicated scan result. If SDK has kind of option it will be efficent then mine.
How can I setup CONFIG_BLE_SCAN_DUPLICATE ?


I'm using "ESP-IDF Ver:v3.1-dev-961-ga2556229-dirty"

Who is online

Users browsing this forum: No registered users and 3 guests