This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541: Pairing requesting for passkey on Android but not on IOS

Part Number: CC2541

Running the TimeApp example from BLE-CC254x-1.5.2.0 causes a passkey popup dialog on an Android (both Nexus 7 Android 6.0.1  and GalaxyXcover3 Android 5.1.1)

But on an IOS it only asking for pairing permissions.

Theses are the (original) pairing settings:
// Default passcode
#define DEFAULT_PASSCODE 19655

// Default GAP pairing mode
#define DEFAULT_PAIRING_MODE GAPBOND_PAIRING_MODE_INITIATE

// Default MITM mode (TRUE to require passcode or OOB when pairing)
#define DEFAULT_MITM_MODE FALSE

// Default bonding mode, TRUE to bond
#define DEFAULT_BONDING_MODE TRUE

// Default GAP bonding I/O capabilities
#define DEFAULT_IO_CAPABILITIES GAPBOND_IO_CAP_DISPLAY_ONLY

  • Hello,

    The passkey popup is a form of man-in-the-middle (MITM) protection. If you want the passcode to appear on iOS, I would change DEFAULT_MITM_MODE to TRUE. The security settings of the smartphones you're using seem to depend on the OS and version. I've seen similar behavior before as well where androids required a numeric comparison but iPhone would just pair automatically.

    Best,

    Nate

  • OK, I enabled the MITM and set explicitly the passcode to 1234 in the timeAppPasscodeCB( ) function.

    I then connect from IOS, enter the code and get connected. On Android I get the: "Could not pair with TimeApp because of an incorrect PIN or passkey". The same error I got using BLE-CC254x-1.4.0.

    I am using BLE-CC254x-1.5.2.0 now but the error is the same.

  • interesting - do you even get prompted to put in a passcode?

    If not, then your android phone that already paired with the CC device may recognize it and try to pair with it using the same credentials as before, even though you've changed them on the CC device. Can you follow the instructions at this link to reset the BLE settings on the android device and try again?

    https://joyofandroid.com/android-couldnt-pair-because-of-incorrect-pin/

    Best,

    Nate

  • I am prompted for a passkey but get the incorrect passkey error consistently.

    There is no bonded devices in my Bluetooth list so I could not "unbond it" as in the link: My Android has no Bluetooth Share as in the link so I could not clear the cache. I do have nrF Connect of which I cleared the app data and cache.

    TimeApp.zip

  • In that case, I would recommend debugging your application or using a packet sniffer to figure out what's being sent from the Android and why it fails to pair. If you have a snippet of code you want to discuss you're welcome to post it, but we don't review entire projects on the E2E platform.

    I've also only seen 6 digit passkeys. Perhaps changing to 123456 would solve your problem if it's expecting 6 digits but you're only specifying 4.

    Best,

    Nate

  • I will try to inspect the communication with a sniffer.

    The idea of 6/4 digits sounds strange considering that the board accepting 4 digits if sent from IOS device. But there is mach that I don't know.

    My app is the original TimeApp example from the BLE-CC254x-1.5.2.0 . I run it on a board without an LCD and keyboard and start advertising on initialization.

    The rest is unchanged.  

  • Sounds like a good plan! Let me know when you have results.