Hello,
I am getting some seriously strange behavior from BLE. When I set the pairing key on the esp to 4 digits the esp can successfully pair as long as the connecting device is iOS. However, if we try to pair an android device the pairing process fails. On an android device, we must pad the key input with two zeros in order for the pairing process to succeed.
For example: ESP BLE pairing key is set to 252525 (6 digits). iOS and Android can connect by input 252525, the pairing process succeeds.
For example: ESP BLE pairing key is set to 2525 (4 digits). iOS can input 2525 and the pairing process will succeed. Android can input 2525 and the pairing process will FAIL. Abdroid can input 002525 and the pairing process will succeed.
Is there a pairing key limitation that I missed or what? Does anyone have any insight into what might be happening here?
Minimum pairing key size [BLE]
Re: Minimum pairing key size [BLE]
I cant find it now, but long time ago i asked the same quetion on github and answer is that you need to add 0s in front to have 6 digits long pin. I dont know why.
-
- Posts: 8
- Joined: Mon Aug 26, 2019 6:10 am
Re: Minimum pairing key size [BLE]
As per spec Bluetooth, BLE passkey needs to be 6 digits long when using LE passkey entry pairing procedure.
You might be getting it confused with 4 digit PIN used in case of Bluetooth Classic pairing procedure.
Android devices are behaving correctly by rejecting the 4-digit key.
0's appended at the beginning of the passkey are allowed by the spec, but total number of digits should be 6.
In ESP-IDF code comments, I can see the mention of 6-digit passkey.
Please let me know where you are able to set the 4-digit passkey in ESP-IDF; I will check if any fix is needed in the code.
Thanks!
You might be getting it confused with 4 digit PIN used in case of Bluetooth Classic pairing procedure.
Android devices are behaving correctly by rejecting the 4-digit key.
0's appended at the beginning of the passkey are allowed by the spec, but total number of digits should be 6.
In ESP-IDF code comments, I can see the mention of 6-digit passkey.
Please let me know where you are able to set the 4-digit passkey in ESP-IDF; I will check if any fix is needed in the code.
Thanks!
Who is online
Users browsing this forum: No registered users and 333 guests