cancel
Showing results for 
Search instead for 
Did you mean: 

How to run multiple different models on different elements in a node??

AC.3
Associate III

I am using STM32WB55 Nucleo Pack (STM32WB55RGV6 MCU) and STM32Cube_FW_WB_V1.3.0 SDK, I uploaded BLE_MeshLightingDemo code (without any edit) and provisioned the node using ST BLE Mesh app , all the elements in a node shows simillar models.

I want to to run different models on different elements in a single node, help me please....

1 ACCEPTED SOLUTION

Accepted Solutions
EMECH
ST Employee

​Hi,

The choices of the  number of elements, the number of models per element, the number of network keys and application keys are limited to the FLASH size allocation of the node limited to 2 sectors (8 Kbytes).

Up to now the choices guided by customer requirements were:

  • 3 elements
  • 21 models
  • 3 network keys
  • 3 application keys

These limits are set inside the BLE MESH library, any modification on these values implies a new library binary.

Nevertheless these values can be adjusted especially for the number of elements and the number of models as following for example:

  • 10 elements
  • 6 models
  • 3 network keys
  • 3 application keys

Best regards.

View solution in original post

23 REPLIES 23
Remi QUINTIN
ST Employee

First I would recommend you to use the latest cubeWB FW package V1.8

Then you can configure your system via the mesh_cfg_usr.h file.

If you could give us more info on your architecture, it would be easier to help you.

AC.3
Associate III

Thanks for your reply.

I am using 3 elements per node, Element1 I am using to control a light, Element2 for to control a fan and Element3 for to control an AC or a TV.

So I want to run generic onoff server model in Element 1, generic onoff server and generic level server models in Element 2 and generic onoff server model in Element 3.

Is that possible??

AC.3
Associate III

hi Remi QUINTIN ,

You recommend me to use the latest cubeWB FW package V1.8, when I use the latest version ST BLE Mesh app always stopping

I used BLE_MeshLightingPRFNode project from cubeWB FW package V1.8, I loaded the code to the board and worked successfully.

Here the node contain only one element by default, I want three elements .

In appli_mesh.c line number 121 is /*Number Of Elements selected per Node. Maximum Elements supported = 3*/

So, I edited APPLICATION_NUMBER_OF_ELEMENTS to 3, I loaded the code and provisioned the node, during the configuration step(adding the publish and subscribe address) in ST BLE Mesh app the app stopped. I reopened the app and the screen is like this (added image), I do not know what happened, what happened to Element 2 and Element 3?

I controlled Element 1(Blue LED on the board) but when I clicking on Element 1 or Element 2 ST BLE Mesh app is stopping always. And I can not assign publish and subscribe address to them, it's failed.

Help me to fix this issue.

I successfully controlled three elements by using cubeWB FW package V1.3 without any problem.

Why cubeWB FW package V1.8 can not run 3 elements?

How to add multiple elements(3 or greater than 3) in a proper way?0693W000004GPQlQAO.jpg

Remi QUINTIN
ST Employee

​For your architecture, you can use 2 elements with 2 models on elemenet 1.

/******************************************************************************

*** Following section helps to select right configuration of Models                                  *******

/******************************************************************************/

/**********************************************************/

/* Define the following Macros to enable the usage of the                    */

/* Server Generic Models                                                                              */

/* Definition is a bitmap of 3 bits: bit 2 element 3                                    */

/*                                  bit 1 element 2                                                           */

/*                                  bit 0 element 1                                                          */

/* Example: 6 means Model enabled in element 2 and 3                        */

/**********************************************************/

#define ENABLE_GENERIC_MODEL_SERVER_ONOFF                                 (5) //element 1 + element 3

#define ENABLE_GENERIC_MODEL_SERVER_LEVEL                                   (1)

/*******************************************************************************

*** Following section helps to configure the Application of Mesh                                    ********

*******************************************************************************/

#define APPLICATION_NUMBER_OF_ELEMENTS                                        2

Application note AN5292 is expected to be released this week with relevant information regrading such use case.

Thanks for your help Remi QUINTIN

Would you please suggest me how to control 3 devices with 2 elements in a single node???

Hello Remi QUINTIN,

I edited the code as you mentioned above, but it doesn't worked. After provisioning the node the BLE Mesh App waited Loading Device Composition Data.... stage. After a lot of time it return to main window without configuring the elements, I tried a lot of times but I can not configure the elements.

 0693W000004GvnhQAC.png

0693W000004Gvo6QAC.png0693W000004GvoBQAS.png

0693W000004GvoaQAC.png0693W000004GvofQAC.png

Is there any other changes required here in mesh_cfg_usr.h file??

/* Following Macro helps to know if the Fixed functions are needed or not 
   DO NOT change or add any space at the end of the file */
#if defined (ENABLE_GENERIC_MODEL_CLIENT_ONOFF) \
    || defined (ENABLE_GENERIC_MODEL_CLIENT_LEVEL) 
 
 #define ENABLE_GENERIC_MODEL_CLIENT
#endif
 
#if defined (ENABLE_LIGHT_MODEL_CLIENT_LIGHTNESS)
         
 #define ENABLE_LIGHT_MODEL_CLIENT
#endif
 
#if defined (ENABLE_GENERIC_MODEL_SERVER_ONOFF) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LEVEL) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_BATTERY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LOCATION) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LOCATION_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_ADMIN_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_MANUFACTURER_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_USER_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_CLIENT_PROPERTY) \
    && !defined (ENABLE_GENERIC_MODEL_SERVER)
 #define ENABLE_GENERIC_MODEL_SERVER                                         (1)   //here
#endif      
 
#if defined (ENABLE_GENERIC_MODEL_SERVER_ONOFF) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LEVEL) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_ONOFF_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_DEFAULT_TRANSITION_TIME) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_POWER_LEVEL_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_BATTERY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LOCATION) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_LOCATION_SETUP) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_ADMIN_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_MANUFACTURER_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_USER_PROPERTY) \
    || defined (ENABLE_GENERIC_MODEL_SERVER_CLIENT_PROPERTY) \
    && !defined (GENERIC_SERVER_MODEL_ADD_CONFIGURATION)
 #define GENERIC_SERVER_MODEL_ADD_CONFIGURATION                              (1)  //here
      
#endif

I think bitmap of 3 bits occurred here also.

I'm waiting for your valuable reply.

EMECH
ST Employee

​Hi,

According the mesh_usr_cfg.h  configuration in the previous post:

/******************************************************************************

*** Following section helps to select right configuration of Models                                 *******

/******************************************************************************/

/**********************************************************/

/* Define the following Macros to enable the usage of the                    */

/* Server Generic Models                                                                             */

/* Definition is a bitmap of 3 bits: bit 2 element 3                                    */

/*                                  bit 1 element 2                                                          */

/*                                  bit 0 element 1                                                         */

/* Example: 6 means Model enabled in element 2 and 3                        */

/**********************************************************/

#define ENABLE_GENERIC_MODEL_SERVER_ONOFF                                 (5) //element 1 + element 3

#define ENABLE_GENERIC_MODEL_SERVER_LEVEL                                   (1)

/*******************************************************************************

*** Following section helps to configure the Application of Mesh                                   ********

*******************************************************************************/

#define APPLICATION_NUMBER_OF_ELEMENTS                                        2

The Generic OnOff server Model is set on element 1 and element 3, that suppose a total of 3 elements !

So APPLICATION_NUMBER_OF_ELEMENTS have to be set to 3. 

Let me know if it is better with this setting ?

Best regards.

AC.3
Associate III

Hi EMECH ,

Thanks for your reply.

I set the APPLICATION_NUMBER_OF_ELEMENTS to 3 as you mentioned above, but it doesn't worked. The BLE Mesh App waited in Loading Device Composition Data.... stage After provisioning the node. Mesh App returning to main window without configuring the elements, I tried a lot of times but I can not configure the elements.

 0693W000004GvnhQAC.png

0693W000004Gvo6QAC.png0693W000004GvoBQAS.png

0693W000004GvoaQAC.png0693W000004GvofQAC.png

Also I want to increment the number of elements per node to 6,please give me a suggestion .

I could not find any document about this.

EMECH
ST Employee

​Hi,

With the following configuration:

#define ENABLE_GENERIC_MODEL_SERVER_ONOFF                                 (5) //element 1 + element 3

#define ENABLE_GENERIC_MODEL_SERVER_LEVEL                                   (1)

There is no model on the second element, empty element can be a trouble during provisioning.

If you want to set this kind of configuration, try to set:

#define ENABLE_GENERIC_MODEL_SERVER_ONOFF                                 (3) //element 1 + element 2

#define ENABLE_GENERIC_MODEL_SERVER_LEVEL                                   (1)

With:

#define APPLICATION_NUMBER_OF_ELEMENTS                                        2

But initially I have seen that you want to set the following configuration as you have written:

"I am using 3 elements per node, Element1 I am using to control a light, Element2 for to control a fan and Element3 for to control an AC or a TV.

So I want to run generic onoff server model in Element 1, generic onoff server and generic level server models in Element 2 and generic onoff server model in Element 3.

Is that possible??"

Yes it is possible with the following configuration:

#define ENABLE_GENERIC_MODEL_SERVER_ONOFF                                 (7) //element 1 + element 2 + element 3

#define ENABLE_GENERIC_MODEL_SERVER_LEVEL                                   (2) //element 2

And:

#define APPLICATION_NUMBER_OF_ELEMENTS                                        3

Let me know if the provisioning is OK with the above configurations.

The maximum number of elements with the MESH library binary embedded in the cubeWB FW package V1.8 is 3 with a maximum number of models per element of 20.

It is possible to have more elements with a new MESH library binary.

Best regards.