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.

CC2540: Missing Packets while scanning devices

Part Number: CC2540
Other Parts Discussed in Thread: CC2642R

Hello Everyone,

I am currently working on a BLE project in automotive domain and this is the first time I am working on BLE. In my project, I am working for an ECU which scans for an advertisement packets from TPMS sensors(Tire pressure monitoring system) and then advertising those packets to Mobile phone. 

However, while during the observer role, scanning the packets from TPMS, it came to my notice that we are missing out several packets (as I see datas from TPMS are being received in other BLE sniffer apps). How can we make sure in a BLE n/w, we receive maximum number of packets? What configurations parameters need I look into and what needs to adjusted here?

Thank you in advance! Slight smile

Best,

Varun

  • Is it possible that CC2540 is based on 8051 and the performance is not good enough for collecting all advertising packets you need! I would suggest you to use TI latest BLE solution CC2642R to test and see if it improves first.

  • Thank you for the reply. Unfortunately, we can not use CC2642R, since this is a legacy project. Let me explain more about the current configuration:

    Currently I've configured the ble to limited discovery mode, 

    #define DEFAULT_DISCOVERY_ACTIVE_SCAN FALSE

    #define DEFAULT_DISCOVERY_WHITE_LIST FALSE

     uint16 scanduration = 5000U;

     GAPRole_SetParameter( TGAP_LIM_DISC_SCAN, sizeof( uint16 ), &scanduration ); 

    and initialised the observer like below:

    uint8 scanRes = 60;
    GAPRole_SetParameter ( GAPOBSERVERROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes ); 

    and every 5sec I call 

    GAPObserverRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,DEFAULT_DISCOVERY_ACTIVE_SCAN,DEFAULT_DISCOVERY_WHITE_LIST );

    Are there any parameters I need to adjust or configure to get the best scanning results?

    Thank you in advance.

    Best,

    Varun

  • If you increase scanduration and scanRes, does it help?

  • Thank you Yikai Chen. I tried increasing scanres but it didn't help. But now increasing scan duration looks better . Thanks a lot Slight smile

  • Seemed like I was receiving packets properly, but with further testing ,  GAPObserverRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,DEFAULT_DISCOVERY_ACTIVE_SCAN,DEFAULT_DISCOVERY_WHITE_LIST ); needs to be called every "scanduration" time, right? Just want to make sure I am doing the right thing,

  • Yes, that’s correct.

  • Sorry, my previous message was incomplete. Seems like it was working and i was receiving more packets. But with my further testing, I am facing the same old problem which is missing packets 

  • Do you try to define DEFAULT_SCAN_DURATION and DEFAULT_MAX_SCAN_RES to a larger value?

  • DEFAULT_SCAN_DURATION for TGAP_LIM_DISC_SCAN, right? Here, in GAPRole_SetParameter( TGAP_LIM_DISC_SCAN, sizeof( uint16 ), &scanduration ), I increased scanduration which is same as defining DEFAULT_SCAN_DURATION  to a larger value, right? How is it different?

  • Hi Varun,

    I agree with YiKai. The DEFAULT_SCAN_DURATION and DEFAULT_MAX_SCAN_RES values are used in several parts in the program. Updating the defines will ensure that the value is reflected in all the relevant locations. Can you try updating these defines to see if there is a difference? Would it also be possible to get a BLE Traffic Sniffer Log of the environment to see what packets are going over the air?

    Best Regards,

    Jan