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: disconnect with the app after some time

Part Number: CC2541

Hello,

I am working on CC2541 BLE controller. I am using SimpleBLEPeripheral from TI BLE stack which is available on TI's website. I have interfaced the controller with a sensor whose state changes at an interval of 3 seconds. This means that event is generated at every 3 seconds. I am using custom profile's UUID whose length is 128 bits. I have also developed an app to get the sensor's data on my app. All is working good but device is getting disconnected with the app after establishing a connection. 

I also tried changing the Connection Parameter in firmware but the issue is not resolved yet.

What should I try to make this connection flawless? I want that device should not get disconnected when it is in range and also if the device is out of range for sometime, it should auto reconnect with the app when it comes in the range of the mobile phone.

Thanks,

Mahesh

  • Hello Manesh,

    I have assigned an expert to this thread to help you with your inquiry. In the meantime, can you provide us with which SDK version you are using? Could you also provide us with the connection parameters you are using?

    Regards,

    Jan

  • Hello Jan,

    SDK Version: BLE-CC254x-1.5.1.1

    Connection parameters:

    #define SBP_PERIODIC_EVT_PERIOD                   50

    #define DEFAULT_ADVERTISING_INTERVAL          160

    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL     80

    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL     800

    #define DEFAULT_DESIRED_SLAVE_LATENCY         100

    #define DEFAULT_DESIRED_CONN_TIMEOUT          1000

    #define DEFAULT_ENABLE_UPDATE_REQUEST TRUE

    #define DEFAULT_CONN_PAUSE_PERIPHERAL 6

    #define TI_COMPANY_ID 0x000D

    #define INVALID_CONNHANDLE 0xFFFF

    #define B_ADDR_STR_LEN 15

     

    Regards,

    Mahesh

  • Mahesh,

    Please apologize for the delay. The first thing I would do to try and debug this is to find the source of the disconnect - this can be accomplished by Clément's suggestion in your other thread: through the use of a packet sniffer. Otherwise, you can try to do a differential between connecting to different hosts using different OSes or SW to see if this is inherent to the Central side.

    I don't see anything particularly problematic with the configuration settings you provided. However, please check where the terminate API (GAPRole_TerminateConnection) is being called in your code - perhaps it is being inadvertently called too prematurely.

    I will think about additional aspects and report back in case I find anything relevant. Unfortunately, not having this device/board with me limits my actions.

    Hope this helps,

    Rafael

  • Hello Rafael,

    I am trying to connect my hardware circuit to laptop using CMOS-TTL converter. Block diagram of the setup is shown below. 

    After connecting the hardware as shown in the above block diagram and connecting the hardware with the Android Application, I am not getting any response in the Packet Sniffer software. I have also attached the screenshot of Packet Sniffer tool. Is there anything I have missed?

    Regards,

    Mahesh

  • Mahesh,

    One clarification: your last post is only about connecting the CC2541 USB dongle on the computer, not about the original issue, right? If so, I don't have much references given I lack the hardware. Are you sure your USB kit has the proper sniffer firmware?

    https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/bluetooth-forum/197748/sniffer-firmware-of-cc2540

    Also, something I missed is the #define DEFAULT_DESIRED_CONN_TIMEOUT          1000

    Can you try to extend it to a longer value and see if it helps with the constant disconnects?

    Hope this helps,

    Rafael