Friday, April 1, 2016

Authentication issue in BLE Bluetooth Low Energy device

Leave a Comment

We are making a IOT device with a BLE interface which uses the HM-11 (http://www.seeedstudio.com/wiki/Bluetooth_V4.0_HM-11_BLE_Module) breakout board hosting the chip CC2541 (http://www.ti.com/product/CC2541).

The authentication method is set to 2:Auth with PIN

Clip from the data sheet showing available authentication modes is as follows:

63. Query/Set Module Bond Mode Send Receive Parameter AT+TYPE? OK+Get:[para1] None AT+TYPE[para1] OK+Set:[para1] Para1: 0~2 0:Not need PIN Code 1:Auth not need PIN 2:Auth with PIN 3:Auth and bond Default: 0

For devices less than Android version 5.0 it works out just fine.

However

  1. For devices with Android version 5.0 the pairing dialog appears without diaplyed-pin or pin-entering-field and when the pair button is clicked it fails to pair - complaining with

    Couldn't pair with MyApp because of an incorrect PIN or passkey.

  2. For devices with Android version 5.1 it does not even show the pairing dialog and fails to pair.

Notes: Tried restarting devices, forgetting devices, clearing bonding information from device.

Looking for guidance, advice, help, comments, code.

2 Answers

Answers 1

This is a known issue - quite a few users have reported problems with being unable to enter a passcode with Android 5.0. It doesn't appear to occur across all devices.

Other examples of the issue:

http://android.stackexchange.com/questions/88011/android-5-bluetooth-pairing-dialog-has-no-passkey-form

https://en.discussions.tomtom.com/mysports-connect-apps-389/pairing-issue-on-nexus-5-android-5-948640

Answers 2

Bluetooth depends on both hardware and software to work properly. So if your devices can't speak a common Bluetooth language, they won’t be able to connect.

In general, Bluetooth is backwards compatible: Bluetooth devices supporting the Bluetooth 4.2 standard, announced last year, should still be able to pair with devices using, say, the ancient Bluetooth 2.1, launched back in 2007.

The exceptions are gadgets that use a low-energy version called Bluetooth Smart (or Low Energy), which works on a different protocol than older, or "Classic" Bluetooth devices. LE devices are not backward compatible and won't recognize (or pair with) older devices that support Classic Bluetooth. (For example, an old Sony Ericsson phone sporting Bluetooth 3.0 won't be able to connect to an LE device.) This is probably the cause of your issues, as Android 5 has issues with BLE, and if your device is classic Bluetooth, that won't work. I suggest you check compatibility of the device, and if that seems well, I would fall back on normal bluetooth until you solve the issue.

Hope this helps.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment