LE secure connection doesn't work

Posted on
  • Hi all,

    I have Bangle.js and Puck.js devices but couldn't establish LE secure connections between them.

    Puck.js has the following service configuration:

      0xBCDE : {
        0xABCD : {
          value : "Hello",
          readable : true,
            security: {
              read: { // optional
                lesc: true

    Bangle.js also has the LE secure connections enabled with the following configuration:


    Nevertheless, when Bangle.js connects to Puck.js and accesses to the read characteristic, it fails to read.

    I also tried to connect to the read characteristic using the NRF connect application. After I connect to Puck.js and try to read the value of characteristic, it triggers bonding and stuck at that stage with no success.

    Is there a known issue with the lesc or am I missing something?

    Thanks for the support in advance...

  • It could be that the Bangle doesn't automatically start the bonding procedure for a secure connection, and so the read fails. You could try startBonding?


    gatt.getSecurityStatus() is also a good way to check the status of the link, like whether you are bonded or not

  • Hi Gordon,

    Thanks for the response. I tried the same with a different setup: Bangle.js being central (scanning advertisements) and a peripheral running on an external nRF board.

    • In NRF documentation, I saw that for Level-4 LESC, authentication is also mandatory so eventually it has to be lesc:1, mitm:1.
    • The peripheral starts the bonding process by generating a pass key and I developed a keyboard app on Bangle.js to enter this key; nevertheless received the attached error on the peripheral. (public key is not valid)
    • When I use nRF connect app on my phone to pair with the peripheral, the bonding works properly but not from my Bangle.js with the setting {lesc:1, mitm:1, keyboard:1}.

    Any clue why I get this "public key is not valid" error?

    Thanks again for the support...

    1 Attachment

    • LESC error.PNG
  • Ahh, yes, I didn't mention that but only certain combinations for setSecurity work and unfortunately the Nordic SDK doesn't always report back when some settings don't make sense.

    Any clue why I get this "public key is not valid" error?

    I'm afraid not. I guess it's not referring to the passkey you entered? Maybe Nordic Devzone has some ideas.

    The odd thing is I'm pretty sure I have had this working, because the passkey pairing on Central code was implemented for a user that needed it for his project.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

LE secure connection doesn't work

Posted by Avatar for ermano @ermano