7 Replies Latest reply on May 28, 2015 2:42 PM by VikramR_26

    Passkey is not working

      In WICED_SMART_SDK 2.1.0, I use 2 boards which are hello_sensor and hello_client.

      I uncommented PASSKEY for both.

      Default pass key is 123456 and I changed passkey as 57920 in hello_sensor.

      But hello_sensor and hello_client can be connected well.

      As far as I understand, both devices can not be connected if passkey is different.

       

      The message of hello_sensor is following.

      /////////////////////////////////////////////////////////////////////////

      14:46:34 -

      14:46:34 - NVRAM write:0009

      14:46:34 -

      14:46:34 - hello_sample, encryption changed 20736a1c8cca

      14:46:34 -

      14:46:34 -

      14:46:34 -  permission check retCode = 00

      14:46:34 -

      14:46:34 -  permission check retCode = 00

      14:46:34 - EncOn 20736a1c8cca client_configuration:0000 blinks:0

      14:46:34 -

      14:46:34 -

      14:46:34 - l2cap Tx:

      14:46:34 - 402010000c0005001201080050009001

      14:46:34 - 0000bc02

      14:46:34 - Tx buffer = 14

      14:46:34 -

      14:46:34 - blecm evt handler:

      14:46:34 - 0e04010a200c

      14:46:34 -

      14:46:34 - blecm evt handler:

      14:46:34 - 0e04010a200c

      14:46:34   Connection is UP.

      14:46:34   profile idle timer stop

      14:46:34   connUp

      14:46:34   noAdv

      14:46:34   BLE_idleconn:timer(120)

      14:46:34   noAdv

      14:46:34   profile idle timer stop

      14:46:34   BUZBeep(0)

      14:46:34 -

      14:46:34 - l2cap Rx:

      14:46:34 - 4020090005000400122b000100

      14:46:34 -

      14:46:34 - Checking readable attribute 002b

      14:46:34 -

      14:46:34 -  permission check retCode = 00

      14:46:34 - hello_sensor_write_handler: handle 002b

      14:46:34 -

      14:46:34 - hello_sensor_write_handler: client_configuration 0001

      14:46:34 -

      14:46:34 - hello_sensor_write_handler: NVRAM write:0009

      14:46:34 -

      14:46:34 -

      ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        • 1. Re: Passkey is not working
          BoonT_56

          May I suggest that you repeat this with an Android phone instead.

           

          1) Download the WICED Smart Explorer from Play Store

          2) In hello_sensor.c, uncomment #define PASSKEY_PAIRING

          3) Compile, download and run the app (remember to set switch 2 to OFF and press RESET button)

          4) Use the Smart Explorer to scan and you will find "Hello"

          5) Try to connect and you will be prompted to enter the passkey.

          6) Try to enter a correct one and an incorrect one to see the difference

          • 2. Re: Passkey is not working

            I'm using I-phone LightBlue.

            LightBlue App can connect without entering passkey.

            • 3. Re: Passkey is not working
              BoonT_56

              eyan,

               

              Did you have any additional findings to this issue?

              • 4. Re: Passkey is not working

                boont,

                I don't have an answer yet.

                I checked the bleprofile configuration, but paring is failed when I enable security.

                Can you share your configuration?

                • 5. Re: Passkey is not working
                  VikramR_26

                  eyan,

                  I've been able to reproduce the issue and have confirmed with the developers that this appears to be a bug. Unfortunately, I do no have an ETA on when the problem will be resolved. Shall keep you posted with the updates. ArvindS_76BoonT_56

                  1 of 1 people found this helpful
                  • 6. Re: Passkey is not working

                    vik86,

                     

                    Thank you for keeping your eye on this issue.

                     

                    What I'd like to know is

                    1. Is it possible that the PASSKEY is available while the peripheral and central are "LESMP_IO_CAP_DISP_NO_IO".

                        What you've talked looks like the actions between mobile app and peripheral.

                    2. In case of "impossible", what is the method of bonding my devices with others through security?

                        At least, I'd like to make unintended devices which does not have specific keys not paired or bonded with my board

                       I know there is whitelist which cares bd_addr, but I'd like to know if there is another method available.

                    • 7. Re: Passkey is not working
                      VikramR_26

                      eyan

                       

                      Do the following changes in Hello_Sensor

                      void hello_sensor_smp_bond_result(LESMP_PARING_RESULT  result)

                      {

                          ble_trace3("hello_sample, bond result %02x smpinfo addr type:%d emconninfo type:%d\n",

                                  result, lesmp_pinfo->lesmpkeys_bondedInfo.adrType, emconninfo_getPeerAddrType());

                       

                       

                          // do some noise

                          bleprofile_BUZBeep(bleprofile_p_cfg->buz_on_ms);

                       

                          if (result == LESMP_PAIRING_RESULT_BONDED)

                          {

                              // saving bd_addr in nvram

                              UINT8 *bda;

                              UINT8 writtenbyte;

                       

                              bda = (UINT8 *)emconninfo_getPeerPubAddr();

                       

                              memcpy(hello_sensor_hostinfo.bdaddr, bda, sizeof(BD_ADDR));

                              hello_sensor_hostinfo.characteristic_client_configuration = 0;

                              hello_sensor_hostinfo.number_of_blinks = 0;

                       

                              ble_trace2("Bond successful %08x%04x\n", (bda[5] << 24) + (bda[4] << 16) + (bda[3] << 8) + bda[2], (bda[1] << 8) + bda[0]);

                              writtenbyte = bleprofile_WriteNVRAM(NVRAM_ID_HOST_LIST, sizeof(hello_sensor_hostinfo), (UINT8 *)&hello_sensor_hostinfo);

                              ble_trace1("NVRAM write:%04x\n", writtenbyte);

                          }

                          else

                          {

                              ble_trace1("\rdisconnecting...... %02x", result);

                       

                             // Pairing failed. So disconnect with remote user terminated connection (no need to say why?).

                             blecm_disconnect(BT_ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION);    // IF this does not compile, try blecm_disconnect(0x13);

                          }

                      }

                       

                      And you should see for a different passkey set it would not connect.

                       

                      hth

                      vik86