<?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>Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38884/broadcast-mesh-message</link><description>Hi, 
 I&amp;#39;m trying to send a broadcast message from my client to all my server. Actually i&amp;#39;m working over a modifed version of the light switch example. 
 i saw that in the node_setup of the provisioner the server address is set. 
 The easiest thing that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Oct 2018 12:32:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38884/broadcast-mesh-message" /><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/152878?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 12:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:694f37d4-0508-4999-a104-95af5aed94ae</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Cool! Great to hear that you figured it out!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/152727?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 14:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b77f2c8-2f4b-484c-b958-4f619fc53c54</guid><dc:creator>Allen96</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I made this work by making another one from the example. Don&amp;#39;t know what was the error but looks like i fixed it.&lt;/p&gt;
&lt;p&gt;Thanks for the support&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/152395?ContentTypeID=1</link><pubDate>Wed, 10 Oct 2018 15:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f75de67-d5ff-4251-8cb7-6f20a03ba82d</guid><dc:creator>Allen96</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for my late answer as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway the code inside the unreliable command is the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t simple_on_off_client_set_unreliable(simple_on_off_client_t * p_client, 
                                             uint8_t *msg, uint16_t lenght, 
                                             uint8_t repeats)
{
    uint8_t i;
    simple_on_off_msg_set_unreliable_t set_unreliable;
    
    for(i = 0; i &amp;lt; 4; i++){
      set_unreliable.msg[i] = *msg;
      msg++;
    }

    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; //msg;
    message.length = sizeof(set_unreliable); //lenght + 1;
    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;The idea is to send an array of uint8_t value (this code is inside the client).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the server side the code to recive is the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void handle_set_unreliable_cb(access_model_handle_t handle, const access_message_rx_t * p_message, void * p_args)
{
    simple_on_off_server_t * p_server = p_args;
    NRF_MESH_ASSERT(p_server-&amp;gt;set_cb != NULL);
    
    p_server-&amp;gt;set_cb(p_server,(uint8_t*) p_message-&amp;gt;p_data,(uint16_t) p_message -&amp;gt;length);
    (void)simple_on_off_server_status_publish(p_server, true);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here I just changed the callback to have the pointer of the array so i can go through it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here on the server side what i get is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;t:     442373&amp;gt;, main.c,  171, Got SET command&amp;lt;t:     442375&amp;gt;, main.c,  174, Value: 0x0010 
&amp;lt;t:     442377&amp;gt;, main.c,  174, Value: 0x0020 
&amp;lt;t:     442379&amp;gt;, main.c,  174, Value: 0x0030 
&amp;lt;t:     442381&amp;gt;, main.c,  174, Value: 0x0040 
&amp;lt;t:     442383&amp;gt;, main.c,  174, Value: 0x0000 
&amp;lt;t:     443321&amp;gt;, main.c,  171, Got SET command&amp;lt;t:     443323&amp;gt;, main.c,  174, Value: 0x0010 
&amp;lt;t:     443325&amp;gt;, main.c,  174, Value: 0x0020 
&amp;lt;t:     443327&amp;gt;, main.c,  174, Value: 0x0030 
&amp;lt;t:     443329&amp;gt;, main.c,  174, Value: 0x0040 
&amp;lt;t:     443332&amp;gt;, main.c,  174, Value: 0x0000 &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Printed by:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void on_off_server_set_cb(const simple_on_off_server_t * p_server, uint8_t *msg, uint16_t lenght)
{
    uint8_t i;
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Got SET command&amp;quot;);

    for(i = 0; i &amp;lt; lenght; i++){
      __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Value: 0x%04x \n&amp;quot;, *msg);
      msg++;
    }

    hal_led_pin_set(BSP_LED_0, !hal_led_pin_get(BSP_LED_0));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On the client side:&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);

    uint32_t status = NRF_SUCCESS;
    switch (button_number)
    {
        ...
        case 3:
            /* send a group message to the ODD group, with inverted GPIO pin value */
            status = simple_on_off_client_set_unreliable(&amp;amp;m_clients[2],
                                                         &amp;amp;ptr[0],4,
                                                         GROUP_MSG_REPEAT_COUNT);

            /*status = simple_on_off_client_set_unreliable(&amp;amp;m_clients[3],
                                                         &amp;amp;ptr[0],4,
                                                         GROUP_MSG_REPEAT_COUNT);*/

            if (status == NRF_SUCCESS)
            {
                hal_led_pin_set(BSP_LED_0 + button_number, !hal_led_pin_get(BSP_LED_0 + button_number));
            }
            break;
        default:
            break;
    }

    ...
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;t:     398996&amp;gt;, main.c,  228, Button 2 pressed
&amp;lt;t:     399488&amp;gt;, main.c,  189, OnOff server 0 status ON
&amp;lt;t:     400415&amp;gt;, main.c,  189, OnOff server 0 status ON&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the provisioner the address is always&amp;nbsp;GROUP_ADDRESS_ODD.&lt;/p&gt;
&lt;p&gt;Here if i press the button again nothing appen. The code seems to stuck on the &amp;quot;m_prepare_for_reserve&amp;quot; inside &amp;quot;packet_buffer.c&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve found something not working fine. The value recived should be &amp;quot;0x10 0x20 0x30 0x40&amp;quot; but the first one is missing.&lt;/p&gt;
&lt;p&gt;If i decrese by one the pointer inside the unreliable_set then i recive the 1st one but not the last one.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what i&amp;#39;ve found and i&amp;#39;m still looking if i can do something more to help to find the error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/151790?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 09:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0233a7a-0eee-4241-aad6-ff9a6e753a5c</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Very sorry for the delayed response. It seems like you are using the regular provisioning example. What changes have you made to the simple_on_off_client_set_unreliable() function? I understand the first argument , but what about the second &amp;amp; third arguments?&lt;/p&gt;
&lt;p&gt;What does the log for the client &amp;amp; server look like? Could you upload it please?&lt;/p&gt;
&lt;p&gt;It seems like you are doing the correct thing in the provisioner by making all of the server nodes subscribe to the GROUP_ADDRESS_ODD address.&lt;/p&gt;
&lt;p&gt;In the code below in node_setup.c of the provisioner:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        case NODE_SETUP_CONFIG_PUBLICATION_ONOFF_CLIENT3:
        {
            config_publication_state_t pubstate = {0};
            client_pub_state_set(&amp;amp;pubstate,
                                 m_current_node_addr + ELEMENT_IDX_ONOFF_CLIENT3,
                                 GROUP_ADDRESS_ODD);
            retry_on_fail(config_client_model_publication_set(&amp;amp;pubstate));

            static const uint8_t exp_status[] = {ACCESS_STATUS_SUCCESS};
            expected_status_set(CONFIG_OPCODE_MODEL_PUBLICATION_STATUS, sizeof(exp_status), exp_status);
            break;
        }

        case NODE_SETUP_CONFIG_PUBLICATION_ONOFF_CLIENT4:
        {
            config_publication_state_t pubstate = {0};
            client_pub_state_set(&amp;amp;pubstate,
                                 m_current_node_addr + ELEMENT_IDX_ONOFF_CLIENT4,
                                 GROUP_ADDRESS_EVEN);
            retry_on_fail(config_client_model_publication_set(&amp;amp;pubstate));

            static const uint8_t exp_status[] = {ACCESS_STATUS_SUCCESS};
            expected_status_set(CONFIG_OPCODE_MODEL_PUBLICATION_STATUS, sizeof(exp_status), exp_status);
            break;
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You could try to change the GROUP_ADDRESS_EVEN in client_pub_state_set() to GROUP_ADDRESS_ODD &amp;amp; see if that makes a difference. I am not sure it will, but it could be worth a shot.&lt;/p&gt;
&lt;p&gt;If you use the smartphone as the provisioner with the nrf mesh app &amp;amp; the proxy client &amp;amp; proxy server examples, it is really easy to setup a group address. The generic on off client model on the client can publish to a group address (e.g. 0xc001) &amp;amp; all of the servers can subscribe to this address in their respective generic on off server models. Take a look at this youtube video for &lt;a href="https://www.youtube.com/watch?v=XthbU9NP0Yg"&gt;more info&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition, here are two pdf&amp;#39;s which explain the steps further:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-4ba518982a5e41bea0fadc113dadf549/Mesh-Hands_2D00_on-Android_5F00_october2018.pdf"&gt;devzone.nordicsemi.com/.../Mesh-Hands_2D00_on-Android_5F00_october2018.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-4ba518982a5e41bea0fadc113dadf549/Mesh-Hands_2D00_on-iOS_5F00_October2018.pdf"&gt;devzone.nordicsemi.com/.../Mesh-Hands_2D00_on-iOS_5F00_October2018.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/150430?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 09:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3ddf68-c1e5-45b8-8731-f1d64a5520b8</guid><dc:creator>Allen96</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the version 2.1.1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Broadcast Mesh Message</title><link>https://devzone.nordicsemi.com/thread/150384?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 07:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8ec9de7-4129-4f6b-90e1-50970aaf27c8</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Which Mesh SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>