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

Disconnect very quickly after connected,reason:0x3E

Hi Supporter:

Hardware:nRF52840 dongle

Software: basic example "ble_app_interactive", s140_nrf52_6.1.1_softdevice

There is a strange problem,I connect my machine with iphone nrf connect, connect is ok, discovery all normal, But when i use Dongle with the software "ble_app_interactive", It's quickly disconnect.Log:

<info> app: CENTRAL: Connecting...
<debug> app: Connection Request Failed, reason 8
Connected to address: 00 1D 48 2F 18 29
<info> app: CENTRAL: Connected, handle: 0.
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
<info> app: Connecting to target 29182F481D00
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E

I test my central dongle with other dongle which use example "usbd_ble_uart",It's connect ok;Log

<info> app: CENTRAL: Connecting...
<debug> app: Connection Request Failed, reason 8
Connected to address: F6 17 FA C0 12 F1
<info> app: CENTRAL: Connected, handle: 0.
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
<info> app: Connecting to target F112C0FA17F6
<debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 64 bytes.
<debug> nrf_ble_gatt: Updating ATT MTU to 64 bytes (desired: 247) on connection 0x0.
Current MTU: 64
<debug> nrf_ble_gatt: ATT MTU updated to 64 bytes on connection 0x0 (response).
MTU changed successfully
<debug> nrf_ble_gatt: Data length updated to 251 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 251
<debug> nrf_ble_gatt: max_tx_octets: 251
<debug> nrf_ble_gatt: max_rx_time: 2120
<debug> nrf_ble_gatt: max_tx_time: 2120
<info> app: Data length updated to 251 bytes.

But when i connect peripheral  dongle with this central dongle first, and then i connect my machin, It's connect ok. 

It's very strange.00-connect_fail.pcapng00-connect_success.pcapng

I use sniffer crab some bags. 

Attachment is my sniffer bags. 

Hope my description is clearly .

Thanks any help.

Parents
  • Hi Jay, 

     

    <info> app: CENTRAL: Disconnected, handle: 0, reason: 0x3E

     Disconnected reason 0x3E means: BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED. 
    This matched with what I can observe in the sniffer trace. The central sent the connect request but there was no response from the peripheral. 

    There could be a few posibilities: 

    1. The slave didn't catch the connect request from the central. How often do you see the issue ? Have you even managed to connect the central to the peripheral ? Have you tried to connect using a phone to your peripheral ?  Please try to test with a normal BLE application in the SDK.
    2. The slave caught the connect request but couldn't send the response packet due to timing issue. Could you check the log on the peripheral ? If it's the case the log on the peripheral should also show that it's connected but then quickly disconnected. 

  • Hi Hung:

    My slave details:

    > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
    status 0x00 handle 1025, role slave
    bdaddr F5:CC:F0:5F:A0:DE (Random)
    < ACL data: handle 1025 flags 0x00 dlen 16
    L2CAP(d): cid 0x0005 len 12 [psm 0]
    Connect: de:a0:5f:f0:cc:f5
    > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1025 packets 1
    > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 1025 reason 0x3e
    Reason: Connection Failed to be Established
    < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
    2020/10/31 22:48:16 l2conn: 0x0401 already disconnected
    Disconnect: de:a0:5f:f0:cc:f5
    > HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertise Enable (0x08|0x000a) ncmd 1
    status 0x00

Reply
  • Hi Hung:

    My slave details:

    > HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
    status 0x00 handle 1025, role slave
    bdaddr F5:CC:F0:5F:A0:DE (Random)
    < ACL data: handle 1025 flags 0x00 dlen 16
    L2CAP(d): cid 0x0005 len 12 [psm 0]
    Connect: de:a0:5f:f0:cc:f5
    > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1025 packets 1
    > HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 1025 reason 0x3e
    Reason: Connection Failed to be Established
    < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
    2020/10/31 22:48:16 l2conn: 0x0401 already disconnected
    Disconnect: de:a0:5f:f0:cc:f5
    > HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertise Enable (0x08|0x000a) ncmd 1
    status 0x00

Children
No Data
Related