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.

CC2640: Advertising/Scanning properties - multiple advertisers

Part Number: CC2640
Other Parts Discussed in Thread: CC3200, CC2650,

Hi!

As I understand the CC2640 can be set to advertise in three different channels. We have a scenario where there are lots of advertisers advertising at the same time, but we only want to discover our own CC2640 device. What we experience is that the detection rate falls drastically when our scanning device is exposed to the other advertising devices. I guess they are all using the primary advertising channels and thus the scanning device will get jammed in some way. Is there a a way to overcome this problem? Since we have control of both the scanning device and the advertising device of interest is it a possibility to use other channels for advertising? We have tried to reduce the scanning interval and increase the MAX_SCAN_RES to 8, but we are still struggling with a low detection rate, especially when the range is increasing.

Best regards,

Jan

  • Hello Jan,
    Please refer to the Scanning and Advertising lab in Simplelink Academy to learn how to for example control which of the three advertising channels to enable/disable (Advertising Task 1 - Change Advertising Parameters). It is only allowed per the bluetooth SIG core spec to use the advertising channels (ch. 37, ch. 38 and ch. 39). You can also enable filtering (white list) on your device address, but this will not change traffic and noise over the air, but it can reduce the number of scan reports sent to your application to reduce processing.

    dev.ti.com/.../
  • Hi Eirik,

    So one solution could be to be to set the advertising channels fixed to one of these the channels and just listen to that. I have tried to implement the white list over the NPI interface implementing the HCI_LE_AddWhiteListCmd without any luck. I have previously managed to send HCI_EXT commands defined in the vendor specific documentation. Any idea why sending HCI_LE commands should be any different? I guess that the HostTest application run on the CC2640 should be able to decode these commands as well?

    Finally, It would be nice to get your opinion on the case described above. We have connected the scanning device to a switch that is going to control a light when being exposed to a lot of advertising devices. Sometimes one of these would be the one we are searching for causing the light to be turned on when detected. Do you think we would be able to obtain a reliable solution using BLE devices this way?

    Best regards,
    Jan
  • Hello Jan,
    How does the command fail? You can also read the white list size with HCI_LE_ReadWhiteListSizeCmd. Take a look at this thread:
    e2e.ti.com/.../2309522

    Because you have control over both devices I would consider switching roles and make the switch into a peripheral device. Then the switch can advertise and form a connection with the target. In this scenario you can enable security as well as privacy features. If you keep your scenario you can review the scanning parameters to make sure you start and stop scanning often enough to free the scan result list which can only store up to MAX_SCAN_RES for every scan duration.
  • Hi Eirik!

    Sorry about the late reply. We have performed a lot of tests to investigate this matter. I guess the problem setting the white list from the host processor(CC3200) is related to the npi interface and not the execution of the LE command on the CC2640. We found that out by setting the white list initially in the host_test code running on the CC2640. Then, when starting the scan from the CC3200 we told the CC2640 to use the white list when scanning.

    I can't rally understand why we are not able to set the whitelist HCI_LE command over the npi interface. We are using the same structure as for HCI_EXT messages however replacing the 2 bytes of opcode with 0x2011. What happens is that the program running on the CC3200 stalls. I guess it could be related to the decoding of the response which I understand is a bit different. Any suggestions to solve this problem will be highly appreciated.

    Finally, with the modified host_test program we were able to run tests on the system comparing the response with and without the whitelist enabled. Our observations coincide with your earlier statements. The detection rate does not seem to change, but this functionality certainly offloads the host processor (cc3200).

    I'am a bit curious to find out more about your suggestion to switch roles. I see the point regarding the security and privacy features, but again will this increase the probability of detecting the device of interest? We currently use scan duration of 0.5 seconds.

    Best regards,

    Jan

  • Hello Jan,
    Have you tried to test with BTool?
    For white list over NPI there might be a hint in this thread post:
    e2e.ti.com/.../2423128

    If the light switch act as a peripheral then it would typically be in discoverable mode all the time and send connectable advertisements (ADV_IND) at a given interval continuously. The central/scanner might not discover it faster, but it can form a connection and observe for example RSSI at every connection interval and switch light based on a RSSI threshold (proximity).

    In your use case I would consider to experiment by increasing MAX_SCAN_RES even more and increasing the scan duration and make sure that scan window is equal to scan interval.
  • Hi Eirik!

    Sorry about the late response. First of all, is it possible to use BTool with the CC2650 LaunchPad or does it have to be a connected to the CC2640R2F? I am currently using the CC2650 Launchpad for debugging our custom board with the CC2640 so it would be nice to use this setup directly.

    For the specific case I was referring to we have done some tests by setting up the whitelist by modifying the host test program on the CC2640. This works fine, and by increasing the MAX_SCAN_RES to 50 we were able to see our devices among 50+ other devices. So the setup now seems to work but I would rather have the definition of the whitelist done over the npi from the CC3200 as it does the housekeeping simpler.

    As we do not want to connect to the devices I don't think the bonding will of any help regarding the whitelist. I am now considering to debug on the CC2640 to investigate the npi communication for HCI_LE commands further.

    Best regards,

    Jan

  • You can run BTool with CC2650 LP, but use the BTool version from the same SDK for the CC2650 HostTest project.