This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Connection intermittantly fails: BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED

SD140

Part nrf52833

Application: Central App that connects to 1 to 16 different peripherals.  One at a time.

Problem:  1/10th of the time, I get a disconnect reason BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED == 0x3E.

                 What could be causing this?  Most times the connection works.  Are there some time-outs coming in to play/

Thanks,

Dan

case BLE_GAP_EVT_DISCONNECTED:

NRF_LOG_INFO("Disconnected. conn_handle: 0x%x, reason: 0x%x",
p_gap_evt->conn_handle,
p_gap_evt->params.disconnected.reason);

// Allow one retry, if disconnect reason 0x34
if(BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED == p_gap_evt->params.disconnected.reason)
{
// allow one retry of the connection process
NRF_LOG_INFO("ALLOW ONE CONNECT RETRY?");
// host_to_cble_RetryConnectOnce();
}

  • Hello,

    The BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED error happens when a peripheral does not respond to the connection request. And because the central will only send on connection request per attempt, the chance of getting this error is fairly high. Particularly if you are in an environment with multiple active scanners (they may send scan requests that overlap with your connect request). To see the effect of this, you can try to do a scan in the nRF connect app at the same time as the connections are being made. Other factors which may lead to this error are packet collisions, noise (from wifi, etc), or otherwise poor link quality.

     What could be causing this?  Most times the connection works.  Are there some time-outs coming in to play/

    Yes, you're right, there is a  timeout, and it will occur if the peripheral does not respond to the first 6 connection events.

    Here are a some of screenshots taken from the BT core spec. for reference:

    The solution is to repeat the connection attempt.

    Best regards,

    Vidar

Related