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.

CC2640R2F: Simple Serial Socket Server/Client Optimizing the Connection Interval

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Hello,

I have the simple serial socket server running on the CC2640R2 and I am working to understand how to optimize the connection intervals in this example.  I am using CC2640 SDK version 2.4.0.32 .  

I started modifying simple_serial_socket_server.c and changing the settings for timing but this did not seem to change anything.  

What I want to do is change the connection interval to minimize how often the two units talk to each other so as to reduce the current as much as possible.Our instrument doesn’t update that fast, so we don’t need to have lightning fast communications.

I’ve increased the min and max DESIRED_CONNECTION_INTERVAL, but it doesn’t seem to have any effect on how often serial data transfer occurs or on the amount of current it pulls.

However, it does seem to have effected my ability to scan and connect to the server module.

 Can you please help guide me on ways to reduce the overall power consumption of the solution?  

Sincerely,

Jason 

  • Unfortunately, the diagrams didn't paste into this message, but this has to do with the scanning and advertising from the TIrex documentation.

    Reading again the documentation about advertising and scanning, it seems to contradict itself.

    Scanning Task 1 – Change Scanning Parameters

    In this task, we will scan continuously with the following scan parameters:

    • Scan interval: 150 milliseconds(ms)
    • Scan window: 150 milliseconds(ms)
    • Scan duration: 5 seconds(s)
    • Scan type: Passive

    When setting the scan interval equal to the scan window the device will scan continuously. On the other hand, if the scan interval is larger than the scan window the device will duty-cycle scanning.

    Optimizing Scanning: How to get data fast?

    • In a time-constrained application, when the user needs to receive the data as fast as possible, make sure that scanning window is more than the advertising interval + 10ms to guarantee discovery. (The 10 ms extra account for the 0 ms to 10 ms of pseudo-random delay in between each advertising event, assuming no interference.) Following this rule will increase the chance of receiving the advertising packet on the first scan.

    So which is correct?

    Something that I notice in the gap.h file where it lists the default values is that many are set to 300mSec.

    Through trial and error, that’s the advertising interval where the connection rate seems to drop off.

     ---------------------------

    Continuing to work on this:

    I added the following to my init function, and it now seems to connect reliably with the peripheral unit advertising at 1 second intervals.

    It still doesn’t make sense based upon the app info as I show below in previous email.

     

    #define DEFAULT_SCAN_INTERVAL                 (1600 + 16)// 1sec + 10 mSec

    #define DEFAULT_SCAN_WINDOW                   (1600 + 16)   // 1sec + 10 mSec

     

      GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT, DEFAULT_SCAN_INTERVAL);  // RKS, set this longer er optimising scann app note

      GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND, DEFAULT_SCAN_WINDOW);  // RKS, set this longer er optimising scann app note

     

    SO I still need to know what would be causing my target hardware to only be able to be programmed once.

    So close yet so far away…

     

     

    It doesn’t make sense to me that the scanning window needs to be opened up when the diagram shows the advertising event is <= 10mSec. The default value for the scanning window is 10 mSec.

    If the advertising interval is set to 1 Second, does that mean the Scan Window needs to be 1 Sec + 10 mSec?

  • Have you gone through the "Bluetooth Low Energy Scanning and Advertising" and "Bluetooth Low Energy Connections" labs:

    http://dev.ti.com/tirex/explore/node?node=AO9tDQs88Bcw33.wxV2moA__krol.2c__LATEST

    Scan Window = Scan Interval = 1 Sec + 10 mSec is a good choice for an advertisement interval of 1 second. FOr faster disocvery you must decrease advertising interval. But there will never be deterministic discovery time due to interference, timing and RF quality. 

    What do you mean by:

    SO I still need to know what would be causing my target hardware to only be able to be programmed once.