This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Secure connection between nRF51822 and Android Smartphone?

Hello, i'm programming an android app to connect to the nRF51822 (peripheral). Without any security or pairing settings everything works fine. The Problem: Any kind of authentication and encryption is needed, but in the final Product the nRF51822 has no display or keyboard. Is there any way to establish a secure, authenticated connection to the Chip under that conditions?

In addition to the problem, what is the difference between the "Properties" and the "Permissions" of a Characteristic and what are they used for?

Parents
  • Thank you for your helpful answer, Hung Bui.

    Unfortunately I don't get a "Insufficient Authentication" error (Code 5) in the Android app, instead there occurs error code 137 (0x89: GATT_AUTH_FAIL?). Although the solution works anyway it would be interesting to know what's the reason for this!?

    I have one more (off topic) question: Is there any way to abort the connection to an already paired device?

  • Hi Chris,

    It's not normal to have error 137 or 133 when bonding. We did have that with Nexus devices running Android 4.3, however the update to Android 4.4.2 fixed that. Which central device did you use ?

    To request a passkey when bonding, you would need to declare the IO capability of the device (by SEC_PARAM_IO_CAPABILITIES) it could be keyboard, or LCD or both. You can have a look at the ble_app_gls example, that use the nRF6350 LCD module to display the passcode.

    If the passcode entered from the phone is wrong, the nRF51822 will send SMP Pairing Failed packet and the connection will be terminated (from both side).

Reply
  • Hi Chris,

    It's not normal to have error 137 or 133 when bonding. We did have that with Nexus devices running Android 4.3, however the update to Android 4.4.2 fixed that. Which central device did you use ?

    To request a passkey when bonding, you would need to declare the IO capability of the device (by SEC_PARAM_IO_CAPABILITIES) it could be keyboard, or LCD or both. You can have a look at the ble_app_gls example, that use the nRF6350 LCD module to display the passcode.

    If the passcode entered from the phone is wrong, the nRF51822 will send SMP Pairing Failed packet and the connection will be terminated (from both side).

Children
No Data
Related