Pairing using CySmart

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
D_Sd_3235936
Level 4
Level 4
25 sign-ins 50 questions asked 25 replies posted

 

Connection went well.

Pairing is a success. Device was added to whitelist. 

But on disconnection and connection (works) but pairing (fails)  I get this:

[11:08:46:649] : 'Authentication Error Notification' event received
[11:08:46:649] : Status: AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE
[11:08:46:649] : 'Misc Event Notification' received
[11:08:46:649] : Event Code: 0x0029 (GAP_ENCRYPT_CHANGE)
[11:08:46:649] : Event Data: Encryption OFF
[11:08:46:649] : Event Data: [00]
Error: gpm.M1108: Authentication failed.

 

Does not happen when I do the same process using an android,

0 Likes
1 Solution

Hello,

In the BLE component, Go to Gap Settings ->Security and check the Encryption Key size. The valid values of encryption key size are 7-to-16 bytes.
Also, At Peripheral side when encryption is failed due to LTK loss, CYBLE_EVT_GAP_AUTH_FAILED event with reason code CYBLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE is given to application. 

The authentication error code CYBLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE will occurs due to Insufficient key size for the security requirements of this device or LTK is lost 

Thanks,
P Yugandhar.

View solution in original post

0 Likes
3 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

If the encryption key size is too short, pairing will be failed with insufficient encryption key size. Could you please share your peripheral project for debugging at our end ?
You can refer to the Day015_Bonding and Day014_Whitelist code examples from the GitHub.

Thanks,
P Yugandhar.

0 Likes
D_Sd_3235936
Level 4
Level 4
25 sign-ins 50 questions asked 25 replies posted

Can you tell me please where can I change the key?

0 Likes

Hello,

In the BLE component, Go to Gap Settings ->Security and check the Encryption Key size. The valid values of encryption key size are 7-to-16 bytes.
Also, At Peripheral side when encryption is failed due to LTK loss, CYBLE_EVT_GAP_AUTH_FAILED event with reason code CYBLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE is given to application. 

The authentication error code CYBLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE will occurs due to Insufficient key size for the security requirements of this device or LTK is lost 

Thanks,
P Yugandhar.

0 Likes