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.

CC254x BLE TimeApp disconnects immediately after pairing with Android (4.4.4) phone.

Other Parts Discussed in Thread: CC2541

We are attempting to use the CC2541 to provide a Bluetooth interface to our product in order to receive phone alerts such as text messages, missed calls, etc.  Ti provides a dev kit (CC2540DK) and sample code for the Ti BLE 1.4.0 stack with an example called TimeApp that has most of the functionality that we need.  The issue that we are seeing is that when we run the example it's not working correctly with our Android (4.4.4)  based phones.  Specifically, it's able to successfully pair with the Android phone but then it immediately disconnects.  We are not seeing this issue on IOS devices.  

  • Hi David,

    Normally, the connection timeout value will affect how long that will take when the devices no longer can hear each other. The CC2541 should declare the connection gone when the supervision timeout of the connection expires if the central device goes away.  

    What is the distance between the Android Phone (Central device) and CC2541?

     

    LPRF Rocks the World  

  • The DEFAULT_DESIRED_CONN_TIMEOUT is set to 1000 (in units of 10ms). Physically the two devices are right next to each other. One other piece of information I discovered is the connection is being terminated because of a GAP_LINK_TERMINATED_EVENT. The reason code is 0x13 (LL_STATUS_ERROR_PEER_TERM) - Remote User Terminated Connection. Again, I'm running stock TI code from the TimeApp using the CC2540DK. Greatly appreciate your help with this!
  • I assume you have followed the instructions in the "TI_BLE_Sample_Applications_Guide.pdf"
    Is it behaving according to the "out of the box" description?

    16.1.1 User Interface:

    The SmartRF05EB joystick and display provide a user interface for the application. The joystick and buttons are used as follows:

     Joystick Up: Start or stop advertising.
     Joystick Left: If connected, send a command to the Alert Notification control point.
     Joystick Center: If connected, disconnect. If held down on power-up, erase all bonds.
     Joystick Right: If connected, initiate a Reference Time update.
     Joystick Down: If connected, initiates a Ringer Control Point update

    The application advertises using either a fast interval or a slow interval. When advertising is initiated by a button press or when a connection is terminated due to link loss, the application will start advertising at the fast interval for
    30 seconds followed by the slow interval. When a connection is terminated for any other reason the application will
    start advertising at the slow interval. The advertising intervals and durations are configurable in file timeapp.c.

    LPRF Rocks the World
  • Yes, I have been following the instructions per the guide.  It advertises correctly when initiated by moving the joystick up.  Unfortunately with the Android phone (Samsung Note 4) after it successfully pairs it then immediately disconnects and then goes into the slow advertising interval.  The iphone 6 we test with does not do this.  It allows you to connect and successfully get the time & battery info.

  • A sniffer trace should help us to show what is going on. Aside from RF performance differences between iOS and Android devices, one thing to try is to adjust the connection timeout , and see if it influences your link.

    Do you receive the gapRole_state on your Android app and the CC254x device?
  • Here is a link to Android Developer's forum too:

    Android Developer's Forum Note 4

    LPRF Rocks the World

  • Here is the PSD file from the Ti SmartRF Packet Sniffer: Android Fail.psd  We are not running an app on the Android device.  My assumption (maybe this is not correct) is that the phone would support basic services such as Current Time, Battery, Alert Notifications, etc.  We also ran this on a Motorola Droid Maxx XT-1080 with the same failure as the Note 4...  

  • Interesting that your link is secure, but I am not an Android expert, so maybe the issue it is related to the permission on the phone side.

    developer.android.com/.../bluetooth-le.html
  • Based on this psd file it looks like you paired via the System menu and the Android OS terminated the link after 1sec of idle time. We have seen Android do this when you pair via the System menu via an App since the System menu does not really interact with the device.

    Can you try it with pairing with the TI BLE app or another dedicated BLE app?

    TI BLE Multitool for Android

  • Hi David,
    Could you finally confirm this assumption ("My assumption (maybe this is not correct) is that the phone would support basic services such as Current Time, Battery, Alert Notifications, etc.")?
    I am in the same situation, and after reading this post: e2e.ti.com/.../1367817 I think that maybe this is not true, and we need an Android app exposing that services (I also explain my doubts here: e2e.ti.com/.../1503393).
    I would thank you if you have advanced in this way and want to share your discoverys with us.

    Thank you very much.

  • By the way,
    If you like, take a look at this thread: e2e.ti.com/.../420925.
    We had a similar problem than this one, and it was caused by System_printf() introducing delays at some delicated points.

    Best regards