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

Reconnecting issue

Every time I try to connect to Android phone (running Android 7) or nrfConnect, it connects the first time. After I restart the nrf52 DK, the host takes a while to reconnect or does not connect at all, although its previously bonded. Restarting the board helps every time. What could be the issue in my firmware?

I tried changing the below parameters -

I'm using SDK 15.2 with custom gatt & dfu services with uart peripheral.

I also tried adding

My advertising_init() -

Parents
  • Hi. 

    From the code you uploaded, I can't see why you don't receive the disconnect event. You should see the disconnected event when you disconnect using your phone. 

    Are you using an application for connecting/disconnecting, or are you using the native bluetooth settings on the phone to connect/disconnect?

    If you aren't seeing the disconnection event, you could try to reduce the connection timeout and see if you would get the timeout/disconnect event after the timeout expires.

    Best regards,
    Joakim

  • The below sequence happens once in 10 attempts - 

    1. Host bonds with device or reconnects to already bonded device

    2. Host requests MTU size of 32 - success

    3. Host enables notifications

    4. Host receives 23 byte packets, instead of 32.

    5. Host displays error message - device not found, out of range.

    How can I restrict sending 23 bytes instead of 32 bytes in the firmware before MTU request is accepted?

Reply
  • The below sequence happens once in 10 attempts - 

    1. Host bonds with device or reconnects to already bonded device

    2. Host requests MTU size of 32 - success

    3. Host enables notifications

    4. Host receives 23 byte packets, instead of 32.

    5. Host displays error message - device not found, out of range.

    How can I restrict sending 23 bytes instead of 32 bytes in the firmware before MTU request is accepted?

Children