on BLE scan error

zamek42@gmail.com
Posts: 34
Joined: Sat Dec 02, 2017 7:27 pm

on BLE scan error

Postby zamek42@gmail.com » Mon Aug 16, 2021 4:12 pm

Hi All,
I used a heart rate device (Polar) in my application. It works like this, when the device is not connected I always start a scanning in every 30 secs, until I found the device. It works well, but sometimes I got an error when device came back:

I (77888660) HR_CLIENT: Start bluetooth scanning
W (77888670) BT_APPL: bta_dm_ble_scan start scan failed. status=0x3

After that I cannot reconnect the device I need to restart my application.
I implemented event mechanism like:

Code: Select all

  
       ...
       case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
        //scan start complete event to indicate scan start successfully or failed
        if (param->scan_start_cmpl.status == ESP_BT_STATUS_SUCCESS)
        	GAP_LOGD(TAG, "Scan start success");
        else {
        	GAP_LOGD(TAG, "Scan start failed");
        }
        ...
but it is never called.
My question is that, how can I detect when something is wrong, and how can I reset the ble subsytem correctly?

thx,
Zamek

Sports5115
Posts: 12
Joined: Mon Jul 24, 2023 2:32 pm

Re: on BLE scan error

Postby Sports5115 » Fri Jun 07, 2024 11:34 pm

Same issue for me too with head on WROOM32

Code: Select all

[1B][0;32mI (543) BTDM_INIT: BT controller compile version [8a84778][1B][0m
[1B][0;32mI (553) phy_init: phy_version 4791,2c4672b,Dec 20 2023,16:06:06[1B][0m
[1B][0;32mI (953) BLE: ble_init finished.[1B][0m
[1B][0;31mE (953) BT_BTM: BTM_BleScan scan already active[1B][0m
[1B][0;33mW (963) BT_APPL:  bta_dm_ble_scan start scan failed. status=0x6

Who is online

Users browsing this forum: Baidu [Spider] and 117 guests