I want to know how I can configure the BLE module in low energy mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jama_4535901
Level 3
Level 3
10 sign-ins 5 sign-ins 25 replies posted

Excuse me

Is the vendor specific code shown in the examples already in low power mode? or the vendor specific code example is not in low power mode?

I am using CYBT-213043-MESH

I want to know how I can configure this code so that it is in the maximum low energy mode

I want the CYBT-213043-MESH to use the vendor specific code with a very low power consumption so that the battery it uses can last a long time

0 Likes
1 Solution

Hi i jama_4535901,

I believe you are asking about mesh application.

Please enable mesh LOW_POWER_NODE in the application if you want to lower the power consumption. Please make sure this feature is suitable for your application scenario. You need a friend node as well inorder to make it work, as mentioned in the mesh spec.

Please refer mesh demo examples. low_power_led, sensor_temperature, etc are already configured for low power node (by default it is not in LPN state).

GitHub - cypresssemiconductorco/mtb-examples-CYBT-213043-MESH-btsdk-mesh-demo: Mesh Demo Examples

Please refer mesh spec for more details of low power node.

https://www.bluetooth.com/specifications/mesh-specifications/

#if defined(LOW_POWER_NODE) && (LOW_POWER_NODE == 1)

    .features           = WICED_BT_MESH_CORE_FEATURE_BIT_LOW_POWER, // A bit field indicating the device features. In Low Power mode no Relay, no Proxy and no Friend

    .friend_cfg         =                                           // Empty Configuration of the Friend Feature

    {

        .receive_window = 0,                                        // Receive Window value in milliseconds supported by the Friend node.

        .cache_buf_len  = 0,                                        // Length of the buffer for the cache

        .max_lpn_num    = 0                                         // Max number of Low Power Nodes with established friendship. Must be > 0 if Friend feature is supported.

    },

    .low_power          =                                           // Configuration of the Low Power Feature

    {

        .rssi_factor           = 2,                                 // contribution of the RSSI measured by the Friend node used in Friend Offer Delay calculations.

        .receive_window_factor = 2,                                 // contribution of the supported Receive Window used in Friend Offer Delay calculations.

        .min_cache_size_log    = 3,                                 // minimum number of messages that the Friend node can store in its Friend Cache.

        .receive_delay         = 100,                               // Receive delay in 1 ms units to be requested by the Low Power node.

        .poll_timeout          = 200                                // Poll timeout in 100ms units to be requested by the Low Power node.

    },

#else

Thanks,

-Dheeraj

View solution in original post

6 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi jama_4535901 ,

CYBT-213043-MESH contains 20819 as base chip. Did you gone through the low power application note available here:

https://www.cypress.com/documentation/application-notes/an225270-cyw208xx-ble-low-power-guidelines

Thanks & Regards,

Anjana

0 Likes

Hi i jama_4535901,

I believe you are asking about mesh application.

Please enable mesh LOW_POWER_NODE in the application if you want to lower the power consumption. Please make sure this feature is suitable for your application scenario. You need a friend node as well inorder to make it work, as mentioned in the mesh spec.

Please refer mesh demo examples. low_power_led, sensor_temperature, etc are already configured for low power node (by default it is not in LPN state).

GitHub - cypresssemiconductorco/mtb-examples-CYBT-213043-MESH-btsdk-mesh-demo: Mesh Demo Examples

Please refer mesh spec for more details of low power node.

https://www.bluetooth.com/specifications/mesh-specifications/

#if defined(LOW_POWER_NODE) && (LOW_POWER_NODE == 1)

    .features           = WICED_BT_MESH_CORE_FEATURE_BIT_LOW_POWER, // A bit field indicating the device features. In Low Power mode no Relay, no Proxy and no Friend

    .friend_cfg         =                                           // Empty Configuration of the Friend Feature

    {

        .receive_window = 0,                                        // Receive Window value in milliseconds supported by the Friend node.

        .cache_buf_len  = 0,                                        // Length of the buffer for the cache

        .max_lpn_num    = 0                                         // Max number of Low Power Nodes with established friendship. Must be > 0 if Friend feature is supported.

    },

    .low_power          =                                           // Configuration of the Low Power Feature

    {

        .rssi_factor           = 2,                                 // contribution of the RSSI measured by the Friend node used in Friend Offer Delay calculations.

        .receive_window_factor = 2,                                 // contribution of the supported Receive Window used in Friend Offer Delay calculations.

        .min_cache_size_log    = 3,                                 // minimum number of messages that the Friend node can store in its Friend Cache.

        .receive_delay         = 100,                               // Receive delay in 1 ms units to be requested by the Low Power node.

        .poll_timeout          = 200                                // Poll timeout in 100ms units to be requested by the Low Power node.

    },

#else

Thanks,

-Dheeraj

OK thanks

please

can you answer my 4 questions?

1.The vendor specific example code is already in low energy mode?

2. I have seen that in the makefile if the line is set to 1:

# value of the LOW_POWER_NODE defines mode. It can be normal node (0), or low power node (1)

LOW_POWER_NODE? = 0

low power.PNG

if i set with 1 in the line LOW_POWER_NODE? = 0 I have seen that the board with vendor specific code goes into sleep mode and lowers its consumption to 1mili amper, but it does not wake up again until it is reset, how can you wake up again? the board in the same code vendor  spesific?

3. I also want to know if in these lines (  wiced_bt_mesh_app_lpn_sleep_t           p_mesh_app_lpn_sleep;) the board can be sent to sleep, or with what code functions can I put the board to sleep and wake up

low power 2.PNG

4. I have also read that with the dave wake and host wake pins on the external connector J4 they can be used to send the CYBT-213043-MESH module to sleep and wake up, how can I use these pins in the code?

0 Likes

Hi,

1) 2) By default it is not enabled for Low Power. You can enable it in the makefile (LOW_POWER_NODE ?= 0)

Please note, the application shall implement wiced_bt_mesh_app_lpn_sleep_t to receive notification when sleep mode can be entered.

Please check wiced_bt_mesh_app_func_table_t in wiced_bt_mesh_app.h for more details.

You can refer the below document to understand low power modes and conition.

https://www.cypress.com/documentation/application-notes/an225270-cyw208xx-ble-low-power-guidelines

3)  Implementation of Mesh application gives a simple step to configure the low power mode and register a callback.

Please refer wiced_sleep.h for getting details of wake sources, APIs, etc.

You can refer low_power_led (where a timer is implemented) and sensor_temperature (only HID-OFF implemented) to understand how the coding is done.

4) Those are dedicated device pins. You can configure it's mode in wiced_sleep_config_t. 

Please refer the low-power-guidelines document which I have given above.

wiced_sleep_wake_type_t                  host_wake_mode;         /**< Defines the active level for host wake signal */

wiced_sleep_wake_type_t                  device_wake_mode;       /**< Defines the active level for device wake signal

                                                                                                           If device wake signal is not present on the device then

                                                                                                           GPIO defined in device_wake_gpio_num is used */

Thanks,

-Dheeraj

0 Likes

thanks for the info

Now, I know that the code LOW_POWER_LED.C uses a timer to wake up and sleep the board,

Now I want to the following

I know that in the code Aplication.c in the function :

static void mesh_adv_report(wiced_bt_ble_scan_results_t *p_scan_result, uint8_t *p_adv_data)

{

    wiced_bool_t processed = WICED_FALSE;

    //extern void mesh_vendor_server_send_adv_data(uint8_t *bda, int8_t rssi);

   

    WICED_BT_TRACE("Devices %B, %d\n",p_scan_result->remote_bd_addr, p_scan_result->rssi);

   

   

    if (p_scan_result == NULL)

        return;

   

    //mesh_vendor_server_send_adv_data(p_scan_result->remote_bd_addr, p_scan_result->rssi);

    if (p_scan_result->ble_evt_type == BTM_BLE_EVT_CONNECTABLE_ADVERTISEMENT)

    {

the board is scanning the MAC ADRESS and RSSI as shown in the image and I print them as in the line:

     WICED_BT_TRACE ("Devices% B,% d \ n", p_scan_result-> remote_bd_addr, p_scan_result-> rssi);

scaning.PNG

I want that when there are no devices to scan the board it goes to sleep and when there are devices that scan the board it wakes up

How can I set the board to sleep when there are no devices to scan, and how can I wake up when there are devices to scan to save energy?

0 Likes

Hi,

Mesh application is configured to do 100% time scanning. That's how a mesh node should work.

For conserving power, we will have to utilize the LOW_POWER_NODE feature described in the mesh specification, that will work with a FRIEND_NODE.

        .scan_mode                       = BTM_BLE_SCAN_MODE_PASSIVE,                         

        .high_duty_scan_interval         = 96,                                                       // High duty scan interval

        .high_duty_scan_window           = 96,                                                       // High duty scan window

        .high_duty_scan_duration         = 0,                                                        // High duty scan duration in seconds (0 for infinite)

        .low_duty_scan_interval          = 96,                                                       // Low duty scan interval

        .low_duty_scan_window            = 96,                                                       // Low duty scan window

        .low_duty_scan_duration          = 0,                                                        // Low duty scan duration in seconds (0 for infinite)

Thanks,

-Dheeraj