5340, Zephyr failure to connect to Polar Heart rate strap; ble wireshark trace

Hi ,

I have compiled in Heart rat relay into my app; can scan and connect to simulator and garmin HR straps; but fail to connect to polar.
My debug log shows...



So security is encryption, no auth and I get an "unspecified" error.

I have done a BLE wireshark trace; but cannot see anything in the trace to indicate the issue.

Would be grateful if someon could look and give me a clue to whats going wrong.

Here is wireshark trace....

polarHrmActiveScanConnectFail.pcapng

Regards,

Owain

Parents
  • Hi Owain, 

    Error 9 means BT_SMP_ERR_REPEATED_ATTEMPTS. It could suggest that the peer rejected a new bonding. Have you made sure you have remove bonding information on both sides ? 

    In the sniffer trace what I can see is that the central didn't continue to do pairing (sending encryption request) after the Pairing Random is sent. 

    Could you check on the connection with garmin HR , did the nRF53 bond to that device ? 
    And please also check if the phone can bond to the Polar strap. 

  • static void securityChanged(struct bt_conn *conn, bt_security_t level,
    enum bt_security_err err)

    in my v2.7.99-ncs1-1 zephyr  conn.h error 9 says BT_SECURITY_ERR_UNSPECIFIED...

    enum bt_security_err {
    /** Security procedure successful. */
    BT_SECURITY_ERR_SUCCESS,

    /** Authentication failed. */
    BT_SECURITY_ERR_AUTH_FAIL,

    /** PIN or encryption key is missing. */
    BT_SECURITY_ERR_PIN_OR_KEY_MISSING,

    /** OOB data is not available. */
    BT_SECURITY_ERR_OOB_NOT_AVAILABLE,

    /** The requested security level could not be reached. */
    BT_SECURITY_ERR_AUTH_REQUIREMENT,

    /** Pairing is not supported */
    BT_SECURITY_ERR_PAIR_NOT_SUPPORTED,

    /** Pairing is not allowed. */
    BT_SECURITY_ERR_PAIR_NOT_ALLOWED,

    /** Invalid parameters. */
    BT_SECURITY_ERR_INVALID_PARAM,

    /** Distributed Key Rejected */
    BT_SECURITY_ERR_KEY_REJECTED,

    /** Pairing failed but the exact reason could not be specified. */
    BT_SECURITY_ERR_UNSPECIFIED,
    };

    You can see in the central I deleted bonds before attempting to connect to the Polar *the bond deleted was for the garmin); I have also removed the coin cell from the polar to ensure it has deleted any bonds.

    I have made a wireshark trace to Android Nrf toolbox bonding/connecting to the polar; and it is quite different. After connect all feature/phy negotiation occurs before the master proceeds to send pairing information.

    Where as in my trace for nrf5340 and zephyr we just see it immediately start to pair after the connect. This does not seem right. What do you think.

    polarConnectFromNrfToolbox.pcapng

  • Hei Owain, 


    You are right, the error is from the bt_security_err and it's BT_SECURITY_ERR_UNSPECIFIED not BT_SMP_ERR_REPEATED_ATTEMPTS. 

    I'm not so sure why the central didn't send LL_ENC_REQ (0x03) after receiving pairing Random from the peripheral. It's most likely the confirm value didn't match with the random value generated. 
    You can have a look at this message sequence chart from Bluetooth Spec v5.2 here: 

    My suggestion is to try testing the Polar strap with one of our central HR sample to see if it works. Please try to capture a sniffer trace with that.
    Also, I don't know if removing the battery on the strap would make it clear the bond information or not. But if you can use other device to make a new bond/update bond then it should work with the nRF53.

    I don't think the order where  you do feature/phy request would affect the pairing process. However, you can control when the central starts the pairing process by choosing when to call 
    bt_conn_set_security()

Reply
  • Hei Owain, 


    You are right, the error is from the bt_security_err and it's BT_SECURITY_ERR_UNSPECIFIED not BT_SMP_ERR_REPEATED_ATTEMPTS. 

    I'm not so sure why the central didn't send LL_ENC_REQ (0x03) after receiving pairing Random from the peripheral. It's most likely the confirm value didn't match with the random value generated. 
    You can have a look at this message sequence chart from Bluetooth Spec v5.2 here: 

    My suggestion is to try testing the Polar strap with one of our central HR sample to see if it works. Please try to capture a sniffer trace with that.
    Also, I don't know if removing the battery on the strap would make it clear the bond information or not. But if you can use other device to make a new bond/update bond then it should work with the nRF53.

    I don't think the order where  you do feature/phy request would affect the pairing process. However, you can control when the central starts the pairing process by choosing when to call 
    bt_conn_set_security()

Children
Related