Controlling Servers using unicast address

Hi everyone, I am looking into controlling servers using light_lightness server in 17.0.2 

As far as I know, you can control the the publishing from client side by changing publishing address to the specific unicast address.  Since I want to control quite a number of servers, having too many elements in the NRF mesh app is not possible due to composition data size restrictions. Hence, using unicast address to control individual servers will be an alternative. 

What I would like to know is that if its possible to send commands via J-link to control specific servers using their unicast address instead? The process of changing unicast address on nrf mesh app can be quite troublesome as you would have to keep changing it. 

I am aware that you can subscribe the servers into an element so you can control them all at once. But is it possible to control them individually despite being in the same group? For instance, using unicast address on J-link as a command and not changing unicast address on the nrf mesh app. If its possible, how should I go about achieving this?

Thanks for your help in advance! 

Parents
  • Hey Kyle! Sorry about the delay.

    I will have to get back to you on this. Unfortunately, due to the holidays you might have to expect both limited help and slower responses on DevZone.

    Best regards,

    Elfving

  • Hello again!

    Since I want to control quite a number of servers, having too many elements in the NRF mesh app is not possible due to composition data size restrictions.

    Would you mind expanding a bit on how you see this restriction in the app? The composition data size restrictions should restrict the amount of elements on a node, didn't think it also restricted the amount of elements registered on the app.

    control specific servers using their unicast address instead? The process of changing unicast address on nrf mesh app can be quite troublesome as you would have to keep changing it. 

    Have you considered using virtual addresses? You dont have to always use unicast.

    I am aware that you can subscribe the servers into an element so you can control them all at once. But is it possible to control them individually despite being in the same group?

    I believe you might have misunderstood how that works.. or maybe I am misunderstanding you. Nodes contain elements which contain models which contain states. That is simply the hierarchy it uses, no matter how you configure it. Think of nodes as a physical entity. The element simply has an address, and passes the message on to the model that uses it. How the server handles the message is up to the server, and you can modify that as you please.

    For instance, using unicast address on J-link as a command and not changing unicast address on the nrf mesh app. If its possible, how should I go about achieving this?

    If you want to automate some of the messages and respond to commands using the terminal, then I would recommend having a look at the Mesh Chat example and see how that is implemented. Maybe use that as a starting point.

    Best regards,

    Elfving

  • Hi! Thanks for the reply! 

    Would you mind expanding a bit on how you see this restriction in the app? The composition data size restrictions should restrict the amount of elements on a node, didn't think it also restricted the amount of elements registered on the app.

    Sure. As of now, the maximum number of elements that I have managed to get is 44 (modified in nrf_mesh_config_app). Anything above 44 and the node is unable to be provisioned. I have found out that the composition data should not exceed the access_message_length_max which is 380. Is it possible to properly increase this number so that I could have more elements? I have tried changing from 380 to a larger number and the code did not produce any error, but despite this the node could not be provisioned when I tried to configure it in the nRF Mesh app. If this number can be increased then the composition data size would not exceed the access_message_length_max.

    Have you considered using virtual addresses? You dont have to always use unicast.

    What do you mean by using virtual addresses? Can the virtual address be used to control the lights on the terminal?

    I believe you might have misunderstood how that works.. or maybe I am misunderstanding you. Nodes contain elements which contain models which contain states. That is simply the hierarchy it uses, no matter how you configure it. Think of nodes as a physical entity. The element simply has an address, and passes the message on to the model that uses it. How the server handles the message is up to the server, and you can modify that as you please.

    Regarding this. Yes I am aware about the hierarchy. Lets say I have 2 servers and I subscribe them to a model under the same element in Light lightness client. This means that in the J-link, if I were to send a command that corresponds to that element to activate the lights, both servers will receive the command. What I hope to achieve is that the 2 servers can be controlled individually even though they are subscribed in the same element. I know that the easier way would be to place these 2 servers in separate models under separate elements. However, as I am facing the issue of the composition data size, I am unable to get more than 44 elements. 

    Therefore, I was thinking that if increasing the number of elements is not possible, then controlling servers individually (even in the same model under the same element) would be the alternative to my problem.

  • Hi, just an update

    I managed to increase the element count to 60. I commented out the NRF_MESH_STATIC_ASSERT in config_server.c for the composition data size. However, I am unable to go above 60 when trying to provision the client. The code is able to build and run, but when configuring the client, it gets stuck at 'sending composition data get'

  • Hello Kyle!

    kyle goldsteins said:
    Anything above 44 and the node is unable to be provisioned. I have found out that the composition data should not exceed the access_message_length_max which is 380

    Yes, now it seems that we are on the same page. I thought you were dealing with a 44th node, but all of these elements are in fact on the same node that you are struggling with provisioning?

    Due to the max transport PDU size of 350 octets, the node is limited by the composition data size restrictions. This has little to do with the provisioner and the app itself though.

    Out of this possible 380, 10 bytes are taken by some meta data. Then, each element consumes 4 bytes and 2 octets per SIG model and 4 octets per Vendor model. If you have 1 element with just SIG models, it gives you a maximum of 183 models. As you are left with 44 elements I assume you have 2 models per element.

    kyle goldsteins said:
    Is it possible to properly increase this number so that I could have more elements?

    No, that would go against the Mesh spec. The list of elements and their models is sent as Composition Page 0, and this has to be a single message.

    kyle goldsteins said:
    What do you mean by using virtual addresses? Can the virtual address be used to control the lights on the terminal?

    Sorry, I meant group addresses. Though there are unicast addresses, virtual addresses and group addresses. Each node has a unicast address, the virtual addresses use a UUID to I identify a node (independent of configuration in network), and the group addresses are configurable to include several elements. If you wanted to include several elements in one address then a group address might be what you are looking for.

    kyle goldsteins said:
    What I hope to achieve is that the 2 servers can be controlled individually even though they are subscribed in the same element. I know that the easier way would be to place these 2 servers in separate models under separate elements.

    This issue is referred to as "model overlap". According to the spec: "An element is not allowed to contain multiple instances of models that use the same message in the same way (for example, receive an “On” message)". To fix it put the other model in another element. There is no other way that is according to the spec.

    To summarize everything, you should get more nodes in your network to handle all your models and elements. Though could you expand a bit on why would need all these elements?

    Best regards,

    Elfving

  • Hi Elfving!

    but all of these elements are in fact on the same node that you are struggling with provisioning?

    Yes that is correct!

    As you are left with 44 elements I assume you have 2 models per element.

    I have checked on the nRF mesh app. Currently, there is only one model per element called 'Light Lightness Client'.

    Though could you expand a bit on why would need all these elements?

    This is because I am looking at controlling the servers individually from the client node. Group addresses isn't what I am looking for as that would mean one command would be sent to all the servers.. Hence, it would be most ideal if I was able to have more elements so that I can control more servers individually.

    I have managed to increase the number of elements to 60 in my previous reply, please take a look at it and let me know how to solve the ' sending composition data get' issue if its possible

    Best regards,

    Kyle

Reply
  • Hi Elfving!

    but all of these elements are in fact on the same node that you are struggling with provisioning?

    Yes that is correct!

    As you are left with 44 elements I assume you have 2 models per element.

    I have checked on the nRF mesh app. Currently, there is only one model per element called 'Light Lightness Client'.

    Though could you expand a bit on why would need all these elements?

    This is because I am looking at controlling the servers individually from the client node. Group addresses isn't what I am looking for as that would mean one command would be sent to all the servers.. Hence, it would be most ideal if I was able to have more elements so that I can control more servers individually.

    I have managed to increase the number of elements to 60 in my previous reply, please take a look at it and let me know how to solve the ' sending composition data get' issue if its possible

    Best regards,

    Kyle

Children
  • Hey Kyle,

    kyle goldsteins said:

    This is because I am looking at controlling the servers individually from the client node.

    You should already be able to do that as long as all the models are different/ handle different messages. So the questions is why you would need this many models of the same kind on the same node?

    A typical situation where this is considered, is if you are making a lamp with multiple physical bulbs/LEDs. Then you might want as many elements as physical bulbs, since you want to control them independently. Needing more than 44 of them however is a bit surprising.

    Best regards,

    Elfving

  • Hi Elfving,

    What I plan on doing is implement a lighting system on a small scale building (about 100 lights) using the client/server system.

    Then you might want as many elements as physical bulbs, since you want to control them independently.

    Yes, I want to be able to control these lights individually so the number of elements would be the same as the number of physical light bulbs. In this case, that would mean 100 physical light bulbs for my system.

    Best regards,

    Kyle

  • Hello Kyle,

    kyle goldsteins said:
    What I plan on doing is implement a lighting system on a small scale building (about 100 lights) using the client/server system.

    Sounds great!

    In that case I assume the 100 lights would be somewhat spread out physically, and be different nodes. You might even only need one element per node, and maybe two servers. That would be far less than what the composition data size restrictions are limiting you to (the restrictions only count for one node). Additionally the light servers would all be on different elements, so they are controllable individually (each node has its own elements).

    Does that sound like a plan, or do you need all the lights to be on the same node?

    Best regards,

    Elfving

  • Hi Elfving,

    Thank you for your suggestion! However, what I am looking at is for all the lights to be on the same node? Any idea for this?

    Best Regards,

    Kyle

  • Hey Kyle,

    I am still having trouble understanding why you would want this, but at least now I know this actually is what you want.

    kyle goldsteins said:
    Any idea for this?

    No. This will go against the composition data size restrictions of the node, and the Mesh spec. For more info on why this is a restriction you can take a look at section 3.6.2.1 in the Mesh Profile spec.

    You could create a proprietary Mesh solution however, and go against the spec. This isn't something I can recommend however, and it will probably result in even more issues for you. If this is what you want to do, then I wouldn't rely too much on the examples and such however - as breaking the composition data size restrictions won't be the only massive change you're going to make.

    Though if you want all the models to be on the same node, I assume the Bluetooth part of Mesh isn't that important to you?

    Best regards,

    Elfving

Related