IOS BLE not re-pairing when clearing whitelist

ReinierH
Posts: 2
Joined: Thu Jul 12, 2018 2:32 pm

IOS BLE not re-pairing when clearing whitelist

Postby ReinierH » Thu Jul 12, 2018 4:41 pm

Hi!

We are using an esp32 in one of our devices. We succesfully managed to setup BLE with GATT, GAP server and Secure bonding and read out characteristics however, when I pair with our device using an IOS app, then clear the whitelist and bonding info on the device and try to reconnect again using the IOS app (without forgetting the device in the BT menu) It won't be able to connect. When I try the same thing with an android device it works fine.

I'm using ESP-IDF 3.0

Could it be possible that the esp is not initiating a new pair request?
If I choose "forget" in IOS and then pair the device it works fine, also reconnecting to the device works fine.


Regards

Code: Select all

   esp_ble_auth_req_t auth_req = ESP_LE_AUTH_REQ_SC_BOND;
   ESP_ERROR_CHECK(esp_ble_gap_set_security_param(ESP_BLE_SM_AUTHEN_REQ_MODE, &auth_req,              sizeof(uint8_t)));

   //set the IO capability to No output No input
   //because device has no LCD screen or numpad
   esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE;
   ESP_ERROR_CHECK(esp_ble_gap_set_security_param(ESP_BLE_SM_IOCAP_MODE, &iocap, sizeof(uint8_t)));

   //the key size should be 7~16 bytes
   uint8_t key_size = 16;
   ESP_ERROR_CHECK(esp_ble_gap_set_security_param(ESP_BLE_SM_MAX_KEY_SIZE, &key_size,                 sizeof(uint8_t)));

   //set enc key, id key, and CSR key (required for LE secure)
   uint8_t init_key = ESP_BLE_ID_KEY_MASK | ESP_BLE_CSR_KEY_MASK | ESP_BLE_ENC_KEY_MASK;
   uint8_t rsp_key = ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK | ESP_BLE_CSR_KEY_MASK;
   ESP_ERROR_CHECK(esp_ble_gap_set_security_param(ESP_BLE_SM_SET_INIT_KEY, &init_key,                 sizeof(uint8_t)));
   ESP_ERROR_CHECK(esp_ble_gap_set_security_param(ESP_BLE_SM_SET_RSP_KEY, &rsp_key,                   sizeof(uint8_t)));

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: IOS BLE not re-pairing when clearing whitelist

Postby chegewara » Mon Jul 16, 2018 9:09 pm

Hi,
i cant for sure say there is no issue in esp-idf, but i would suggest to try something that we've found togheter here:
https://github.com/asterics/esp32_mouse ... -398567879

In general android is less strict about ble specs and iOS has some requirements that needs to be implemented.

Who is online

Users browsing this forum: Google [Bot] and 133 guests