<?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>Sending messages from client to different LPNs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60159/sending-messages-from-client-to-different-lpns</link><description>Hi, 
 I&amp;#39;m using the light switch example and lpn example from the Mesh SDK 4.1.0. 
 I have one Board as the light switch client (gateway), one as the light switch server (FN) and one lpn. 
 Provisioning is done with the Mesh app for android. 
 
 the lpn</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Apr 2020 08:19:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60159/sending-messages-from-client-to-different-lpns" /><item><title>RE: Sending messages from client to different LPNs</title><link>https://devzone.nordicsemi.com/thread/246171?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 08:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f0a0b86-a6bb-46c7-a4c5-d86ab8ae1de0</guid><dc:creator>BroccLee</dc:creator><description>&lt;p&gt;After putting some __LOG lines in the change_publication_address() function i see that ist the line&amp;nbsp;&lt;strong&gt;status = dsm_address_publish_add(destination_address, &amp;amp;publish_address_handle);&amp;nbsp;&amp;nbsp;&lt;/strong&gt;that causes the error.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(access_model_publish_address_get(handle, &amp;amp;publish_address_handle) == NRF_SUCCESS)      
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;1\n&amp;quot;);
        status = dsm_address_publish_add(destination_address, &amp;amp;publish_address_handle);  
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;adding new publication address1\n&amp;quot;);
    } &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On the console, I see the &amp;quot;1&amp;quot; as output and then comes the error:&amp;nbsp;app_error_weak.c,&amp;nbsp; 105, Mesh assert at 0x00031B0C (:0). I don&amp;#39;t see the message&amp;nbsp;&amp;quot;adding new publication address1&amp;quot;.&lt;/p&gt;
&lt;p&gt;Can i not pass the handle and address as&amp;nbsp;&lt;strong&gt;change_publication_address(m_clients[0].model_handle, 0002);&lt;/strong&gt; ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending messages from client to different LPNs</title><link>https://devzone.nordicsemi.com/thread/245840?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 12:58:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9b3c0fe-4321-4ada-80a4-e652112ff631</guid><dc:creator>BroccLee</dc:creator><description>&lt;p&gt;Hi Joakim&lt;/p&gt;
&lt;p&gt;Thanks for the reply. I am now trying to send a message from my gateway to a specific (server)Node. I have two server nodes with addresses 0x0002 and 0x0003. i want to send the onoff switch command to 0x0002 and leave 0x0003 as it is. However, I have problems changing the publication address.&lt;/p&gt;
&lt;p&gt;This is my code for changing the publication address:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void change_publication_address(access_model_handle_t handle, uint16_t address)
{
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Change Publication address\n&amp;quot;);
    uint32_t status = NRF_SUCCESS;  
    nrf_mesh_address_t publish_address_stored;
    destination_address = address;
    
    if(publish_address_handle != DSM_HANDLE_INVALID)
    {
        NRF_MESH_ASSERT(dsm_address_publish_remove(publish_address_handle) == NRF_SUCCESS);
    }

    if(access_model_publish_address_get(handle, &amp;amp;publish_address_handle) == NRF_SUCCESS)      
    {
        status = dsm_address_publish_add(destination_address, &amp;amp;publish_address_handle);       // add destination address        
    }   
    else
    {
        if(dsm_address_get(publish_address_handle, &amp;amp;publish_address_stored) == NRF_SUCCESS)
        {
            if((publish_address_stored.type == NRF_MESH_ADDRESS_TYPE_VIRTUAL)||(publish_address_stored.type != NRF_MESH_ADDRESS_TYPE_VIRTUAL &amp;amp;&amp;amp; publish_address_stored.value != destination_address))
            {
                NRF_MESH_ASSERT(dsm_address_publish_remove(publish_address_handle) == NRF_SUCCESS);
                status = dsm_address_publish_add(destination_address, &amp;amp;publish_address_handle);
            }
            else
            {
                // use the retrieved publish_address_handle
            }
        }
        else
        {
            status = dsm_address_publish_remove(publish_address_handle);
            status = dsm_address_publish_add(destination_address, &amp;amp;publish_address_handle);
        }
    }

    switch(status)
    {
        case NRF_ERROR_NO_MEM:
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;NRF_ERROR_NO_MEM\n&amp;quot;);
            return;
        case NRF_SUCCESS:
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;NRF_SUCCESS\n&amp;quot;);
            break;
        default:
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Not defined ERROR\n&amp;quot;);
            return;
    }
    NRF_MESH_ASSERT(access_model_publish_address_set(handle, publish_address_handle) == NRF_SUCCESS);  // change the address
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I call&amp;nbsp; &lt;strong&gt;change_publication_address(m_clients[0].model_handle, 0002); &lt;/strong&gt; on the gateway,&amp;nbsp;all the LEDs on the server DK go on and i get the error&amp;nbsp;&amp;nbsp;&lt;strong&gt;app_error_weak.c,&amp;nbsp; 105, Mesh assert at 0x000275CC (:0)&amp;nbsp;&lt;/strong&gt;in the RTT Viewer.&lt;/p&gt;
&lt;p&gt;The error occurs because of the line&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NRF_MESH_ASSERT(access_model_publish_address_set(handle, publish_address_handle) == NRF_SUCCESS);&amp;nbsp;&lt;/strong&gt;which is at the bottom of my&amp;nbsp;change_publication_address() function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The funny thing is, when I reset the gateway (reset button on DK), I see that the address&amp;nbsp;was changed correctly and I am sending data to 0x0002 only. Can you help me with this?&lt;/p&gt;
&lt;p&gt;I link my main file in case it might help.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/38807.main.c"&gt;devzone.nordicsemi.com/.../38807.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending messages from client to different LPNs</title><link>https://devzone.nordicsemi.com/thread/245387?ContentTypeID=1</link><pubDate>Sun, 19 Apr 2020 23:35:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b2c07b8-0e15-43c7-b67c-e8a7495b389f</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;If you want this to happen after each poll complete event, I guess this should be fine.&lt;/p&gt;
&lt;p&gt;I also want to comment on a few questions from your original question; &lt;br /&gt;If you publish a message to a group address, this will be received and processes by each node subscribing to that group address. If you want to send a message to a specific node, you should use the unicast address for the node instead.&lt;/p&gt;
&lt;p&gt;We have a section in our online documentation about &lt;span&gt;&lt;a title="Creating new models" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.0.0/md_doc_libraries_how_to_models.html?cp=7_6_0_2_3_0"&gt;Creating new models&lt;/a&gt;&lt;/span&gt;. &lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending messages from client to different LPNs</title><link>https://devzone.nordicsemi.com/thread/245151?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 08:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50f495ec-8998-40bd-a41c-4195328687de</guid><dc:creator>BroccLee</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1587111103299v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is how I implemented it right now and it seems to work. I used the the lpn and lightswitch examples and added a functionality to the lightswitch client and lpn example. Now i can send and receive from gateway(lightswitch client) and lpn.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m not sure if the lowpower functionality of the LPN is still working as intended now. I added the line&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case NRF_MESH_EVT_LPN_FRIEND_POLL_COMPLETE:
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Friend poll procedure complete\n&amp;quot;);
            app_onoff_status_publish(&amp;amp;m_onoff_server_0); // I added this
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in the main.c of the lpn example inside the&amp;nbsp;app_mesh_core_event_cb, so it updates the LEDs when it polls.&lt;/p&gt;
&lt;p&gt;Does this make sense? Is this how it&amp;#39;s supposed to wirk?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>