Closed kojibuta closed 1 year ago
Hi @SatishSolankeEsp, Using the workaround you suggest (i.e. CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n) I am now able to use stable relase v5.1.1. It works with all devices on ESP32 and ESP32-S3. Thank you. If I understand correctly, disabling CONFIG_BT_BLE_50_FEATURES_SUPPORTED=n on ESP32-S3 enables channel select algorithm #1 by default. While enabling BLE5.0 features enables channel select algorithm #2 by default. Recently I started working with ESP32-C6 because I would like to add Zigbee support to my firmware. I found the same problem I encountered with ESP32-S3 but unfortunately the workaround does not work. That is, disabling BLE5.0 features does not switch to channel select algorithm #1. I also tried disabling CONFIG_BT_LE_50_FEATURE_SUPPORT=n without success. I found other teams are facing similar problems (e.g. https://esp32.com/viewtopic.php?t=28832). Is there a programmatic way of choosing which channel selection algorithm to use before calling esp_ble_gattc_open() ? This would be very helpful because we would like support both BLE4.2 and BLE5.0 features. Thank you.
HI @kojibuta I'll look into it and get back to you. Are you trying to use esp32c6 in a central or peripheral role? Thanks, Satish
Hi @SatishSolankeEsp, I am trying to use ESP32-C6 in a central role. I actively use ESP32 and ESP32-S3 in a central role and I would like to port my firmware on ESP32-C6 too.
Hi @kojibuta , Look like we have not ported the change on esp32c6 from esp32s3, will share the controller lib on Monday. Please let me know which IDF release are you using of esp32c6(IDFv5.1 or IDFv5.2).
Thanks, Satish
Hi @SatishSolankeEsp,
At the moment I am using the latest master branch, because of another bug in the Wi-Fi stack fixed recently #12478. I can use either the 5.1 or the 5.2 for the production build, let me know which one is going to get the fix from esp32s3. Thank you
Hi @kojibuta , That is fine could you please replace attach lib in below path esp-idf/components/bt/controller/lib_esp32c6/esp32c6-bt-lib Lib is for CS#1 algo so peripheral should be used ble4.2 4.0 . esp32c6_lib_fix.zip
let me know the result. Thanks, Satish
Hi @SatishSolankeEsp,
The lib fix solves the issue with channel select algorithm on esp32c6. Now I am able to connect to a 4.0/4.2 device successfully.
Does the fix automatically select the correct channel select algorithm based on the device? Or is it statically linked and it always use CS#2 if CONFIG_BT_LE_50_FEATURE_SUPPORT=y ?
Thank you
Hi @kojibuta , We will merge the change on IDF version 5.1,5.2, and master as well, the procedure would be the same as esp32s3. Thanks, Satish
Hi @kojibuta , We will merge the change on IDF version 5.1,5.2, and master as well, the procedure would be the same as esp32s3. Thanks, Satish
Has these fixes been merged? I am having similar issues with two T-Beams connecting to each others. Basically I am being connected to, then calling ble_gattc_disc_all_svcs() in the BLE_GAP_EVENT_CONNECT callback and gets a 7 for return value. Just would be quite odd if I wasn't connected while actually being connected to.
hi @kojibuta @nicklasb ,
We have merged the change on versions 5.1, 5.2, and the master branch. You can try the latest tag and disable the 5.0 features. Then the CS#2 will be disabled as well. The following configs should be disabled:
Answers checklist.
IDF version.
ESP-IDF v4.4.2-388-g755ce1077d
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
No response
Development Kit.
Custom board
Power Supply used.
USB
What is the expected behavior?
When using NimBLE (BLE central role) on ESP32-S3 it is not possible to discover services on some peripheral devices. The same code runs smoothly on ESP32 without errors.
After connection is established with a peripheral (event
BLE_GAP_EVENT_CONNECT
received withevent->connect.status == 0
) callingble_gattc_disc_all_svcs
should result in invokation of callback functionble_gatt_disc_svc_fn
witherror->status == 0
.What is the actual behavior?
When running the code on ESP32-S3, after connection is established with a peripheral, calling
ble_gattc_disc_all_svcs
results in immediate invokation of callback functionble_gatt_disc_svc_fn
witherror->status == 7
.Steps to reproduce.
ESP32-S3 logs (SleepO2 device OK, B02T device KO) ESP32-S3 board + SleepO2 device: esp32-s3-peripheral-1.log ESP32 board + B02T device: esp32-s3-peripheral-2.log
ESP32 logs (SleepO2 and B02T device OK) ESP32 board + SleepO2 device: esp32-peripheral-1.log ESP32 board + B02T device: esp32-peripheral-2.log
Debug Logs.
More Information.
Error always occur using some peripheral devices, but not with every device. Error occurs using ESP-IDF release/v4.4, release/v5.0 and latest versions.
Some peripheral causing the error are:
Some peripheral working without errors are: