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.

CC2564 BT Just-Work Pairing Failed with Android Phone (SPPLEDemo)

Other Parts Discussed in Thread: CC2564

Hi SSO:

Phone: HTC M8 running Android 4.4

Our device: Stellaris LM4F232 EVM running Stellaris Bluetopia Stack V1.0

My purpose is that phone BT pairs with our device without PIN, confirmation or other indication. So we set IO Capability to icNoInputNoOutput and enable simple pairing.

Here is my problem: sometimes our device cannot generate link key especially when we take phone away from our device (about 2 meters away). However, phone still generates new link key without any indication. 

As you can see in the following log, our device generated link key successfully at first time. And then we move phone to 2 meters away and try to pair again. Our device then failed to generate link key at second time. I also print out HCI event type in order to see more details. We found there were only etNumber_Of_Completed_Packets_Event and etDisconnection_Complete_Event  after etSimple_Pairing_Complete_Event in the second case.

Is there any unreasonable setting for my application? Or is this RF performance issue which CC2564 might receives wrong packets?

=====================================================================================

Test log:

SPP+LE>OpenStack().
HCI_VS_InitializeAfterHCIReset
Set Baud Rate
HCI_VS_InitializeAfterHCIReset Success
Bluetooth Stack ID: 1.
Device Chipset: 4.0.
BD_ADDR: 0x0018343b78c6

******************************************************************
* Command Options: Server, Client, Help *
******************************************************************

SPP+LE>client

******************************************************************
* Command Options General: Help, GetLocalAddress, SetBaudRate *
* Quit, *
* Command Options BR/EDR: Inquiry, DisplayInquiryList, Pair, *
* EndPairing, PINCodeResponse, *
* PassKeyResponse, *
* UserConfirmationResponse, *
* SetDiscoverabilityMode, *
* SetConnectabilityMode, *
* SetPairabilityMode, *
* ChangeSimplePairingParameters, *
* GetLocalName, SetLocalName, *
* GetClassOfDevice, SetClassOfDevice, *
* GetRemoteName, SniffMode, *
* ExitSniffMode, Open, Close, Read, *
* Write, GetConfigParams, *
* SetConfigParams, GetQueueParams, *
* DisplayRawModeData, AutomaticReadMode,*
* SetQueueParams, Loopback, *
* CBSend. *
* Command Options GAPLE: SetDiscoverabilityMode, *
* SetConnectabilityMode, *
* SetPairabilityMode, *
* ChangePairingParameters, *
* AdvertiseLE, StartScanning, *
* StopScanning, ConnectLE, *
* DisconnectLE, PairLE, *
* LEPasskeyResponse, *
* QueryEncryptionMode, SetPasskey, *
* DiscoverGAPS, GetLocalName, *
* SetLocalName, GetLERemoteName, *
* SetLocalAppearance, *
* GetLocalAppearance, *
* GetRemoteAppearance, *
* Command Options SPPLE: DiscoverSPPLE, RegisterSPPLE, LESend, *
* ConfigureSPPLE, LERead, Loopback, *
* DisplayRawModeData, AutomaticReadMode *
******************************************************************

SPP+LE>setpair 2
Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
LE: I/O Capabilities: No Input/Output, MITM: TRUE.
BR/EDR: I/O Capabilities: No Input/Output, MITM: TRUE.

SPP+LE>setdis 2
Discoverability: General.

SPP+LE>
HCI Event Type: 0x03

HCI Event Type: 0x02

HCI Event Type: 0x1d

HCI Event Type: 0x18

HCI Event Type: 0x23

HCI Event Type: 0x10

HCI Event Type: 0x2f

HCI Event Type: 0x10

atIOCapabilityResponse: 0x502e5cbeada3
Capabilities: Display Yes/No, MITM

SPP+LE>
HCI Event Type: 0x2a

atIOCapabilityRequest: 0x502e5cbeada3
Auth success.

SPP+LE>
HCI Event Type: 0x29

atUserConfirmationRequest: 0x502e5cbeada3

Auto Accepting: 249730
GAP_Authentication_Response success.

SPP+LE>
HCI Event Type: 0x2b
Un-handled Auth. Event.

SPP+LE>
HCI Event Type: 0x2e

atLinkKeyCreation: 0x502e5cbeada3
Link Key Stored.

SPP+LE>
HCI Event Type: 0x15

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x04

SPP+LE>setdis 0
Discoverability: Non.

SPP+LE>setdis 2
Discoverability: General.

SPP+LE>
HCI Event Type: 0x03

HCI Event Type: 0x02

HCI Event Type: 0x1d

HCI Event Type: 0x10

HCI Event Type: 0x2f

atIOCapabilityResponse: 0x502e5cbeada3
Capabilities: Display Yes/No, MITM

SPP+LE>
HCI Event Type: 0x2a

atIOCapabilityRequest: 0x502e5cbeada3
Auth success.

SPP+LE>
HCI Event Type: 0x29

HCI Event Type: 0x10

HCI Event Type: 0x18

HCI Event Type: 0x23

atUserConfirmationRequest: 0x502e5cbeada3

Auto Accepting: 986426
GAP_Authentication_Response success.

SPP+LE>
HCI Event Type: 0x2b
Un-handled Auth. Event.

SPP+LE>
HCI Event Type: 0x2e

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x10

HCI Event Type: 0x04

=====================================================================================

Best Regards

Joe Wu

  • Hi,

    We tried reproducing this issue from our side but we see a link key request every time. Could you give us more details about your application changes and whether an SPP connection has been established?

    Thanks,

    Stonestreet One. 

  • Hi SSO:

    Our test steps -

    1. Place phone next to EVM

    2. EVM set IO Capability to icNoInputNoOutput

    3. EVM enable simple pairing

    4. Set EVM discoverable

    5. Phone start to pair with EVM

    6. Pair success without indication

    7. Set EVM non-discoverable

    8. Un-pair EVM in phone BT setting page

    9. Repeat 4-8 with phone placed next to EVM -> always pair success

    10. Move phone to 2 meters away

    11. Repeat 4-5 then sometimes EVM failed to generate link key, but phone showed pairing is successful

    We did not establish SPP connection between phone and EVM. We just repeatedly test if BT pairing is workable or not with different distance.

    Best Regards

    Joe Wu

  • Hi SSO:

    More test cases:

    We've tested the following list -

    1. HTC One (M8)

    2. HTC Butterfly (HTC Droid DNA)

    3. Samsung Note3

    We found that failure case always happened on HTC M8. Since M8 is covered by metal shell, we suspect this issue is related to RF performance.

    It's easier for you to reproduce this pairing issue if you have HTC M8 or other metal-shell Android phone.

  • Hi,

    We do not have a HTC One M8 to test with but we tried with a HTC One M7 which is also a metal shell Android phone to reproduce the issue and we could not see it. We repeated the tests several times but I saw the link key generated every time. I have our logs attached below,

    SPP+LE>SetPairabilityMode 2
    Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: Display Yes/No, MITM: TRUE.

    SPP+LE>ChangeSimplePairingParameters 3 1
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: No Input/Output, MITM: TRUE.

    SPP+LE>SetDiscoverabilityMode 2
    Discoverability: General.

    SPP+LE>Setlocalname stellaris
    Local Devce Name set to stellaris.

    SPP+LE>
    atIOCapabilityResponse: 0x980d2eb29e9c
    Capabilities: Display Yes/No, MITM

    SPP+LE>
    atIOCapabilityRequest: 0x980d2eb29e9c
    Auth success.

    SPP+LE>
    atUserConfirmationRequest: 0x980d2eb29e9c

    Auto Accepting: 562806
    GAP_Authentication_Response success.

    SPP+LE>Un-handled Auth. Event.

    SPP+LE>
    atLinkKeyCreation: 0x980d2eb29e9c
    Link Key Stored.

    SPP+LE>SetDiscoverabilityMode 0
    Discoverability: Non.

    SPP+LE>
    atIOCapabilityResponse: 0x980d2eb29e9c
    Capabilities: Display Yes/No, MITM

    SPP+LE>
    atIOCapabilityRequest: 0x980d2eb29e9c
    Auth success.

    SPP+LE>
    atUserConfirmationRequest: 0x980d2eb29e9c

    Auto Accepting: 909233
    GAP_Authentication_Response success.

    SPP+LE>Un-handled Auth. Event.

    SPP+LE>
    atLinkKeyCreation: 0x980d2eb29e9c
    Link Key Stored.

  • Hi SSO:

    Thanks for your reply.

    Could you kindly share which RF module did you use? Is it PAN1316 or others? We used AMPAK CC2564 module which is made in Taiwan. We would like to get the same module as yours and do this test again.

    Thank you.

    Best Regards

    Joe Wu

  • Joe,

    We used a PAN1316 module for our testing.

    Thanks,

    Stonestreet One 

  • Hi SSO:

    This issue cannot be reproduced again by using PAN1326 (module with antenna). We need to verify if there is any problem on AMPAK module. Thank you.

    Best Regards

    Joe Wu

  • Hi SSO:

    Sorry, we still can reproduce issue by using PAN1326 module.

    And there is another information which described that Google changed its BT driver from BlueZ to BlueDroid after Android 4.2 (from TI FAE). And there might be compatibility issue between Bluetopia stack and Android BT driver.

    Could you help to test BT pairing again by using new Android phone which runs Android 4.3 or after.

    We have tested:

    - Android phone with 4.0 x1 -> no issue

    - Android phone with 4.1 x2 -> no issue

    - Android phone with 4.3 x1 -> issue happened

    - Android phone with 4.4 x2 -> issue happened

    Thank you.

    Best Regards

    Joe Wu

  • Hi,

    We will test with an android phone running 4.3 or later. Can you tell me if you are seeing the issue with a particular 4.3 phone or all phones are causing the issue.

    Thanks,

    Stonestreet One.

  • Hi SSO:

    We've tested Samsung, HTC and ASUS phone. All phones are causing this issue if they run 4.3 or later.

    We suspect all phones which run BlueDroid stack would cause this issue.

    Best Regards

    Joe Wu

  • Hi,

    We tested with a HTC One running android 4.3 and 4.4.2 and Samsung Note 4 running Android 4.3 but we did not see the issue. 

    Could you check if you still see the same issue when you have an SPP port open? 

    Thanks,

    Stonestreet One.

  • Hi SSO:

    Do you mean that we have to open SPP server in the beginning?

    We've tried this before but issue is still there.

    May I ask how many times did you try to reproduce this issue? And how far did you place phone from EVB?

    For our test, typically the failure rate is about 10~15%. Sometimes failure rate went up to 30~50% if we used HTC M8 with 2~3 meters away.

    Test log with Tiva Bluetopia stack 1.1

    ==============================================================

    SPP+LE>server

    ******************************************************************
    * Command Options General: Help, GetLocalAddress, SetBaudRate *
    * Quit, *
    * Command Options BR/EDR: Inquiry, DisplayInquiryList, Pair, *
    * EndPairing, PINCodeResponse, *
    * PassKeyResponse, *
    * UserConfirmationResponse, *
    * SetDiscoverabilityMode, *
    * SetConnectabilityMode, *
    * SetPairabilityMode, *
    * ChangeSimplePairingParameters, *
    * GetLocalName, SetLocalName, *
    * GetClassOfDevice, SetClassOfDevice, *
    * GetRemoteName, SniffMode, *
    * ExitSniffMode, Open, Close, Read, *
    * Write, GetConfigParams, *
    * SetConfigParams, GetQueueParams, *
    * SetQueueParams, Loopback, *
    * DisplayRawModeData, AutomaticReadMode,*
    * CBSend. *
    * Command Options GAPLE: SetDiscoverabilityMode, *
    * SetConnectabilityMode, *
    * SetPairabilityMode, *
    * ChangePairingParameters, *
    * AdvertiseLE, StartScanning, *
    * StopScanning, ConnectLE, *
    * DisconnectLE, PairLE, *
    * LEPasskeyResponse, *
    * QueryEncryptionMode, SetPasskey, *
    * DiscoverGAPS, GetLocalName, *
    * SetLocalName, GetLERemoteName, *
    * SetLocalAppearance, *
    * GetLocalAppearance, *
    * GetRemoteAppearance, *
    * Command Options SPPLE: DiscoverSPPLE, RegisterSPPLE, LESend, *
    * ConfigureSPPLE, LERead, Loopback, *
    * DisplayRawModeData, AutomaticReadMode *
    ******************************************************************

    SPP+LE>open 1
    Server Opened: Server Port 1, Serial Port ID 1.
    Server Port Context Stored.

    SPP+LE>setcbpairabilitymode 2
    Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: No Input/Output, MITM: TRUE.

    SPP+LE>setcbdiscoverabilitymode 2
    Discoverability: General.

    SPP+LE>setlocalname name3
    Local Devce Name set to name3.

    SPP+LE>
    atIOCapabilityResponse: 0x502e5cbeada3
    Capabilities: Display Yes/No, MITM

    SPP+LE>
    atIOCapabilityRequest: 0x502e5cbeada3
    Auth success.

    SPP+LE>
    atUserConfirmationRequest: 0x502e5cbeada3

    Auto Accepting: ERROR
    GAP_Authentication_Response success.

    SPP+LE>Un-handled Auth. Event.

  • Hi,

    We used  the steps that you mentioned in the 3rd post. We have tested some 20-25 times in total where we pair, unpair from the phone, make the msp430 non-discoverable move the device away atleast 2 meters before pairing again. We still haven't been able to reproduce it.

    We will take a look at the logs that you have sent when there is an spp connection and get back to you on that.

    Thanks,

    Stonestreet One.

  • Hi SSO:

    You mentioned that you used "msp430" for this test. However, we used Tiva m4 platform for this test. 

    http://www.ti.com/tool/stonestreetone-bt-sdk

    You released two kinds of Bluetopia stacks for two platforms. Is there any difference of protocol implement between two stacks? 

    Could you kindly help to do this test again on Tiva M4 platform? Thank you.

    Best Regards

    Joe Wu

  • Is this thing solved nowadays?
    We are experimenting the same issue with TivaC and several smartphones.
  • Hi,

    Let us take this up on e2e.ti.com/.../1405828.
    I don't think there is a problem with pairing, I have tried it my self without any issue.