espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.46k stars 7.25k forks source link

Very short SMP_RSP_TIMEOUT during BLE pairing #1851

Closed semireg closed 6 years ago

semireg commented 6 years ago

I'm using gatt_security_server to implement pairing/encryption for PyCom WiPY based on ESP32. I can successfully run the example but am having issues with only 3-4 seconds between getting the passkey prompt in iOS/Android and the ESP32 timing out w/ SMP_RSP_TIMEOUT. In other issues/threads/documentation it says that 30 seconds should be allowed. Does anyone know why I experience shorter timeouts?

mahavirj commented 6 years ago

@Yulong-espressif Could you please comment here?

Yulong-espressif commented 6 years ago

@semireg You should used the esp_ble_gap_set_prefer_conn_params function to set the supervision timeout value. To give the user a better experience, we set the default value for the supervision timeout to 6s. Hope this answer can help you, thanks.