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.

CC2642R: BLE Connection Parameters Configuration

Part Number: CC2642R
Other Parts Discussed in Thread: CC2652R, SYSCONFIG

Hi TI,

 

I am using TI simple peripheral example project for transmitting data to simple central device via a notification approach.

 

Application –

1.       Transmitting 10 bytes data to central device at every 10ms.

2.       Central device is receiving data 10ms.

3.       Max connection interval = 10 , Min connection interval = 10, Connection Timeout = 6000, Slave Latency = 0.

 

Observation –

1.       When only single slave(sensor) is connected data received by central device is near to every 10ms.(See Plot1_Single_sensor.JPG)

2.       But when 2 slave (sensor) are connected to central device the data received is quite faster than than 10ms (when we take time difference between two consective data frame).( See Plot2_two_sensor.JPG)

 

Query –

1.       How data is received faster for two sensor when compared to single sensor ? (refer attach image)  

2.       If it is due due to the connection parameters settings which I need to modify correctly then please guide me ?

3.       Let me know what should be the connection parameters value when I connect 2 slaves or 4 slaves (Max connection interval = ? , Min connection interval = ?, Connection Timeout = ?, Slave Latency = ?).

  • Hey Vidit,

    Can you describe how you are recording this data? It would be best to see a sniffer capture over the air to confirm.

    1.       How data is received faster for two sensor when compared to single sensor ? (refer attach image)  

    Data should usually be sent during connection events, so I don't think there should be a significant time difference between having one or multiple nodes.

    2.       If it is due due to the connection parameters settings which I need to modify correctly then please guide me ?

    3.       Let me know what should be the connection parameters value when I connect 2 slaves or 4 slaves (Max connection interval = ? , Min connection interval = ?, Connection Timeout = ?, Slave Latency = ?).

    This is quite dependent on the requirements for your application. What are your goals here?

    Here is a link to an article that describes how to achieve maximum throughput and goes over design considerations associated with selecting your Bluetooth LE connection parameters: https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/

    You can also refer to our Github for an example showcasing our throughput example. Please note this is on SDK 4.10, but should easily be portable to the latest SDK.

  • Hi Ammar,

    Thanks for the reply,

    1. Can you describe how you are recording this data?

    -> I am using three CC2652R Launchpad board.

    -> I have configured one Launchpad board as central device and other two Launchpad as peripheral device.(using TI example project)

    ->Then I have programmed peripheral such that it is Transmitting 10byte data frame over BLE in form of notification.

    ->And, Central device is programmed to capture transmitted notification in BLE stack after connect with peripheral device.

    ->Captured Data is being printed on UART display and using this data I have created the analysis plot for single sensor and multi sensor.

    2. Data should usually be sent during connection events, so I don't think there should be a significant time difference between having one or multiple nodes.

    -> Yes, correct data is sent only after successful connection events.

    -> I am also receiving correct count of data which I must be receiving in 1 sec, i.e in my case to achieve 100Hz frequency I must receive 100 data in 1 second

    -> When connected to single peripheral and I am able to achieve 100 data in every 1sec.

    -> When connected to two peripheral and I am able to achieve aprox 200 data in every 1sec.

    -> Similarly, when connected to four peripheral and I am able to achieve aprox 400 data in every 1sec.

    ->But, Challenge is to maintain time difference of 0.01 ms between consecutive data.

    -> When single sensor is connected maximum frequency of delta value is 0.0088ms not exact 0.01ms but very close to it.

    -> And when connected to two peripheral maximum frequency of delta value is 0.0033ms.

    ->What does Delta value of 0.0033ms suggests

    -> Tx i.e peripheral is Sending data in every 10ms so, data must be received by central in every 10ms or less than 10ms if there is any loss.

    but, in this case data is coming faster than the transmission rate and also there is no duplicate or similar data all data samples are unique and frequency of data is also correct.

    3.This is quite dependent on the requirements for your application. What are your goals here?

    I think from above information you will get clarity of my application requirement.

    My goal is to get every data sample received by central must not be grater than the transmitted frequency.

    You can consider 4 peripheral are sending data to central device in every 10ms and central has to receive 4 peripheral data in every 10ms i.e 400 data samples in 1sec.

    So, what I think is we need to correctly adjust connection parameters which I mentioned previously.

    Let me know what are you thought on this and how can make this work as per the requirement.

  • Hey Vidit,

    The central device randomly schedules anchor points for each peripheral connection it establishes. Since the central is managing multiple connections, what may be happening is that connection events are intentionally being skipped on the central side to avoid a potential timeout with a conflicting connection event. Because of this, unsent notifications get queued for the next connection event. In this case, the central ends up receiving more than 1 packet. For this reason, you may see certain times where data is sent faster.

    One thing you can try to avoid this is to used a fixed guard time (go to Sysconfig –> Advanced Setting –> Extended Stack Settings –> Guard Time). This ensures the central will schedule connection events 5ms apart from each separate connection. Additionally, you can try increasing the connection interval to maybe 20ms as well as increase the payload per connection event to achieve similar throughput per second (in the case you only have one connection).\

    Hopefully this makes sense. Here's a link to our Link Layer (LL) section of our User's Guide that covers the behavior of the central in more detail. 

  • Hi Ammar,

    Sorry, for delay

    Actually there is some unavailability of our peripheral device. So I tried arranging 1 and tried applying changes that you suggested for one module.

    After applying guard time I am getting max frequency of delta as 4ms(0.004sec) between the received data but I want to achieve 10ms which I am not getting.(refer screen shot with_gaurd_time.JPG)

    I also tried adjusting Payload (i.e PDU) but increasing PDU did not cause any change in delta of received data.

    - Can you suggest further which parameters I need to adjust to increase guard time value from 5ms to 10ms?

    - Or Is there any parameter which need be changed so as to get delta of 10ms?

    I attaching screenshot of my parameter values.

    Simple Peripheral Settings

    Simple Central Settings

    I will further update you with the results for 4 sensors as well.

    Regards,

    Vidit

  • Hey Vidit,

    Apologies for the delay, I was not in the office this past week.

    Unfortunately, I don't think you can change the guard time to a different value without making modifications to the source libraries so this will not be possible.

    At an application level, are you tracking which packets are being received with a timestamp? Try adding some application level counter or sequence number so that you can track when the packet is sent and received. I want to ensure the data you gather accurately captures the "receive" time. If you have a sniffer log to share of the behavior, we can tell this easily and measure the timings most accurately over the air.

  • Hi Ammar,

    Thanks for the reply.

    Actually after connecting 4 devices, as per my understanding Guard Time can be applied to Simple Central only but still I tried applying to Simple peripheral as well. I Tried applying Guard Time for different scenarios.

    1. Applying Guard Time to Only Rx and analyzed 5min data received from Transmitter.

    Result :

    2. Applying Guard Time at only Tx

    Result : 

    3. Applying Guard Time to both Rx and Tx

    Result: 

    I have Implemented application level counter as you suggested and observed timing along with number of count.

    So, from above result you can observe that

    1. Applying Guard time to Tx is no use.

    2. Applying guard time to Rx actually give no loss of data but there is delay in receiving data you can observe that in readings.

    3. After applying Rx guard time My frequency of receiving data is distribute in two half.

    So, I need to know How can I concentrate My Frequency near to 10ms data rate. I tried changing Connection interval but I got best result from present connection interval (i.e Min Conn Interval - 10ms and Max Conn Interval 20ms).

    I will provide you sniffer log as well later.

    Thank you

    Vidit

  • Hey Vidit,

    Can you shed light on how you are sending these messages? The guard time is meaningless for a peripheral device.

    At a higher level, what are the implications you see at your application level?

    I'm having some trouble following the results above. As such, I'm interested in viewing the sniffer log when you have it.

  • Hi Ammar,

    Can you let me know for which scenario you want sniffer log and what should be the setup,

    example : Central connected to rf packet sniffer 2 and central connecting to peripheral devices.

    1. Currently my rf packet sniffer 2 is not detecting my sniffer agent need your help to setup this.

    I Tried setting up as per the steps in user guide I flashed sniffer_fw.hex in CC2652R1 and then started Rf sniffer 2 setup under this My device configuration was disabled an below it is showing no device found.

    2. If the above setup runs then I wanted to confirm with you regarding the setup for which you want sniff the packet

    Should I capture packet using 1st way or 2nd way or both ?

    3. Further for timing analysis and sequencing we tried reducing PDU length from transmitting side to 1 and size 27bytes  which successfully provided us the sequencing for 4 connected device but our at receiver end amount of packet received got dropped to (25 %)  i.e 75 % data got lost or it was not transmitted from transmitter (at receiver end PDU length was 5 and size 69 bytes).

    So, can you tell me is it possible to receive 100%transmitted data at receiver end with Tx PDU length 1 or is there some other method using which we can receive complete transmitted data and maintaining sequencing like (1,2,3,4 then 1,2,3,4 and so on) 

  • Hello,

    My apologies, the Packet Sniffer 2 is ok for sniffing advertisements on a fixed channel and will not provide too much additional insight after a connection is established. I would recommend using a Frontline sniffer or Ellisys if possible.

    I would create a separate thread regarding the issues with the sniffer if you are interested in pursuing them, just to keep this thread focused on the original issue. I would try to reset the device after flashing and then detecting the device. In terms of how the sniffer works, your drawing of Option 2 is correct.

    So, can you tell me is it possible to receive 100%transmitted data at receiver end with Tx PDU length 1 or is there some other method using which we can receive complete transmitted data and maintaining sequencing like (1,2,3,4 then 1,2,3,4 and so on) 

    Can you provide a code snippet of how you are sending data? You can achieve this sequence by using Indications. For an Indication, the stack will retry the message until it is acknowledged and will not process or send any other packet until acknowledged. Notifications are more commonly used, but there is no guarantee the receiver will receive 100% of the data.

    If you use the 1M PHY, do you see better results? When using coded PHY you may want to modify the APP_SUGGESTED_TX_TIME as well as the RX_TIME on the central side. Depending on your PHY settings, this setting must be increased so you don't miss PDU's due to a longer TX time (which is the case if using coded PHY).

  • Hi Ammar,

    Sorry for delay, Actually I was going through your request and also we tried multiconnection through indication.

    1. Yes you can create a new tread regarding the issues with the sniffer.

    Can you provide a code snippet of how you are sending data? 

    2. I am using Notification approach for receiving data in central

    As you suggested indication approach so, I tried implementing indication as well.

    I was getting proper sequencing for 4 sensor but data frequency was different for different sensor for all the 4 sensor, and my expectation was to get 100 Hz data frequency i.e delta time 10ms, 

    when 1 sensors is connected I received 47.8Hz frequency but (100 HZ is expected)

    When 2 sensor are connected we can achieve sequencing but frequency drop is present for 1st sensor 48.3 Hz and for 2nd it is 47.99 Hz

     

    In case of 4 sensor the frequency got further decrease to 1st sensor 28.65 Hz and for 2nd sensor 47.23 Hz, 3rd sensor 42.62 Hz and for 4th sensor  23.44 Hz

    sequencing is also not as per expectation.

    So what Is there way to improve this ?

    But As it is unable to Provide 100 Hz frequency with single sensor, is this the limitation of Indication approach as I can only achieve 47.8 Hz 

    So, should I continue working on notification approach for synchronization of sensor data.

    3. If you use the 1M PHY, do you see better results?

    Yes, when I am using 1M PHY instead of coded S2 for extended advertisement than frequency improve.

    4. When using coded PHY you may want to modify the APP_SUGGESTED_TX_TIME as well as the RX_TIME on the central side. Depending on your PHY settings, this setting must be increased so you don't miss PDU's due to a longer TX time (which is the case if using coded PHY).

    My current setting for Tx and Rx

    5. Actually I used Request response approach as well but I could only achieve 47 to 46 Hz of frequency for all with above Rx and Tx time.

    Can I achieve 100 Hz frequency with request response i.e each data is receive each data in 10ms.

  • Hey Vidit,

    Try increasing the APP_SUGGESTED_TX_TIME. You mention the frequency improves when using 1M PHY. These parameters are related to which PHY you use so I would suggest trying something larger, like 2624 us. Please let me know if this makes a difference.

    Just to confirm, you are observing the time from TX on one device to RX on one device is approximately a 20ms period, rather than a 10 ms period?

  • Hi Ammar,

    I think if we will increase Tx time frequency will drop further but, still I tried changing APP_SUGGESTED_TX_TIME to 2624 us but did not see any improvement in result.

    Yes, My expectation is to get response in every 10ms for each request.

    Thank you.

  • Hey Vidit,

    After speaking with a colleague, what you are attempting should be possible for 1 (maybe 2) devices. However, as you increase the number of nodes, the central will not have the bandwidth to maintain every single connection event for every node as well as send your notifications exactly.

    If you increase the connection interval further, you should see better results as you are freeing up more bandwidth and spacing out connection events.

    I will test this out with our default examples and will report back with my observations. However, it is not possible to achieve such throughput with more than 1 or 2 devices if you enable the fixed guard time. With guard time disabled, the anchor points for each connection are randomly scheduled, which also will not give you the consistency you expect in your use case.

  • Hi Ammar,

    Is there any update on the above issue.

    Also I wanted to know is it necessary to maintain max connection interval as per the below specification for successful connection of 4 device.

    Thank you