• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Bluetooth® Low Energy & ANT Forum » BLE connect to slave without advertising
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

BLE connect to slave without advertising

BLE connect to slave without advertising

This question is answered
Khalil Hanhan
Posted by Khalil Hanhan
on Jul 22 2011 09:21 AM
Prodigy180 points

When the button is pressed on the Keyfob_slave, the device goes in advertising mode and connection between master and keyfob can be established. I am trying to automate this process, but something is missing ! I tried to trigger the key event "Hal_ProcessEvent( Hal_TaskID, HAL_KEY_EVENT)" then I tried to call Advert. directly osal_set_event( gapRole_TaskID, START_ADVERTISING_EVT).

Well, it does not seem to me that Keyfob go Advertising ?! 

Would also be possible to wake the Keyfob without advertising so that it just wait for GAP_LINK_ESTABLISHED_EVENT for some time. But it does not seem that the Keyfob one may connect to the Keyfob just by leaving POWER_SAVE mode.

Is this acheivable ?

BLE CC 2540 CC2540 Keyfob
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • GregS
    Posted by GregS
    on Jul 22 2011 10:44 AM
    Verified Answer
    Verified by Khalil Hanhan
    Expert4165 points

    Hello,

    To form a connection requires the keyfob to advertise.  The advertise packet will be seen by the master, and this will trigger the establish request.  The keyfob only has the RX on for a short period of time after each advertisement and this is when the keyfob would be looking for  an establish request.

     

    To turn on/off adv use - and this will add some checks for setting osal start_advertising_event.

    GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &new_adv_enabled_status );  

     

    Br,

    -Greg

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Khalil Hanhan
    Posted by Khalil Hanhan
    on Jul 25 2011 08:08 AM
    Prodigy180 points

    thank you for your reply.

    I set the keyfob timerEx to start Advertising for about 100ms every 10seconds, in BTool I could establish the connection with the keyfob. I noticed Tx is active for about 10ms at the beginning: 2ms with 28mA and 8ms with 9mA (I assume wakeup +  Tx), afterwards (2ms-28mA + 2ms-9mA). 

    Would it be also possible for keyfob to skip Tx-part and just scan for connection requests from the master ?

    In the master side, what is the max. Rx-scanning time needed to be able to synchronize frequency and start a connection ?

    In BTool, I set the min./max. connection interval to 6 (7.5ms), but then the connection between keyfob was lost. Are there some recommended settings for least power consumption ?

     

    BR,

    -Khalil

     

     

    CC2540 BLE
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • GregS
    Posted by GregS
    on Jul 25 2011 08:57 AM
    Verified Answer
    Verified by Khalil Hanhan
    Expert4165 points

    Hello,

    Note - the 28ma(tx) will come down below 19 if you uses DC/DC converter ref design. 8ma-->6ma. RX should be about 21ms without dc/dc.

    Would it be also possible for keyfob to skip Tx-part and just scan for connection requests from the master ? - No, the spec has this setup as a trigger mechanism.  TX rec by Master  will trigger ConnReq. The slave starts looking for the establishReq 160us after transmit is complete.

    The master side scan can be set (interval and length) . If you don't want to risk missing an advertisement set them equal to each other, and you will scan 100%.

    7.5ms may have issues if there is any data.  Try using 8.75ms.

    -Greg

     

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Khalil Hanhan
    Posted by Khalil Hanhan
    on Jul 26 2011 12:50 PM
    Prodigy180 points

    Hello,

     

    Thanks for your the valuable information.  19mA is much better.

    160µs after transmit complete seems nice. I tried to find the shortest period after enabling advertising where the keyfob may be connectable.

    I noticed when advertising is enabled, there will be some delay before the first advertising packet begins (about 6ms). I searched in the firmwae if there is an adjustable advertising delay. I changed some configurations, but did not manage to reduce the delay. If I limit the period between enabling advertising and sleeping again to less than 8ms, the keyfob will not be reachable anymore.

    Are there some ideas to reduce the period to less than 8ms?

     

    br,

    khalil

    CC2540 Bluetooth Low Power BLE stack
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • GregS
    Posted by GregS
    on Jul 26 2011 12:57 PM
    Verified Answer
    Verified by Khalil Hanhan
    Expert4165 points

    The advertising has a built in 10ms randomness to prevent multiple devices from advertising at the same time.   If you want to save power (at peripheral) and have low latency, then you may want to stay in a connection and use slave latency to allow the peripheral to sleep - until it has data to send.

    Br, 

    -Greg

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Khalil Hanhan
    Posted by Khalil Hanhan
    on Jul 28 2011 07:29 AM
    Prodigy180 points

    Hello,

    ahh, I see 10ms. I could see that the keyfob taks about 6-7ms to start advertising, advertising and scanning takes about 4-5ms.

    The application in which we want to use the CC2540 is up to 12 devices to with which one wish to establish communication. The master is not everyday there to keep a connection, the devices are not reachable to manually trigger the beginning of the communication, they work on battery and must provide a fair battery life time.

    There are several scenarios possible:

    - Each device act as a slave, wakes every 10s up, advertise once, and scan for a connection event then go back to sleep if no event exist.

    - Or, device wakes up, scan for master without advertising. If master exist advertise to be connectable, scan for connection event

    ... Is Master-Slave Role-Switch possible ?

    ... Can the master send a broadcast message ?

    in Volume 3, Part C, Section 11of the BT 4.0 specification -> "If the Length field is set to zero, then the Data field has zero octets. This shall only occur to allow an early termination of the Advertising or Scan Response data."

     I tried ... GAPRole_SetParameter( GAPROLE_ADVERT_DATA, 0 ,advertData); with advertData[1] = 0x00; but it did not make a difference ! 

    are there possibilities to optimize advertising ?

     

     

    CC2540 BLE stack
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • GregS
    Posted by GregS
    on Jul 28 2011 08:39 AM
    Verified Answer
    Verified by Khalil Hanhan
    Expert4165 points

    Comments inline

     

    - Each device act as slaves, wakes every 10s up, advertise once, and scan for a connection event then go back to sleep if no event exist. -

    [greg] - Should work, but you are wasting energy from the 11 which do no need to connect. 

    - Or, device wakes up, scan for master without advertising. If master exist advertise to be connectable, scan for connection event

    [greg] - slave can only broadcast or advertise and allow connection

    ... Is Master-Slave Role-Switch possible ?

    [greg] - This is planned, but not ready currently

    ... Can the master send a broadcast message ?

    [greg] - spec allows it, but we do not support yet, it is planned.

    After setting ADVERT DATA, try disabling and enabling advertising.  Is the master or slave device determining who will connect?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Khalil Hanhan
    Posted by Khalil Hanhan
    on Jul 29 2011 01:09 AM
    Prodigy180 points

    that's right, energy will be wasted for 11ms. Is there another "not-manual" way for the device to be connectable ?

    I set ADVERT DATA in initialization, advertising is enabled each 10s then disabled after 7ms(I suppose device completes 1 advertising cycle). But I did not notice difference in advertising length.

    I also tried decreasing TGAP_LIM_DISC_ADV_INT_MIN, it also did not make a difference when enabling advertising for more than 100ms ! Does it lie on the using your first version (ble 1.0) ?

    >>> Is the master or slave device determining who will connect? <<<

    well, the main idea is: we have 1 to 12 devices which work on battery and can not be triggered manually ... on the other end we have one device [I call it master] which has to:

    - detect which devices are there.

    - connect to the devices whenever user want it to connect.

    Goal --> get the connection with the cheapest power consumption on the (1 to 12) devices side, it does not really matter which is slave and which is master. I am to switch the roles and check the results.

    Master-Slave role switch would be interesting, is it planned the end of this year ?

     

    I updated IAR to version 7.60, I tried "SimpleBLEPeripheral" and "keyfob-demo" without periodic tasks like battery monitor, I noticed:

    - When advertising Tx-power goes up to 45mA !

    - When Idle, the device wakes up regularly ! in "keyfob-demo" it is noticed when swtiching advertising on for long than 20ms.

    are these due to some bug ?

     

    CC2540 BLE stack
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use