Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Frequent disconnects

Hello, I'm getting these series of events often when the client is sending data to client. This is the the nRF SDK 17.



If I add a delay on the client app that is talking to the device, these message seems to go away for example 95% of the time. The was tested with two different apps one with a delay and one without.

The client app is doing, is connecting to the device and sending some data to it, and then it disconnects. I'm thinking if this might be a timing thing, and that the peripheral hasn't fully finished the connection process, by the time the app is sending data.


Any way of knowing, what the cause of this could be? Sniffing the packets is hard to do as the device is mitm protected, with a passkey.

  • So I think the problem has to do with the connection parameter update.

    My parameters are:

    #define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
    #define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
    #define MAX_CONN_PARAMS_UPDATE_COUNT 3                       /**< Number of attempts before giving up the connection parameter negotiation. */

    For the FIRST_CONN_PARAMS_UPDATE_DELAY I've tried a low value at 500, and a high value of 10000 but the results are the same, where it will disconnect with the debug message shown in the above post.

    If I look at the nRF app logs, it says Error 8 (0x8): GATT CONN Timeout.

  • Hello,

    Are you testing this on a custom board or a Nordic development kit, and which LF clock source have you selected (internal RC oscillator or the crystal oscillator)? If you are using the internal RC oscillator, please post the clock configuration parameters. Connection timeouts (disconnect reason '8') can often be a symptom of excessive drift on the slow clock, causing the devices to lose the connection sync between each other.

    Thanks,

    Vidar

    Edit: It would also be interesting to know if you experience these connection timeouts if using the nRF connect app on Android or iOS.

  • Hello,

    No this is with a custom board. I found that requesting the MTU size to something smaller, seems to have fixed the problem.

    However, I'm not sure how this relates to disconnecting, considering the MTU size can be handled as other commands the app sends are much larger, e.g. 237 bytes.

Related