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 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