<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91850/how-to-address-2-different-elements-of-the-same-node-at-the-same-time</link><description>Hi, 
 I am trying to create 2 elements with the same vendor model implemented. 
 My vendor model enables to switch on a pwm_led at a particular power during a given time. I have defined 2 pwm led on my dev kit (nrf52840 devkit) and I defined a vendor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Sep 2022 13:44:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91850/how-to-address-2-different-elements-of-the-same-node-at-the-same-time" /><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/386676?ContentTypeID=1</link><pubDate>Fri, 16 Sep 2022 13:44:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92143ea6-27e7-4568-9587-6bc4a199cb40</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello again Maureen,&lt;/p&gt;
&lt;p&gt;This is odd. So at this point you have completely removed all the extra loops and functionality and that you mentioned to make sure the message arrives in the right element, right? All of that is handled by the stack.&lt;/p&gt;
[quote user="lalum"]Using the unicast address of the node : the two elements receive the message[/quote]
&lt;p&gt;I believe you mentioned earlier that both of the elements are able to be turned on individually using their unicast addresses. But now it seems that when you send a message to just the primary element of the node (the same as the unicast address of the node) its recieved by both elements? Then somethings changed. Did this change happen after you removed that extra functionality you added?&lt;/p&gt;
[quote user="lalum"]Using a group address&lt;span lang="en"&gt;&lt;span&gt;&lt;span&gt; to which both elements are subscribed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; : only the primary element receive the message[/quote]
&lt;p&gt;Could you tell me what this group address is? Is it the same as the &amp;#39;all nodes&amp;#39; group?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/386418?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 13:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66adf192-ab07-47e5-9c79-0cdfe6cbb1e6</guid><dc:creator>lalum</dc:creator><description>&lt;p&gt;Hello Elfving,&lt;/p&gt;
&lt;p&gt;thank you for your reply !&lt;br /&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span class="Q4iAWc"&gt;here is what i tried and the results&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using the unicast address of the node : the two elements receive the message&lt;/li&gt;
&lt;li&gt;Using a group address&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span class="Q4iAWc"&gt; to which both elements are subscribed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; : only the primary element receive the message&lt;/li&gt;
&lt;li&gt;Using a group address to which only one element is subscribed : the corresponding element receive the message (it works for the two elements)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So I don&amp;#39;t understand why my second element doesn&amp;#39;t receive the message when I use the same group address for the 2 elements as you say it&amp;#39;s managed by the stack...&lt;/p&gt;
&lt;p&gt;I wonder where I can define the element address ? I don&amp;#39;t see anything in the nrf mesh app to do this, I can only configure the node address...&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Maureen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/386169?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 12:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f6abcf-a725-4cb8-9d88-687f448b7142</guid><dc:creator>Elfving</dc:creator><description>[quote user="lalum"]&lt;p&gt;I hope it&amp;#39;s more clear for you ... sorry for my poor level in english&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;No problem at all :) as long as we understand each other in the end.&lt;/p&gt;
[quote user="lalum"]But, when I send a message with the group address as the destination, only the primary element receive the message and is switched on.[/quote]
&lt;p&gt;Okay. And you&amp;#39;ve remembered to make both of the elements subscribe to the group address? Does removing the subscription from the primary element make a difference?&lt;/p&gt;
[quote user="lalum"] I check the subscription list of my elements when I receive a message for a group. As my primary element is the only one that receive the message when the message is a message for a group, I have to check for all the other element if they subscribe to the group address too. If yes I update their state too.[/quote]
&lt;p&gt;I see. This should normally be automatically handled by the stack, so there should be no need for this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/386148?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 11:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24d6fd08-82b0-4787-83ad-d88ba953f1f7</guid><dc:creator>lalum</dc:creator><description>&lt;p&gt;Hi Elfving,&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t understand my problem so I&amp;#39;m going to try to be more clear...&lt;/p&gt;
&lt;p&gt;I have one node with 2 elements (my node is a nrf52840 DK and I have two leds that I consider as two different elements).&lt;/p&gt;
&lt;p&gt;Each led is linked to a custom model with a state &amp;quot;Timer&amp;quot; and a state &amp;quot;lightness&amp;quot;. When I send a &amp;quot;SET&amp;quot; message to one element, the corresponding led is switched on at the given lightness during the given timer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can switch on the two led by sending a message with unicast address, no problem for this. But I want to be able to switch on the two led at the same time. So I&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="fr" data-phrase-index="0" data-number-of-phrases="1"&gt;&lt;span class="Q4iAWc"&gt; subscribed my two LEDs to a group address. But, when I send a message with the group address as the destination, only the primary element receive the message and is switched on. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="103347" url="~/f/nordic-q-a/91850/how-to-address-2-different-elements-of-the-same-node-at-the-same-time/386132"]Could you expand on this?&amp;nbsp;The elements are individually addressable, you don&amp;#39;t have to pretend they are nodes.&amp;nbsp;[/quote]
&lt;p&gt;Yes I know, I can address my elements individually, no problem with that. My problem is that when two elements of the same node subscribe to the same group address, only the primary element receive the message when I use the group address as destination.&lt;/p&gt;
[quote userid="103347" url="~/f/nordic-q-a/91850/how-to-address-2-different-elements-of-the-same-node-at-the-same-time/386132"]Are you saying that before sending the message to the address you want, you check an internal list of &amp;#39;subscribed elements&amp;#39; to see if it is indeed subscribed to this?[/quote]
&lt;p&gt;No. I check the subscription list of my elements when I receive a message for a group. As my primary element is the only one that receive the message when the message is a message for a group, I have to check for all the other element if they subscribe to the group address too. If yes I update their state too.&lt;/p&gt;
&lt;p&gt;I hope it&amp;#39;s more clear for you ... sorry for my poor level in english&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Maureen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/386132?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 10:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b404213-36d8-481d-8c5d-f9a1a7826bf3</guid><dc:creator>Elfving</dc:creator><description>[quote user="lalum"]implemented as if my elements are nodes...[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you expand on this?&amp;nbsp;The elements are individually addressable, you don&amp;#39;t have to pretend they are nodes.&amp;nbsp;&lt;/p&gt;
[quote user="lalum"]my function which handle the message keep the destination address of the message and a loop is looking for this address in the subscription list of all my elements. If this address is in a subscription list, the states of the models which subscription list belongs to are updated. But I wonder if there is a way to automatically do this.[/quote]
&lt;p&gt;Are you saying that before sending the message to the address you want, you check an internal list of &amp;#39;subscribed elements&amp;#39; to see if it is indeed subscribed to this?&lt;/p&gt;
&lt;p&gt;Do you want the message sent to the two elements, which you are already able to do individually, but you want it to be scalable enough to be sent to several elements automatically. If that is the case, I believe the issue could be solved by using a group address for these elements. Have you looked into that option?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/385889?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 09:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e623508-9aab-4303-90be-3a6c62c0c1db</guid><dc:creator>lalum</dc:creator><description>&lt;p&gt;Hello Elfving,&lt;br /&gt;&lt;br /&gt;Yes I agree. &lt;br /&gt;I want to sent the message to all elements that have the vendor server implemented as if my elements are nodes... &lt;/p&gt;
&lt;p&gt;To solve my problem, my function which handle the message keep the destination address of the message and a loop is looking for this address in the subscription list of all my elements. If this address is in a subscription list, the states of the models which subscription list belongs to are updated. But I wonder if there is a way to automatically do this.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Maureen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to address 2 different elements of the same Node at the same time ?</title><link>https://devzone.nordicsemi.com/thread/385884?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 09:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d32a1b-5712-4165-84e7-bcc411631d50</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello Maureen,&lt;/p&gt;
&lt;p&gt;Well that makes sense, as there is only one node here that we are talking about. The nodes &amp;#39;unicast address&amp;#39; is the same as the first element address of the node - so if you send the message &amp;quot;to the node&amp;quot;, it will only be received by the first element.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you need to do is to send the message to all elements, or at least the two elements in question. How are you currently sending it to all nodes?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>