I am having problems establishing a BLE connection, using the Nimble BLE library under ESP-IDF release 4.2. I discovered this problem in our own project but I have been able to reproduce with the Nimble "blehr" demo app as well.
* Copy the "blehr" project from esp-idf\examples\bluetooth\nimble
* Build with Docker and ESP-IDF release 4.2:
Code: Select all
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.2 idf.py build
* Scan using a BLE scanner app on an Android device
* See "blehr_sensor_1.0" (expected)
* Attempt to connect
* ESP32 log shows: "connection established; status=0"
* Scan app shows "Discovering services..."
* After approx 10s, scan app shows "Disconnected"
* ESP32 log shows: "disconnect; reason=520"
* Connect FAILS.
When I delete the "build" directory and repeat the above with espressif/idf:release-v4.1, it works correctly - i.e.
* Scan app shows "Discovering services..." for 1 - 2 seconds
* Scan app shows "Connected"
* Can see services, read, notify, etc.
I also tested by cloning esp-idf from github and checking out release/v4.x, and then builing and deploying the project from VSCode.
I encountered the same problem, i.e. connect fails when built with v4.2, but works with v4.1