Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_ble_gattc_get_descr_by_char_handle error after thousands of hours (IDFGH-9970) #11255

Open
3 tasks done
dgrnbrg opened this issue Apr 22, 2023 · 1 comment
Open
3 tasks done
Assignees
Labels
Awaiting Response awaiting a response from the author Resolution: Cannot Reproduce Issue cannot be reproduced Status: Done Issue is done internally

Comments

@dgrnbrg
Copy link

dgrnbrg commented Apr 22, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

After several weeks of interaction with a BLE client device, it seems that the esp-idf ble stack fails to map the descriptor to the characteristic handle. The code just connects to a BLE server, issues 4 writes to another characteristic, and then requests to be notified on another. This code works for dozens of devices for weeks to months, but eventually the notify never works again.

I have another app on the iphone that can also connect to the BLE server using the same commands, and that continues to work as normal, even when the esp cannot connect.

This is the log when it doesn't work correctly:

[16:21:56][D][esp32_ble_client:048]: [1] [3F:A4:9D:4B:00:D6] Found device
[16:21:56][D][esp32_ble_tracker:214]: Pausing scan to make connection...
[16:21:56][I][esp32_ble_client:064]: [1] [3F:A4:9D:4B:00:D6] 0x00 Attempting BLE connection
[16:21:57][I][ble_sensor:031]: [entrance_id_internal_parser] Connected successfully!
[16:21:57][D][ble_client.automation:050]: Connection established with 3F:A4:9D:4B:00:D6
[16:21:57][I][esp32_ble_client:196]: [1] [3F:A4:9D:4B:00:D6] Connected
[16:21:57][D][entrance_id_connect:063]: connecting
[16:21:57][D][ble_client.automation:063]: Found characteristic 0000FFF2-0000-1000-8000-00805F9B34FB on device 3F:A4:9D:4B:00:D6
[16:21:57][D][esp32_ble_tracker:246]: Starting scan...
[16:21:57][D][2410_ble_auth:072]: password for 3F:A4:9D:4B:00:D6 = HiLink
[16:21:57][D][ble_client.automation:029]: Write type: ESP_GATT_WRITE_TYPE_NO_RSP
[16:21:58][D][memory:025]: Free Heap Size: 78484 bytes
[16:21:58][D][entrance_id_connect:086]: completed ble connection process, waiting for updates...
[16:21:58][D][entrance_id_notify:109]: registered for notify, handle = 8, status = 0
[16:21:58][W][esp32_ble_client:215]: [1] [3F:A4:9D:4B:00:D6] esp_ble_gattc_get_descr_by_char_handle error, status=10

This is the log when it works correctly:

[16:35:15][D][esp32_ble_client:048]: [0] [9E:AE:BB:4B:70:EA] Found device
[16:35:15][D][esp32_ble_tracker:214]: Pausing scan to make connection...
[16:35:15][I][esp32_ble_client:064]: [0] [9E:AE:BB:4B:70:EA] 0x00 Attempting BLE connection
[16:35:15][I][ble_sensor:031]: [computer_area_id_internal_parser] Connected successfully!
[16:35:15][D][ble_client.automation:050]: Connection established with 9E:AE:BB:4B:70:EA
[16:35:15][I][esp32_ble_client:196]: [0] [9E:AE:BB:4B:70:EA] Connected
[16:35:15][D][computer_area_id_connect:043]: connecting
[16:35:15][D][ble_client.automation:063]: Found characteristic 0000FFF2-0000-1000-8000-00805F9B34FB on device 9E:AE:BB:4B:70:EA
[16:35:15][D][esp32_ble_tracker:246]: Starting scan...
[16:35:16][D][2410_ble_auth:072]: password for 9E:AE:BB:4B:70:EA = HiLink
[16:35:16][D][ble_client.automation:029]: Write type: ESP_GATT_WRITE_TYPE_NO_RSP
[16:35:16][D][computer_area_id_connect:086]: completed ble connection process, waiting for updates...
[16:35:16][D][computer_area_id_notify:109]: registered for notify, handle = 8, status = 0

Is there some part of the ble api that may be causing this information to disappear from the esp32 but still be available with similar code on iphone?

@github-actions github-actions bot changed the title esp_ble_gattc_get_descr_by_char_handle error after thousands of hours esp_ble_gattc_get_descr_by_char_handle error after thousands of hours (IDFGH-9970) Apr 22, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 22, 2023
@esp-zhp
Copy link
Collaborator

esp-zhp commented Nov 17, 2023

How should I reproduce the issue? Can you reliably reproduce the issue on your end?

@espressif-bot espressif-bot added the Awaiting Response awaiting a response from the author label Feb 28, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Cannot Reproduce Issue cannot be reproduced and removed Status: Opened Issue is new labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Cannot Reproduce Issue cannot be reproduced Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants