Skip to main content
AC.3
Associate
September 16, 2020
Solved

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

  • September 16, 2020
  • 12 replies
  • 5296 views

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....

This topic has been closed for replies.
Best answer by EMECH

​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.

12 replies

Remi QUINTIN
Technical Moderator
September 17, 2020

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
AC.3Author
Associate
September 18, 2020

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
AC.3Author
Associate
September 18, 2020

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
Technical Moderator
September 21, 2020

​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.

AC.3
AC.3Author
Associate
September 22, 2020

Thanks for your help Remi QUINTIN

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

EMECH
ST Employee
September 24, 2020

​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
AC.3Author
Associate
September 24, 2020

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
September 24, 2020

​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.

AC.3
AC.3Author
Associate
September 25, 2020

Hi EMECH ,

Thanks for helping me.

I changed the configurations as you mentioned,

#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

The provisioning completed successfully, but Couldn't configure the node.

The BLE Mesh app trying to get Device Composition Data(Loading Device Composition Data),but it can't.0693W000004H4wdQAC.png

0693W000004H4vgQAC.png

0693W000004H4xWQAS.png

EMECH
ST Employee
September 25, 2020

​Hi,

I have done the test with success on the cubeWB FW package V1.8 package with an Iphone 8 on IOS 14.0.

What is your environment configuration ?

Best regards.

AC.3
AC.3Author
Associate
September 25, 2020

I'm using STM32Cube_FW_WB_V1.8.0 package with an Android Smartphone(VIVO) with Android 9 version

I'm using BLE_MeshLightingPRFNode project from the package.

I changed only the configurations as you mentioned in mesh_cfg_usr.h file

#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

Is any other changes required in the code??

EMECH
ST Employee
September 25, 2020

​Hi,

OK, the troubles you have with multi element during provisoning with Android ST BLE Mesh App is solved in the next Android ST BLE Mesh App and the STM32Cube_FW_WB_V1.9.0 normally availables at the end of this month.

With the IOS ST BLE Mesh App and the STM32Cube_FW_WB_V1.8.0 you do not have this kind of trouble.

In the meantime, perhaps you can have the opportunity to use the IOS ST BLE Mesh App ?

Best regards.

AC.3
AC.3Author
Associate
September 28, 2020

Hi EMECH,

We tried  IOS ST BLE Mesh App with an Iphone 6s on IOS 14.0  and the STM32Cube_FW_WB_V1.8.0(three elements per node) , but the same problem occurred again. Couldn't configured the node after provisioning.

EMECH
ST Employee
September 28, 2020

​Hi,

OK, as I have written I did not have this trouble with STM32Cube_FW_WB_V1.8.0 and IOS ST BLE Mesh App with an Iphone 8 on IOS 14.0.

Do you have the same trouble during Loading Device Composition Data ?

Did you try to provision many times ?

Best regards

AC.3
AC.3Author
Associate
September 29, 2020

Yes, I  have the same trouble during Loading Device Composition Data, So configuration failed.

I tried a lot of times, but the result was same.

Here is my mesh_usr_cfg.h file.

Would you please suggest me if there any other changes required?

EMECH
ST Employee
October 2, 2020

​Hi,

Please try with the new STM32Cube_FW_WB_V1.9.0 published on https://www.st.com/en/embedded-software/stm32cubewb.html

This release includes a lot of modifications related to the described troubles.

Do not forget to update the BLE stack, see the how to proceed in STM32Cube_FW_WB_V1.9.0/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/Release_Notes.html.

Best regards.

AC.3
AC.3Author
Associate
October 5, 2020

Hi,

Thanks for your help.

It worked successfully with 3 elements per node.

Is there any option to increment the number of elements per node greater than three in STM32Cube_FW_WB_V1.9.0 version??

Why ST always limiting number of elements to 3 even BLE mesh node supports more than 10 elements???