ble disconnects Immediately after connection.

Hi All,

I'm using nrf Connect SDK v1.7.0 with Vs Code

So here I can see in the debug prints that Bluetooth device is able to get connection successfull callback and Immediately I get disconnection callback with this error reason.

BT_HCI_ERR_CONN_FAIL_TO_ESTAB           0x3e
I wish to know, what does it mean and how to prevent it?
Parents
  • Hi

    I assume the CONFIG_BT_MAX_CONN is set to some value by default in your application either way? Can you show us how you clear the BT conn variables upon a disconnect? 

    It should not be necessary to stop advertising in order to connect, as a scanning central device will establish a connection with advertising devices. 

    What sample project is your central application based on? It might be that the connection establishment isn't handled correcty, and it for some reason tries to connect to both advertising devices at the same time at some points.

    Best regards,

    Simon

  • What sample project is your central application based on?
    I've picked an example from Nordic webinar from YouTube, PFA
    an you show us how you clear the BT conn variables upon a disconnect? 

    Below function is called inside disconnect callback.

    void ClearBleConn(void)
    {
      if(default_conn)
          { /* Connection instance for central role */
            bt_conn_unref(default_conn);
            default_conn = NULL;
          }
    }

    I assume the CONFIG_BT_MAX_CONN is set to some value by default in your application either way?

    It was two by default and I made it 5 now, still the problem persists.

    Regards

    Viswa N M

  •  

    Did you solve this in the end?

    I am struggling with a similar issue. My central can't re-connect to my peripheral with the same error. I have reported it here :  BT_HCI_ERR_CONN_FAIL_TO_ESTAB every time on re-connection 

    Would you have any ideas? Thanks. 

  • Reply Children
    No Data
    Related