This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52840 random disconnection

Good morning,

We have a new equipment based on the nRF52840 and s140.

                Just now, a new problem has appeared and it is very strange, as it seems to be a ‘random’ error:

 

                We have already assembled tens of equipment, and most of them are perfectly working with any smartphone (using both your ‘nRF Connect’ application or our own application).

                But, we have a few smartphones that show a strange behavior: they are able to perfectly connect to some of our nRF52840-based equipment, and in a few ones, they are able to connect but they get disconnected after a few seconds. Same equipment is connecting to other smartphones without problems (without disconnecting).

                This is (step by step) what it is happening a few times:

  • Equipment (nRF52840) is advertising.
  • Smartphone stablish connection with equipment using pin number
  • First time, the connection is perfectly working.
  • If smartphone is disconnected and connected back again with same equipment (Already bonded), then connection is stablished but smartphone disconnects after 30”, approximately. Same behavior is happening with both nRF connect application and our own application. Looking at log in nRF application we see: ‘Connection terminated by peer (status 19)’or ‘GATT_CONN_TIMEOUT’

 

Why is it happening?

Which is the reason?

How can we solve this?

 

 Could you help us? (For your information, we have set MIN_CONN_INTERVAL to 7.5m and MAX_CONN_INTERVAL to 100ms)

Thank you

  • Hi Dani, 
    I think you are using an older version of the nRF Sniffer. Could you check if you have version 4.1 of the sniffer  ? It must have a drop down menu next to Keys , instead of what in your screenshot. 

  • Hi Hung,

    Indeed, this was the problem. I have already updated it, and now interface is as expected.

    Now I have done the following procedure, as you have described:

    - Smartphone has been paired with my device

    - I have disconnected the device from smartphone

    - I have connected the device again. And being connected, in Wireshark, I have introduced the SC-LTK value: from that moment, only 'Empty PDU' messages appear, up to the moment the device disconnects (after around 30")

    Please, find trace here attached

    Dani.3755.Android_pairing_with_disconnection_bonded_LTK_23_05_22.pcapng

  • Hi Dani, 

    No it still couldn't decrypt the connection correctly. 
    Please see here: 

    When the sniffer says "encrypted packet decrypted incorrectly" that mean the key was missing or the key was wrong. 
    Please make sure you reverse the order of the bytes as I showed in my screenshot. And make sure you click the arrow button . And all of this must be done before the re-connection taking place. 


    Please look for the way to print the log out, you can either use UART or RTT logging if you don't have UART(doesn't require extra pin, just the debugger).

  • Hi Hung,

    I think now I got it: but I have seen that when I click the arrow button, I do not see incoming information in the log window: please, look at the screenshot here attached, where a time gap without info is noticed. And the information is received after this gap is related to advertising, as device has disconnected.

    Please, find also attached this trace

    DaniAndroid_Disconnection_24_05_22.pcapng

  • Hi again Daniel, 

    It still can't decode the connection. Note that the empty packet is not encrypted. 

    Please click the arrow button before starting the connection, basically the sniffer need to have the keys before the LL_START_ENC_REQ (0x05) packet. And the key need to be correct key (reversed byte order). 

Related