This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to deal with a variable number of elements?

Hi,

as I know from the mesh spec, the number of elements cannot change after a device was provisioned. Nordic even went so far as to define the number of elements during compile time. I have now done a lot of research but could nowhere find an answer to this question.

Now, let's say that I want to create firmware for a DALI controller. By design, the controller will not know how many light bulbs are attached without enumerating them first. The user could also decide to add / remove the bulbs at any time and re-enumerate them.

What is the best and most standard way to deal with a situation like this? I see two options:

- During provisioning, enumerate the DALI devices and generate the appropriate number of elements before the provisioning is done. In order to do another DALI search, the device must do another search and must afterwards be reprovisioned.

- Provide the maximum number of elements at all times and figure out some (non-standard?) way to tell the user which lightbulbs are currently available and which are not. This would be a bit weird if the device is e.g. a DMX device with support for up to 512 lightbulbs.

Thanks,

Marius

Parents
  • Hi,

    This is the response from our team:

    Having a variable number of elements in a node is not compatible with Mesh Specification v1. Further, the stack does not seamlessly support a dynamic change of device composition data. Even if it could be made possible somehow, having such a node that can instantly change its composition after provisioning can be detrimental for the entire network and can cause functionality breakdown in the network. 

    I can think of following way in which customer's requirement can be satisfied while still observing Mesh Profile and Mesh stack restrictions:

    • Pre-allocate a sufficient number of elements, model instances, the total number of virtual/non-virtual addresses, total number of subscription lists, app keys and net keys.  
    • Then, in an unprovisioned state, when such a mesh device is connected to the DALI bus for the first time this device can enumerate DALI devices and store this information (say, for example, the number of lights present on the bus) in flash as a user application information.
    • Based on this information, necessary models can be initialized in the model_init_cb() of the main application. You, as a manufacturer of this device, can define the point of frozen composition as - enumeration of DALI devices by the mesh device in an unprovisioned state. If the end-user needs to change the number of attached DALI devices, then he can unprovision the mesh device first, change the number of devices and then re-provision the mesh device. 
    • The only pitfall of this method would be, having to bear with empty elements on the device. But this looks like it is unavoidable. 
  • Hi, thank you. This is one possibility. I wonder why there are no guidelines for that as I expect that different vendors will use a different approach.

    However, there is one crucial problem: For DALI devices, there are typically different search modes that can be triggered (Find only new, Clear and Search, ....). How would the user be able to trigger a search on the device, if it is not provisioned? It looks like it would need to be provisioned, then the search could be started, then it has to be unprovisioned so that the number of elements can be changed. Finally, it has to be provisioned again.

    Is there a better possibility?

Reply
  • Hi, thank you. This is one possibility. I wonder why there are no guidelines for that as I expect that different vendors will use a different approach.

    However, there is one crucial problem: For DALI devices, there are typically different search modes that can be triggered (Find only new, Clear and Search, ....). How would the user be able to trigger a search on the device, if it is not provisioned? It looks like it would need to be provisioned, then the search could be started, then it has to be unprovisioned so that the number of elements can be changed. Finally, it has to be provisioned again.

    Is there a better possibility?

Children
No Data
Related