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: some of mobile phones fail to detect the CC2541 advertisement packets

Part Number: CC2541
Other Parts Discussed in Thread: BLE-STACK

Hi,

I am using CC2541 module for my application. I have attached sniffer log for one of the advertising device which is based on SimpleBLEPeripheral application. This capture is from the mobile whone connecting to CC2541 module.I am using different 3rd party android application for scanning and connecting the devices. I have multiple phones. I find that my actual device which is based on CC2541 module(running SIMPLEBLEPeripheral application) is not listed in some of the mobile app scanner. The same mobile in which CC2541 is failing to get scanned, is able to scan different other BLE devices(some of them are ibeacon also). This proves that BLE is supported on the phone in which CC2541 is failing to get scanned. My question is why the same module is being scanned and connected as well in some of the mobile phones but doesn't in some of them? Out of 5 mobiles, it is able to get scanned in just 2 devices. I have around 10 units of prototypes(only one powered at a time) with same CC2541 module and behavior is same with all modules with different 3rd party android app available on google play store. In sniffer, the CC2541 module shows advertising but not listed in some of the mobile phones

Regards

Narendra

ble sniff1.psd

  • Hi Narendra,

    What version of the BLE-Stack are you using?

    In general when working with phones, always remember to clear the Bluetooth cache of the phone when you re-program the CC2541.

    Can you list what smart phones are not able to discover the CC2541?

  • Hi Marie,

    I am using BLE-Stack(tm) Version 1.4.1. Connectivity and data transfer works fine on working phones. I have developed multiple applications using Simple BLE Peripheral and all works fine on scanning phones. Phones i am able scan the device are motoG3,Vivo V7,LAVA,Samsung. Non- scanning phones are Redmi Note7, Nokia5, RealMe,RedMe Note5 etc

    Regards

    Narendra

  • Hi Narendra,

    Are there any custom modifications you have done to the Simple BLE Peripheral project? Are you using any specific advertisement packets, like direct advertisement?

    You state in your above posts that connectivity and data transfer works fine on some of your phones, which indicates that your Simple BLE Peripheral project works as expected. The problem might not be your CC2541 module, and so I would recommend that you reach out to an Android developer forum specific to the phone models you can't get scanning to work properly.

    Best regards,

    Vetle

  • Hi Vetle,

    I have made changes to application layer which mainly includes data transfer part but didn't change advertisement related functions. I did set connection parameters as follows as i need to do file transfer.

    // Minimum connection interval (units of 1.25ms, 80=100ms) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL     10      

    // Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL     12

    // Slave latency to use if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_SLAVE_LATENCY         0

    // Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_CONN_TIMEOUT          5

    // Whether to enable automatic parameter update request when a connection is formed
    #define DEFAULT_ENABLE_UPDATE_REQUEST         TRUE

    // Connection Pause Peripheral time value (in seconds)
    #define DEFAULT_CONN_PAUSE_PERIPHERAL         6

    With above configuration, my application is running successfully on the working phones mentioned

    As you said,

    "You state in your above posts that connectivity and data transfer works fine on some of your phones, which indicates that your Simple BLE Peripheral project works as expected. The problem might not be your CC2541 module"

    If some of mobile has issue then it should have issue with other BLE devices also. As i said, the same mobiles which are not discovering CC2541, are able to scan other BLE devices which are from different vendors. These BLE devices also include iBeacons. I have tried multiple 3rd party Apps but i get issue with CC2541 only. None of CC2541 devices is getting discovered in those phones. I will also check with Android developers on the issue but they say since those phones are able to discover other devices, it may be problem with CC2541. I am totally stuck here whether module has issue or phone.

    Is there any possibility of any security or encryption or frame format or something like that that may be causing the module not to get discovered? Is there anything like newer phones don't have support or are not backward compatible or something like that?

    Regards

    Narendra

  • Hi Narendra,

    I am sorry for missing the part on you being able to scan other devices but not the CC2541, and I understand that being sent back and forth between the forums is not particularly helpful.

    Let us zero this issue down to an environment I can be more helpful with. You mentioned that you are using different third-party Android applications to scan for devices, but have you also used the TI Simplelink Starter? Are you able to scan the CC2541 module running the Simple BLE Peripheral project with the TI Android application?

    Best regards,

    Vetle

  • Hi Vetle,

    I tried installing and testing with TI Simplelink starter app from play store now. I get the same result which is this app is able to discover CC2541 in working phones but not in non-working phones.

    Regards

    Narendra Singh

  • Hi Narendra,

    Can you also verify the same behavior (not being able to scan the device) with the default Simple BLE Peripheral project (without your custom changes)?

    Also, I am not able to open the sniffer log you attached to your original post. Are you able to provide a log, in a different format, for any of the non-working phones? 

    Best regards,

    Vetle

  •  Hi Vetle,

    I will try with default program and let you know. The attached sniffer file can be opened using packet sniffer(I have latest sniffer software)

    Attached sniffer log is for the discoverable and connectable phone. CC2541 is advertising but some of phones are not discovering.

    Regards

    Narendra

  • Hi Vetle,

    Can you please let me know what does this limited discoverable mode mean? Are we free to set to default mode? I have attached screenshot of CC2541 module. Is there any possibility of newer phones or android version be using different advertisement frame format than what is used by CC2541 SDK. Also, is there anything to do with services uuid being used?

      ?

    In SDK the advertisement is set to limited

    //simpleBLEPeripheral.c
    
    #if defined ( CC2540_MINIDK )
    #define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_LIMITED
    #else
    #define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_GENERAL
    #endif  // defined ( CC2540_MINIDK )


    #define GAP_ADTYPE_FLAGS_LIMITED                0x01 //!< Discovery Mode: LE Limited Discoverable Mode
    #define GAP_ADTYPE_FLAGS_GENERAL                0x02 //!< Discovery Mode: LE General Discoverable Mode
    #define GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED    0x04 //!< Discovery Mode: BR/EDR Not Supported
    /** @} End GAP_ADTYPE_FLAGS_MODES */


  • Hi Narendra,

    First of all, the advertisement packet from your sniffer log looks good.

    As for the limited discoverable mode, this will cause the advertising device to stop advertisement after a given time (usually after about 30 seconds, but max 65 seconds), which means that your CC2541 module will only be discoverable (i.e. scannable) for a limited period of time.

    Either of your discoverable flags shall be set in your case (according to the Core Specification Supplement), but you are free to choose either mode. I would recommend that you set the "LE General Discoverable Mode" flag for your use case.

    Best regards,

    Vetle

  • Hi,

    I have tested with multiple phones and found that phones with following android versions have issue

    Redmi note 5 pro ___V9
    Real me 3 pro ___V9
    Vivo 1804______V9
    Samsung________V9
    Nokia 5__________V9
    Samsung j8______V8
    Redmi note 3___V6.0.1
    Phones with following android version doesn't have issue
    Vivo 1718___V7.1.2
    Samsung ___V6.0.1
    Oppo_______V5.1.1
    Nokia 3______V7.1.1
    Micromax Q372___V5.0
    This means that something to do with advertising frame format change in newer versions of phones. I hope TI would have answer for this. All above phones which are not able to scan CC2541 are able to scan other vendors advertisement packets
    Regards
    Narendra
  • Hi Narendra,

    Just to verify, you are using a CC2541 evaluation kit (EVM)/ LaunchPad - not a custom board?

    The advertisement frame format is dictated by the Bluetooth specification, so when the phones are Bluetooth compatible this should not be the issue.

    If you have advertisement packets from other vendors, are you then able to sniff these as well, and compare/see if they are any different? 

    Best regards,

    Vetle

  • Hi Vetle,

    We don't have EVK and i am using custom board something similar to

    I will test capturing other vendor packet and update you. I am using TI stack for developing my application and loading to this module

    Regards

    Narendra

  • Hi Narendra,

    Something else you could try is to reduce the advertisement interval, I believe initially set to (in simpleBLEPeripheral.c):

    // What is the advertising interval when device is discoverable (units of 625us, 160=100ms)
    #define DEFAULT_ADVERTISING_INTERVAL          160

    The different phones will probably have different scan settings, so you could experience an unfortunate case of not matching the advertisement period of your cc2541 module with the scan period of some of your phones. Increasing the advertisement frequency (reducing the interval) will in this case increase the probability of overlapping the advertisement and scan periods.

    Best regards,

    Vetle

  • Hi Vetle,

    #define DEFAULT_ADVERTISING_INTERVAL 160

    is the default interval value used in my application as well as BLE stack. I hadn't changed it.

    I have checked with original latest TI stack and all the mobiles in which it had issue in discovering the devices are able to scan now. I need to port the application to latest stack and check if it works.

    I checked reducing the min and max interval as

    // Minimum connection interval (units of 1.25ms, 80=100ms) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_MIN_CONN_INTERVAL     10

    // Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_MAX_CONN_INTERVAL     12

    which i use for my application it with this interval too it works. Other than above interval change, i am not making change in connection related parameters in my application and hence assume after porting it should work as well.

    I am not sure but looks like there may be some updates in latest stack which might solved my issue.

    Thanks for your support.

    Regards

    Narendra

  • Hi Narendra,

    I am glad you found a solution, and thank you for letting me know!

    Just to summarize, and bring this thread to an end:

    Some Android phones (with newer OS version) had issues scanning the CC2541 module when BLE stack v1.4.1 was used. However, updating the application with the latest BLE stack (v.1.5.0) solved the problem.

    For future endeavours, as long as you are in a development phase, I will recommend that you update your dependencies to their latest release versions. This way you can take advantage of the numerous bug fixes and improvements that we have made since the older versions.

    Good luck!

    Best regards,

    Vetle

  • Hi Vetle,

    Just for your Information, my application was developed some 4 years ago and we didn't had such issue. My application runs well in older versions of phones. It's not possible to change application agaian and again(although regular update is preferred). Now newer android version phones have come and i don't know exactly what may have changed from older to newer versions. But at least, i am happy that i could get some alternate solution. Definitely i have got extra burden of porting my application.

    Regards

    Narendra Singh