<?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>Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42506/proxy-server-publish-issue</link><description>Based on Mesh SDK 2.1.1. 
 I use light switch proxy client &amp;amp; proxy server to test server publish function. 
 But when I use the phone setting network, I found that the client&amp;#39;s publish &amp;amp; subscribe settings, the server&amp;#39;s publish function can be used correctly</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jan 2019 12:36:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42506/proxy-server-publish-issue" /><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/168210?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 12:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:149edc2f-7459-4716-9bc4-e77fda458336</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;You are correct. From reading the mesh spec, it does seem that you are able to publish a status message to a group address:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-88a0a34208c845f0ab7d2c7a04ceeb7b/pastedimage1548678946927v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;However, the way the generic on off server model on the server is configured, it will send the status message back to the client.&lt;/p&gt;
&lt;p&gt;The main difference between the two functions is that the client generic on off model sends a set message, whereas the server generic on off model sends a status message.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/167267?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 07:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1733037-2f0f-4999-8f47-cd289814f73c</guid><dc:creator>QK-Huang</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/bjorn-kvaale"&gt;Bjørn Kvaale&lt;/a&gt; Tanks your answer. I have a question.&lt;/p&gt;
&lt;p&gt;In simple_on_off_client.c&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t simple_on_off_client_set_unreliable(simple_on_off_client_t * p_client, bool on_off, uint8_t repeats)
{
    simple_on_off_msg_set_unreliable_t set_unreliable;
    set_unreliable.on_off = on_off ? 1 : 0;
    set_unreliable.tid = m_tid++;

    access_message_tx_t message;
    message.opcode.opcode = SIMPLE_ON_OFF_OPCODE_SET_UNRELIABLE;
    message.opcode.company_id = SIMPLE_ON_OFF_COMPANY_ID;
    message.p_buffer = (const uint8_t*) &amp;amp;set_unreliable;
    message.length = sizeof(set_unreliable);
    message.force_segmented = false;
    message.transmic_size = NRF_MESH_TRANSMIC_SIZE_DEFAULT;

    uint32_t status = NRF_SUCCESS;
    for (uint8_t i = 0; i &amp;lt; repeats; ++i)
    {
        message.access_token = nrf_mesh_unique_token_get();
        status = access_model_publish(p_client-&amp;gt;model_handle, &amp;amp;message);
        if (status != NRF_SUCCESS)
        {
            break;
        }
    }
    return status;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;this function use access_model_publish() to publish data to the server.&lt;/p&gt;
&lt;p&gt;In simple_on_off_server.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t simple_on_off_server_status_publish(simple_on_off_server_t * p_server, bool value)
{
    simple_on_off_msg_status_t status;
    status.present_on_off = value ? 1 : 0;
    access_message_tx_t msg;
    msg.opcode.opcode = SIMPLE_ON_OFF_OPCODE_STATUS;
    msg.opcode.company_id = SIMPLE_ON_OFF_COMPANY_ID;
    msg.p_buffer = (const uint8_t *) &amp;amp;status;
    msg.length = sizeof(status);
    msg.force_segmented = false;
    msg.transmic_size = NRF_MESH_TRANSMIC_SIZE_DEFAULT;
    msg.access_token = nrf_mesh_unique_token_get();
    return access_model_publish(p_server-&amp;gt;model_handle, &amp;amp;msg);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;this function also use access_model_publish() to publish data to the client.&lt;/p&gt;
&lt;p&gt;Both function are use access_model_publish(). Why the&amp;nbsp; former can publish unicast or group address, the latter only publish unicast address?&lt;/p&gt;
&lt;p&gt;What is the difference between the two function?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/167093?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 12:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71536546-8d86-4475-91d8-58e95a596f1f</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>[quote user="Defk"]Why U say test &amp;amp; try to make client publish to the server address?[/quote]
&lt;p&gt;&amp;nbsp;Because I thought you just wanted to send a status message from the server back to the client.&lt;/p&gt;
&lt;p&gt;The reason the publishing from the server to the group address 0xC100 &amp;amp; subscribing to the group address from the client does not work is two-fold: firstly, when you press button 1 on the server, you are calling this code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void button_event_handler(uint32_t button_number)
{
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Button %u pressed\n&amp;quot;, button_number);
    switch (button_number)
    {
        /* Pressing SW1 on the Development Kit will result in LED state to toggle and trigger
        the STATUS message to inform client about the state change. This is a demonstration of
        state change publication due to local event. */
        case 0:
        {
            uint8_t value = !hal_led_pin_get(LED_PIN_NUMBER);
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;User action \n&amp;quot;);
            hal_led_pin_set(LED_PIN_NUMBER, value);
            (void)simple_on_off_server_status_publish(&amp;amp;m_server, value);
            break;
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This code is only setting a server status publish, aka a status message. I am not exactly sure on this, but I believe a status message can only be sent to a unicast address.&amp;nbsp;I believe the reason your scenario one worked to send the status message back to the client from the server was because the client was publishing directly to the unicast address of the server.&lt;/p&gt;
&lt;p&gt;In order to publish from the server to a group address &amp;amp; let the client subscribe to this group address, you will need to add the simple on off server model to the client &amp;amp; add the simple on off client model to the server. That way, both boards will act as both clients &amp;amp; servers.&lt;/p&gt;
&lt;p&gt;You can do something similar to what has been done &lt;a href="https://github.com/NordicPlayground/nrf52-mesh-light-switch-client-server-proxy"&gt;here&lt;/a&gt;. I would not recommend you to use that source code directly, as it has not been tested as extensively as the mesh sdk.&lt;/p&gt;
&lt;p&gt;Also, if you notice that you are having issues with provisioning &amp;amp; configuring nodes via nRF Mesh, I would suggest you to migrate from mesh sdk v2.1.1 to mesh sdk v2.2.0. This version has more stable support for nRF Mesh. I would also make sure that you are using the latest version of nRF Mesh. We do have a migration guide here if you decide to download the mesh sdk v2.2.0 here:&amp;nbsp;nrf5_SDK_for_Mesh_v2.2.0_src\doc\migration\&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/166629?ContentTypeID=1</link><pubDate>Sat, 19 Jan 2019 08:09:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc51180b-2aba-4aa8-a678-907aac5ac4b2</guid><dc:creator>QK-Huang</dc:creator><description>&lt;p&gt;Why U say test &amp;amp; try to make client publish to the server address?&lt;/p&gt;
&lt;p&gt;I have already test client publish to the unicast address of the server node,and client publish to the group address of the server node,too.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But, I want server publish to the client.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7215._F764D653_.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/166455?ContentTypeID=1</link><pubDate>Fri, 18 Jan 2019 12:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1b8e7c7-b578-41bc-bcc2-aa56fb3e0931</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;I am pretty sure the reason that left figure + figure works is because the client publishes to the unicast address of the simple on off server (0x0004). Then, you are able to send status updates from the server to the client. Could you test &amp;amp; just try to make the client publishes to the simple on off server address? Please test without publishing &amp;amp; subscribing to the group addresses 0xC100 &amp;amp; 0xC200.&amp;nbsp;Does that procedure work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/165747?ContentTypeID=1</link><pubDate>Tue, 15 Jan 2019 13:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a6b5552-7581-4d5d-b084-d0c56499af03</guid><dc:creator>QK-Huang</dc:creator><description>&lt;p&gt;No, this is simple on off model.&lt;/p&gt;
&lt;p&gt;I want&amp;nbsp; server publish and client subscribe.&lt;/p&gt;
&lt;p&gt;left figure + figure : Server publish and client subscribe =&amp;gt; OK&lt;/p&gt;
&lt;p&gt;right figure + figure :&amp;nbsp;&lt;span&gt;Server publish and client subscribe =&amp;gt; Not OK&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy Server Publish Issue</title><link>https://devzone.nordicsemi.com/thread/165734?ContentTypeID=1</link><pubDate>Tue, 15 Jan 2019 12:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de227ba4-4a52-4c67-8a21-a28d9ea920f0</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Are you saying that if you set the client&amp;#39;s generic on off model publish function to e.g. 0xC001 &amp;amp; set the server&amp;#39;s generic on off model subscribe function to 0xC001, then you are able to send the status message from the server to the client by pressing Button 1 on the server?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe this is the only way to send the status message from the server to the client, as you are not publishing a message from the server to the client. You are only sending a status message telling the client what the LED 1 state is of the server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>