{"action":"created","issue":{"url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/649","repository_url":"https://api.github.com/repos/nkolban/esp32-snippets","labels_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/649/labels{/name}","comments_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/649/comments","events_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/649/events","html_url":"https://github.com/nkolban/esp32-snippets/issues/649","id":360587349,"node_id":"MDU6SXNzdWUzNjA1ODczNDk=","number":649,"title":"HID Gamepad constant disconnects.","user":{"login":"GameDragon2k","id":3225327,"node_id":"MDQ6VXNlcjMyMjUzMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/3225327?v=4","gravatar_id":"","url":"https://api.github.com/users/GameDragon2k","html_url":"https://github.com/GameDragon2k","followers_url":"https://api.github.com/users/GameDragon2k/followers","following_url":"https://api.github.com/users/GameDragon2k/following{/other_user}","gists_url":"https://api.github.com/users/GameDragon2k/gists{/gist_id}","starred_url":"https://api.github.com/users/GameDragon2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GameDragon2k/subscriptions","organizations_url":"https://api.github.com/users/GameDragon2k/orgs","repos_url":"https://api.github.com/users/GameDragon2k/repos","events_url":"https://api.github.com/users/GameDragon2k/events{/privacy}","received_events_url":"https://api.github.com/users/GameDragon2k/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-09-16T00:08:00Z","updated_at":"2018-09-16T03:30:53Z","closed_at":null,"author_association":"NONE","body":"I am using my ESP32 as a HID Gamepad and I am running into issues with it.\r\n\r\nConnection seems fine at the beginning but after several perfectly working inputs, I get a hard lag spike followed by disconnect. The lag itself is a big issue, but after reconnecting, the ESP32 will continue to disconnect itself every 90 seconds or so, regardless if I send any inputs or not.\r\n\r\nHere is my code: https://gist.github.com/GameDragon2k/90709fbe6b15e66c1b274dde3e1b2439\r\n\r\nAnd this is debug for disconnects/reconnects:\r\n```\r\n[D][BLEDevice.cpp:96] gattServerEventHandler(): gattServerEventHandler [esp_gatt_if: 4] ... ESP_GATTS_DISCONNECT_EVT\r\n[D][BLEUtils.cpp:1647] dumpGattServerEvent(): GATT ServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLEUtils.cpp:1723] dumpGattServerEvent(): [conn_id: 0, remote_bda: 5c:f3:70:74:7d:d3]\r\n[D][BLEServer.cpp:177] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_DISCONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLEServer.cpp:342] startAdvertising(): >> startAdvertising\r\n[D][BLEAdvertising.cpp:174] start(): >> start: customAdvData: 0, customScanResponseData: 0\r\n[D][BLEAdvertising.cpp:187] start(): - advertising service: 00001812-0000-1000-8000-00805f9b34fb\r\n[D][BLEAdvertising.cpp:231] start(): << start\r\n[D][BLEServer.cpp:344] startAdvertising(): << startAdvertising\r\n[D][BLEServer.cpp:295] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1099] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1285] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_ADV_START_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1123] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEServer.cpp:342] startAdvertising(): >> startAdvertising\r\n[D][BLEAdvertising.cpp:174] start(): >> start: customAdvData: 0, customScanResponseData: 0\r\n[D][BLEAdvertising.cpp:187] start(): - advertising service: 00001812-0000-1000-8000-00805f9b34fb\r\n[D][BLEAdvertising.cpp:231] start(): << start\r\n[D][BLEServer.cpp:344] startAdvertising(): << startAdvertising\r\nstart advertising\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_ADV_DATA_SET_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1099] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_SCAN_RSP_DATA_SET_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1285] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEUtils.cpp:1091] dumpGapEvent(): Received a GAP event: ESP_GAP_BLE_ADV_START_COMPLETE_EVT\r\n[D][BLEUtils.cpp:1123] dumpGapEvent(): [status: 0]\r\n[D][BLEServer.cpp:135] handleGAPEvent(): BLEServer ... handling GAP event!\r\n[D][BLEDevice.cpp:96] gattServerEventHandler(): gattServerEventHandler [esp_gatt_if: 4] ... ESP_GATTS_CONNECT_EVT\r\n[D][BLEUtils.cpp:1647] dumpGattServerEvent(): GATT ServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLEUtils.cpp:1707] dumpGattServerEvent(): [conn_id: 0, remote_bda: 5c:f3:70:74:7d:d3]\r\n[D][BLEServer.cpp:177] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_CONNECT_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\nConnection established!\r\n[D][BLEServer.cpp:295] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLEDevice.cpp:96] gattServerEventHandler(): gattServerEventHandler [esp_gatt_if: 4] ... ESP_GATTS_MTU_EVT\r\n[D][BLEUtils.cpp:1647] dumpGattServerEvent(): GATT ServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLEUtils.cpp:1766] dumpGattServerEvent(): [conn_id: 0, mtu: 517]\r\n[I][BLEDevice.cpp:113] gattServerEventHandler(): ESP_GATTS_MTU_EVT, MTU 517\r\n[D][BLEServer.cpp:177] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLECharacteristic.cpp:209] handleGATTServerEvent(): >> handleGATTServerEvent: ESP_GATTS_MTU_EVT\r\n[D][BLECharacteristic.cpp:461] handleGATTServerEvent(): << handleGATTServerEvent\r\n[D][BLEServer.cpp:295] handleGATTServerEvent(): << handleGATTServerEvent\r\n```"},"comment":{"url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/comments/421681957","html_url":"https://github.com/nkolban/esp32-snippets/issues/649#issuecomment-421681957","issue_url":"https://api.github.com/repos/nkolban/esp32-snippets/issues/649","id":421681957,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTY4MTk1Nw==","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-09-16T03:30:53Z","updated_at":"2018-09-16T03:30:53Z","author_association":"CONTRIBUTOR","body":"You could try to prepare test case. Just simplify code, or use the one from #632 and send button on/off with some small delay between. \r\n\r\nI cant explain that but there is many issues reported that i cant recreate because users code works for me, in other hand i am reporting some ble issues that cant be recreated by espressif devs."}}
{"actor":{"display_login":"chegewara"}}