Connection terminated by the host: GATT_CONN TERMINATE LOCAL HOST ISSUE

Hi,

This issue has been asked in several threads but I dont seem to find a solution for that. I'm using the following connection settings:

#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). */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT_INIT            MSEC_TO_UNITS(4000, UNIT_10_MS)

The problem is when the phone is connected to the device (I'm using nrf Connect), the connection is lost after 1.5 minutes. I tried several settings but none of them helped. I even tried setting the CONN_SUP_TIMEOUT_INIT to ==> BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE and still didnt work. Any help will be appreciated!

Regards

Parents Reply Children
  • Hi Karl,

    Thanks  a lot for your response. I actually solved the issue. Here is what happened. 

    The original connection settings:
    #define MIN_CONN_INTERVAL_FAST            6//MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    #define MAX_CONN_INTERVAL_FAST           7//MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    #define SLAVE_LATENCY 0
    #define CONN_SUP_TIMEOUT                        MSEC_TO_UNITS(2000, UNIT_10_MS)

    I was using this setting to maximize the data throughput. The problem is that the phone starts to negotiate longer CI when no data is transferred. Because the Min and Max CIs I'm setting are too tight, the device (nrf device) is rejecting the change. The phone then decides to disconnect after 3 attempts.

    So the solution was to loosen up my connection settings:

    #define MIN_CONN_INTERVAL_FAST             6//MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    #define MAX_CONN_INTERVAL_FAST           50//MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    #define SLAVE_LATENCY 0
    #define CONN_SUP_TIMEOUT                       MSEC_TO_UNITS(2000, UNIT_10_MS)

    And this makes the connection stable so far (tested more than 10 minutes).

Related