BLE Scan Event Performance Issue
Posted: 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 ************************************************************************
********************************************************************************************************************
System Out is Other task which clear list every seconds. ,
Scan parameter is
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
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
};