This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Strange Connection Issue with iOS and Android

We are trying to connect to discovered smartphones with a Nordic 52840 chip, with S140 softdevice, discover the gatt table, read and write attributes. Most of the time it works great.
It is a custom chip, but we have the same issue with the LAIRD 654 Devboard and different antennas.

But sometimes we do fail with 0x3E for 20 times or up to 60 times, even if the phone is in close proximity. After 20 to 60times everything is fine and we can discover the GATT table, read and write successfully.
We have played around with the Connection parameters and the MTU sizes and looked into different ways.

Our connection parameter and MTU settings are as follows:

#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 184
#define NRF_SDH_BLE_GAP_DATA_LENGTH 181

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(15, UNIT_1_25_MS)   
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(45, UNIT_1_25_MS)   
#define SLAVE_LATENCY                   0                                 
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(2000, UNIT_10_MS)   

Sometime (very often) we get in the following situation. We do get a successful connection handle and at the same time we receive a disconnect with 0x3E. In a lucky case this goes for 2-3 times until we get a succesful connection for data retrieval. But sometimes we see this for up to 60 times when we want to connect to a smartphone.

<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E
<info> app: GRPC call to ConnectTo
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 184 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 181 on connection 0x0.
<info> app: CENTRAL: Connected, handle: 0.
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E
<info> app: GRPC call to ConnectTo
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 184 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 181 on connection 0x0.
<info> app: CENTRAL: Connected, handle: 0.
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E
<info> app: GRPC call to ConnectTo
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 184 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 181 on connection 0x0.
<info> app: CENTRAL: Connected, handle: 0.
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E
<info> app: GRPC call to ConnectTo
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 184 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 181 on connection 0x0.
<info> app: CENTRAL: Connected, handle: 0.
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E
<info> app: GRPC call to ConnectTo
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 184 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 181 on connection 0x0.
<info> app: CENTRAL: Connected, handle: 0.
<debug> nrf_ble_gatt: ATT MTU updated to 184 bytes on connection 0x0 (response).
<debug> nrf_ble_gatt: Data length updated to 181 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 181
<debug> nrf_ble_gatt: max_tx_octets: 181
<debug> nrf_ble_gatt: max_rx_time: 2120
<debug> nrf_ble_gatt: max_tx_time: 2120

Any ideas what we should change?

Best Regards, 

Patrick

Related