-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
During subscribing notification on characteristic - Error 6 (0x6) GATT REQ NOT SUPPORTED (IDFGH-12790) #13768
Comments
Hello @rahult-github I (62286) NimBLE: subscribe event; conn_handle=0 attr_handle=27 reason=1 prevn=0 curn=1 previ=0 curi=0 D (62307) NimBLE: looking up our sec; D (62313) NimBLE: looking up our sec; D (62319) NimBLE: host tx hci data; handle=0 length=9 D (62324) NimBLE: ble_hs_hci_acl_tx(): D (62508) NimBLE: ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=7 data= D (62525) NimBLE: host tx hci data; handle=0 length=6 D (62530) NimBLE: ble_hs_hci_acl_tx(): D (62654) NimBLE: ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=9 data= I (62676) NimBLE: subscribe event; conn_handle=0 attr_handle=27 reason=1 prevn=1 curn=0 previ=0 curi=0 Subscribed with notification_handle =27 Please help me out with it. |
error persisting cccd; too many entries (12) .. looks like too many cccds are getting written . Please increase the value of BT_NIMBLE_MAX_CCCDS from menuconfig and try once. |
@rahult-github this will only temporarily resolve the issue. I have already tried. I have found a similar issue here = I have seen that patch provided in this issue is not matching with the current files of the nimble version. I was going through the stack of nimble in order to figure out from where exactly this error was coming. Correct me if I'm wrong the would never trigger the overflow event. As per my understanding when ble_store_write funtion is executed and this function checks for BLE_HS_ESTORE_CAP (Error), if error is found ble_store_overflow_event occurs to free up space. But since the function in image never returns the error it may never free up space. I'm using round robin fashion so ideally it should delete the oldest peer cccd's info which is not happening. This is as far as I could go i got stuck when sysinit is being called and how the functions are ensuring they are in sys init stage. Please help so that we can resolve this issue. |
Hi @veneno-529 , Can you please:
|
Hello @rahult-github So first I tried the patch still no luck. Issue is occurring. To regenerate the issue please follow below steps. Configure nimble for below settings as follows - Maximum number of concurrent connects = 1
First erase flash completely to ensure memory is clean and no previous data of connections is present.
Now in the logs I'm clearing getting error persisting cccd. Did not remove peer device. Removing peer device from index 0.
|
@rahult-github |
Hi @veneno-529 , I need sometime for this. This code is taken as is from upstream nimble and not updated by espressif. But will try to provide a fix soon. |
@rahult-github Okay will wait for the fix. Temporarily I've increased the number of Max CCCDs to store count. But don't know when it may overflow. |
Hello @rahult-github |
Answers checklist.
General issue report
Hello,
I'm using ESP - IDF 5.1.1 and NIMBLE. I have recently added notify to one my characteristics. Normally when I erase the esp32 and flash the code at first I'm able to successfully subscribe and unsubscribe notifications. Once the notification is subscribed it stays subscribed till the device disconnects. But in after certain hours when I try to subscribe the notification it gives me Error 6 (0x6) GATT REQ NOT SUPPORTED. I am trying to do this by NRF app. It subscribes and automatically unsubscribes too in case of auto connect.
PFB code below in which I have implemented the notify part. Also screenshot of the error and some logs of the device.
under gapp events function below event has been added for notifications
case BLE_GAP_EVENT_SUBSCRIBE: f_pairing = FALSE; f_ble_paired = TRUE; //vTaskResume(pirStatusHandle); MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d " "reason=%d prevn=%d curn=%d previ=%d curi=%d\n", event->subscribe.conn_handle, event->subscribe.attr_handle, event->subscribe.reason, event->subscribe.prev_notify, event->subscribe.cur_notify, event->subscribe.prev_indicate, event->subscribe.cur_indicate); if (event->subscribe.attr_handle == notification_handle) { printf("\nSubscribed with notification_handle =%d\n", event->subscribe.attr_handle); notify_state = event->subscribe.cur_notify; //!! As the client is now subscribed to notifications, the value is set to 1 printf("notify_state=%d\n", notify_state); } return 0;
below is the gatt svcs code
const struct ble_gatt_svc_def gatt_svcs[] = { {.type = BLE_GATT_SVC_TYPE_PRIMARY, .uuid = &gatt_svr_svc_uuid.u, // Define UUID for device type .characteristics = (struct ble_gatt_chr_def[]){ {.uuid = &gatt_svr_chartx_rx_uuid.u, // Define UUID for reading from esp32 and writing to esp32 .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_READ_ENC | BLE_GATT_CHR_F_WRITE_ENC, .access_cb = device_char_read_write}, { .uuid = &gatt_svr_strtx_rx_uuid.u, .val_handle = ¬ification_handle, .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_WRITE_ENC | BLE_GATT_CHR_F_NOTIFY, .access_cb = device_string_read_write}, {0}}}, {0}};
The error is occuring randomly and once it occurs I'm not able to subscribe to notifications until I erase the esp32 and again reflash it.
I have configured nimble for below settings as follows -
Additionally, when one event occurs I'm unpairing the device using below function which unpairs the device.
struct ble_hs_dev_records * peer_dev_records = ble_rpa_get_peer_dev_records(); ble_gap_unpair(&peer_dev_records[0].peer_sec.peer_addr);
The text was updated successfully, but these errors were encountered: