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

ble_uart example disconnect after 40 seconds while connected to raspberry-pie

Hi,

i have a problem when using the ble_uart connected to Raspberry-pie withe Bluez.

after 40 seconds the connection is lost.

tried to use several examples, but most of them has the same problem (with different disconnection times).

when used  ble_hrs example the connection is stable.

how can i fix this problem.

Thanks.

Parents Reply Children
  • Hi,

    i am using SDK version 15.3 with Sorfdevice S140 V6.1.1

    the sniffer result:

    114

    0.063 Slave LE 1M LE LL 0 150 0 1 FALSE 158 Empty PDU
    115 0.064 Master LE 1M LE LL 0 48440 1 1 FALSE 159 Empty PDU
    116 0.065 Slave LE 1M LE LL 0 150 1 0 FALSE 159 Empty PDU
    117 0.065 Master LE 1M LE LL 0 48440 0 0 FALSE 160 Empty PDU
    118 0.066 Slave LE 1M LE LL 0 150 0 1 FALSE 160 Empty PDU
    119 0.067 Master LE 1M LE LL 0 48439 1 1 FALSE 161 Empty PDU
    120 0.068 Slave LE 1M LE LL 0 150 1 0 FALSE 161 Empty PDU
    121 0.069 9e:7b:ef:d1:15:e0 LE 1M LE LL 35 49216 0 ADV_IND
    122 0.071 9e:7b:ef:d1:15:e0 LE 1M LE LL 35 360 0 ADV_IND
    123 0.072 9e:7b:ef:d1:15:e0 LE 1M LE LL 35 360 0 ADV_IND

    i get Disconnect reason 0x8 and 0x22

    Thanks.

  • Could you upload the sniff Wireshark log (.pcapng) file? Thanks. 

    -Amanda H.

  • Hi Ben, 

    0x08 is BLE_HCI_CONNECTION_TIMEOUT, and this happens because the supervision timeout is hit (no packets from the peer is received in x seconds).

    0x22 is BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT which means that a link-layer procedure has timed out (data length negotiation for instance). The timeout is 40 seconds, so the easiest way to find out which procedure it was that timed is to get a sniffer trace and see what happened 40 seconds prior to the disconnect. 

    Is this a custom board? Have you tried the same code on the nRF52 DK? Does it happen there? This post might help.

    Or maybe you can try to the connection parameters in ble_hrs example: 

    #define MIN_CONN_INTERVAL                   MSEC_TO_UNITS(400, UNIT_1_25_MS)        /**< Minimum acceptable connection interval (0.4 seconds). */
    #define MAX_CONN_INTERVAL                   MSEC_TO_UNITS(650, UNIT_1_25_MS)        /**< Maximum acceptable connection interval (0.65 second). */

    -Amanda H.

Related