Closed korstiaanS closed 5 years ago
@korstiaanS , Bluetooth disconnected after pairing failed. You set ocap = ESP_IO_CAP_OUT
, example will print passkey, your phone need input the passkey, but your gap_event_handler ()
do nothing, So pairing failed. please refer to our gatt_security_server example.
I saw that too, added some code but same result. If I try the gatt_security_server example I get the same result. (disconnect after 30 sec.) This is the result:
I (829) SEC_GATTS_DEMO: app_main init bluetooth
I (979) SEC_GATTS_DEMO: The number handle = 8
I (999) SEC_GATTS_DEMO: advertising start success
I (28279) SEC_GATTS_DEMO: ESP_GATTS_CONNECT_EVT
I (28399) SEC_GATTS_DEMO: The passkey Notify number:123456
I (32369) SEC_GATTS_DEMO: key type = ESP_LE_KEY_LENC
I (32369) SEC_GATTS_DEMO: key type = ESP_LE_KEY_LID
I (62479) SEC_GATTS_DEMO: remote BD_ADDR: 42230d487f68
I (62479) SEC_GATTS_DEMO: address type = 1
I (62479) SEC_GATTS_DEMO: pair status = fail
I (62489) SEC_GATTS_DEMO: fail reason = 0x63
I (62489) SEC_GATTS_DEMO: Bonded devices number : 0
I (62499) SEC_GATTS_DEMO: Bonded devices list : 0
W (65479) BT_BTM: btm_sec_clr_temp_auth_service() - no dev CB
I (65479) SEC_GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x16
I (65489) SEC_GATTS_DEMO: advertising start success
After 30 sec. I get a fail? Why?
@korstiaanS, I use iPhone6s test gatt_security_server example, ESP32 works well.
please make erase_flash
to rease the flash of esp32 , Clear the pairing record in your phone's Bluetooth and try, thanks.
here is the log: I (8375) SEC_GATTS_DEMO: ESP_GATTS_CONNECT_EVT I (8445) SEC_GATTS_DEMO: The passkey Notify number:123456 I (12385) SEC_GATTS_DEMO: key type = ESP_LE_KEY_LENC I (12385) SEC_GATTS_DEMO: key type = ESP_LE_KEY_LID I (12535) SEC_GATTS_DEMO: key type = ESP_LE_KEY_PENC I (12535) SEC_GATTS_DEMO: key type = ESP_LE_KEY_PID I (12535) SEC_GATTS_DEMO: remote BD_ADDR: 75a92ebb3abc I (12545) SEC_GATTS_DEMO: address type = 1 I (12545) SEC_GATTS_DEMO: pair status = success I (12555) SEC_GATTS_DEMO: auth mode = INVALID BLE AUTH REQ I (12555) SEC_GATTS_DEMO: Bonded devices number : 1
I (12565) SEC_GATTS_DEMO: Bonded devices list : 1
I (12565) SEC_GATTS_DEMO: 75 a9 2e bb 3a bc
Hi,
erase_flash did not help.
Clear the pairing record in your phone's Bluetooth
Where is that? Under Settings Bluetooth is no ESP32 pairing visible?
Hi,
Tried on an ipad pro and there it worked. A setting somewhere?
I found it. It seems to be that the ESP was under Bluetooth devices BUT with a generic name and therefore I didn't found it directly. I deleted this and now it works fine. THANKS!
I also have a small question: If I In the sp_gatts_attr_db_t use a NULL for a characteristic value. Where will the received value be stored? Will the ESP library allocate memory for this? I noticed if I don't point to a variable, the ESP keeps the value so that at a read or write this value is saved. Where?
Hi,
I'm using idf version 3.2, ios 12.3.1. App on iphone = LightBlue (BLE Scanner and nRF Connect does not work? After pressing on connect the login box appears BUT disappears automatically after 1 sec. Therefore I cannot enter the pincode)
First I tried the gatts table example from idf and that works without any timeout.
Then I added the security because I want to protect the variables via a pin code. Therefore I added some code from the idf security server example. It all works fine but after approx. 30 seconds I get the following messaging and have to reconnect again:
I also noticed that, after added the security, I get:
BT_L2CAP: l2cble_start_conn_update, the last connection update command still pending.
The complete output is:I suppose the timeout is coming from this
BT_L2CAP: l2cble_start_conn_update, the last connection update command still pending.
?What did I do wrong?
This is the complete code: