{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/esp-idf/issues/2734","repository_url":"https://api.github.com/repos/espressif/esp-idf","labels_url":"https://api.github.com/repos/espressif/esp-idf/issues/2734/labels{/name}","comments_url":"https://api.github.com/repos/espressif/esp-idf/issues/2734/comments","events_url":"https://api.github.com/repos/espressif/esp-idf/issues/2734/events","html_url":"https://github.com/espressif/esp-idf/issues/2734","id":383864871,"node_id":"MDU6SXNzdWUzODM4NjQ4NzE=","number":2734,"title":"ble client multiple client issue","user":{"login":"chegewara","id":1406020,"node_id":"MDQ6VXNlcjE0MDYwMjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1406020?v=4","gravatar_id":"","url":"https://api.github.com/users/chegewara","html_url":"https://github.com/chegewara","followers_url":"https://api.github.com/users/chegewara/followers","following_url":"https://api.github.com/users/chegewara/following{/other_user}","gists_url":"https://api.github.com/users/chegewara/gists{/gist_id}","starred_url":"https://api.github.com/users/chegewara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chegewara/subscriptions","organizations_url":"https://api.github.com/users/chegewara/orgs","repos_url":"https://api.github.com/users/chegewara/repos","events_url":"https://api.github.com/users/chegewara/events{/privacy}","received_events_url":"https://api.github.com/users/chegewara/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-23T15:36:26Z","updated_at":"2018-11-24T07:42:29Z","closed_at":"2018-11-24T07:42:29Z","author_association":"NONE","body":"Few weeks ago ive been able to connect one client to multiple peripherals, but ow i have some issue. It is possible (very likely tho) i messed something in my code, but here is my situation (loop):\r\n- scan for device,\r\n- connect (register app with new id),\r\n- vTaskDelay(1s), \r\n- disconnect, \r\n- vTaskDelay(1s)\r\n\r\nFirst loop is working good, but each next loop is sending n+1 events with connected only 1 peer device. Logs from first connection:\r\n```\r\nW (2793) BLEScan: ESP_GAP_SEARCH_INQ_CMPL_EVT\r\nW (2794) my_gap_event_handler: custom gap event handler, event: 3\r\nI (2796) BLEDevice: add conn_id: 255, GATT role: client\r\nW (2802) my_gattc_event_handler: custom gattc event handler, event: 0\r\nW (3489) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (3490) my_gattc_event_handler: custom gattc event handler, event: 2\r\nW (3848) my_gap_event_handler: custom gap event handler, event: 20\r\nW (4030) my_gattc_event_handler: custom gattc event handler, event: 7\r\nW (4032) my_gattc_event_handler: custom gattc event handler, event: 7\r\nW (4040) my_gattc_event_handler: custom gattc event handler, event: 7\r\nW (4050) my_gattc_event_handler: custom gattc event handler, event: 6\r\nW (4066) my_gattc_event_handler: custom gattc event handler, event: 18\r\nW (4076) my_gap_event_handler: custom gap event handler, event: 20\r\nW (5091) BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0016\r\nW (5093) my_gattc_event_handler: custom gattc event handler, event: 5\r\nW (5099) my_gattc_event_handler: custom gattc event handler, event: 41\r\n```\r\nLogs from each consecutive connection:\r\n```\r\nW (9367) my_gattc_event_handler: custom gattc event handler, event: 0\r\nW (9474) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (9476) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (9484) my_gattc_event_handler: custom gattc event handler, event: 2\r\nW (9850) my_gap_event_handler: custom gap event handler, event: 20\r\nW (9997) my_gattc_event_handler: custom gattc event handler, event: 18\r\nW (10027) my_gap_event_handler: custom gap event handler, event: 20\r\nW (10506) BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0016\r\nW (10507) BT_APPL: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0016\r\nW (10514) my_gattc_event_handler: custom gattc event handler, event: 5\r\nW (10524) my_gattc_event_handler: custom gattc event handler, event: 41\r\nW (10548) my_gattc_event_handler: custom gattc event handler, event: 41\r\n```\r\n```\r\nW (17021) my_gattc_event_handler: custom gattc event handler, event: 0\r\nW (18340) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (18341) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (18351) my_gattc_event_handler: custom gattc event handler, event: 40\r\nW (18360) my_gattc_event_handler: custom gattc event handler, event: 2\r\nW (18697) my_gap_event_handler: custom gap event handler, event: 20\r\nW (18839) my_gattc_event_handler: custom gattc event handler, event: 18\r\nW (18882) my_gap_event_handler: custom gap event handler, event: 20\r\nW (19382) BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0016\r\nW (19383) BT_APPL: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0016\r\nW (19388) BT_APPL: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0016\r\nW (19400) my_gattc_event_handler: custom gattc event handler, event: 5\r\nW (19407) my_gattc_event_handler: custom gattc event handler, event: 41\r\nW (19433) my_gattc_event_handler: custom gattc event handler, event: 41\r\nW (19443) my_gattc_event_handler: custom gattc event handler, event: 41\r\n```\r\nI would suspect its my fault but it looks to me its regression in bt stack. Disconnected devices are not deleted from bt stack. At the end this leads to this error (no more free interfaces to open):\r\n`E (56378) BT_APPL: bta_gattc_process_api_open Failed, unknown client_if: 0`\r\n"},"comment":{"url":"https://api.github.com/repos/espressif/esp-idf/issues/comments/441350096","html_url":"https://github.com/espressif/esp-idf/issues/2734#issuecomment-441350096","issue_url":"https://api.github.com/repos/espressif/esp-idf/issues/2734","id":441350096,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTM1MDA5Ng==","user":{"login":"chegewara","id":1406020,"node_id":"MDQ6VXNlcjE0MDYwMjA=","avatar_url":"https://avatars1.githubusercontent.com/u/1406020?v=4","gravatar_id":"","url":"https://api.github.com/users/chegewara","html_url":"https://github.com/chegewara","followers_url":"https://api.github.com/users/chegewara/followers","following_url":"https://api.github.com/users/chegewara/following{/other_user}","gists_url":"https://api.github.com/users/chegewara/gists{/gist_id}","starred_url":"https://api.github.com/users/chegewara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chegewara/subscriptions","organizations_url":"https://api.github.com/users/chegewara/orgs","repos_url":"https://api.github.com/users/chegewara/repos","events_url":"https://api.github.com/users/chegewara/events{/privacy}","received_events_url":"https://api.github.com/users/chegewara/received_events","type":"User","site_admin":false},"created_at":"2018-11-24T07:42:29Z","updated_at":"2018-11-24T07:42:29Z","author_association":"NONE","body":"Sorry, my bad. Ive been unregister app with appID instead of gattc_if."}}
{"actor":{"display_login":"chegewara"}}