Page 1 of 1

BLE Central: Can't connect to peripheral while scanning.

Posted: Sun Jul 09, 2017 11:43 pm
by Lucas.Hutchinson
Hi All,

In my application I am developing the ESP32 so that as a ble central it can connect to multiple peripherals.
Ideally the app would be able to scan for devices and connect to them as the app discovers them, without stopping the scan.

However I have come across an issue where the app wont connect while scanning.
The app is performing a BLE scan.
The app then tries to connect to a discovered peripheral, while still scanning. The ESP_GATTC_OPEN_EVT returns either "ESP_GATT_ERROR" or "ESP_GATT_BUSY".

If the app stops scanning, then tries to connect, the ESP_GATTC_OPEN_EVT returns with "ESP_GATT_OK"

Please let me know if any more information is needed.

Re: BLE Central: Can't connect to peripheral while scanning.

Posted: Mon Jul 10, 2017 3:09 am
by kolban
Note, I am NOT saying what you are trying to do is wrong ... I don't know.

A question however, if you execute a scan, find a target peer device you want to connect against, stop scanning, connect and then start scanning for the next one ... does that work?

Re: BLE Central: Can't connect to peripheral while scanning.

Posted: Mon Jul 10, 2017 4:04 am
by Lucas.Hutchinson
Hi @Kolban,

Thanks for your response, this is what i am doing currently.
It does work, however it forces delays with interaction with the ESP32, which is not ideal.

However sometimes it can take a while for the Bluetooth connection to connect successfully.
In these cases the application has to wait around until this connection is successful before the scanning can be re-started.

It's not a deal breaker, but would be good if there was some way for this to happen to make interacting with Bluetooth on the ESP32 feel a bit snappier.

Re: BLE Central: Can't connect to peripheral while scanning.

Posted: Sun Jul 16, 2017 9:40 pm
by Lucas.Hutchinson
Just checking if anyone has any more idea about why this doesnt work properly?

@WiFive @ESP_Angus or anyone else from espressif, Is this a known issue?

Re: BLE Central: Can't connect to peripheral while scanning.

Posted: Wed Jun 26, 2019 7:25 am
by aidan.cyr
Hi,

I too am wondering if this is possible or in the works for esp-idf?
It’s not a deal-breaker, would just be good to know if this will ever be possible ?
Is anyone from Espressif able to let us know ?

Thanks.