<?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 Config Relay Set message through Config Client</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38838/sending-config-relay-set-message-through-config-client</link><description>Hello, I&amp;#39;m working on Mesh SDK 2.1.1 and I&amp;#39;m trying to send a Relay Set message through Configuration Client. I have changed the code of models_init_cb() function inside the main.c to initialize the Config Client Model: 
 
 The model seems to initialize</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Oct 2018 13:04:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38838/sending-config-relay-set-message-through-config-client" /><item><title>RE: Sending Config Relay Set message through Config Client</title><link>https://devzone.nordicsemi.com/thread/151673?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 13:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d90e861-0b06-4fbe-a219-8fe05e8e8063</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Question 1:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When calling&amp;nbsp;&lt;em&gt;config_client_init(..)&amp;nbsp;&lt;/em&gt;you need to provide it with a callback function of the following type&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;typedef void (*config_client_event_cb_t)(config_client_event_type_t event_type, const config_client_event_t * p_event, uint16_t length);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thus, a function with three arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;event_type&lt;/li&gt;
&lt;li&gt;p_event (Pointer to event data, may be NULL.)&lt;/li&gt;
&lt;li&gt;length&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When config client events happens, this function will be used, and processing may be done based on the arguments. Below shows the callback I used (borrowed from the light switch provisioner example):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void app_config_client_event_cb(config_client_event_type_t event_type, const config_client_event_t * p_event, uint16_t length)
{
    /* USER_NOTE: Do additional processing of config client events here if required */
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Config client event\n&amp;quot;);

    /* Pass events to the node setup helper module for further processing */
    //node_setup_config_client_event_process(event_type, p_event, length);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Try&amp;nbsp;setting&lt;em&gt;&amp;nbsp;config_client_cb&amp;nbsp;&lt;/em&gt;to a callback function instead of an event type.&lt;/p&gt;
&lt;p&gt;Question 2:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Yes, I used App key 1&lt;/li&gt;
&lt;li&gt;I used the same publish address&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The only difference I can see between our approaches is the one mentioned in question 1. I am using the same sdk (&lt;span&gt;Mesh SDK 2.1.1&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;Best regards, Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Config Relay Set message through Config Client</title><link>https://devzone.nordicsemi.com/thread/151066?ContentTypeID=1</link><pubDate>Mon, 01 Oct 2018 19:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dc485bf-5095-4c95-9eba-45c723fe8955</guid><dc:creator>Paulo.Zacarias</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thanks for your reply.&lt;br /&gt;&lt;br /&gt;My steps are similar to yours, so I tried to Provision the node again. No success, same NRF_ERROR_INVALID_PARAM error.&lt;br /&gt;&lt;br /&gt;So my questions are:&lt;/p&gt;
&lt;p&gt;1. How do you declare the &lt;strong&gt;app_config_client_event_cb&lt;/strong&gt;? I have in the following way:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static config_client_event_cb_t config_client_cb = CONFIG_CLIENT_EVENT_TYPE_MSG;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I had to declare it that way because if I don&amp;#39;t assign the type CONFIG_CLIENT_EVENT_TYPE_MSG, I get the error 14, NRF_ERROR_NULL when initializing the model.&lt;br /&gt;&lt;br /&gt;2. After provisioning, how do you configure the node? Do you bind the App key 1 that is shown by default?&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1538420532386v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And what publish address did you set? In my case should I use 0x0001 that corresponds to the element address of the Configuration model?&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1538420674182v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1538420739652v4.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;If my mistake is not in one of those steps, then I don&amp;#39;t know where else should I look for. Everything else is as you shown.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The experiment you did was with Mesh SDK 2.1.1 as well, right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Paulo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Config Relay Set message through Config Client</title><link>https://devzone.nordicsemi.com/thread/150950?ContentTypeID=1</link><pubDate>Mon, 01 Oct 2018 12:02:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:520cada9-95fd-437f-b4db-2db99c8f26c2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Are you sure you have set the application key and the publish address correctly. I was able to add the config client model, and successfully execute the &lt;em&gt;config_client_relay_set(..). &lt;/em&gt;The following steps was taken:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Started with the light_switch_proxy_client example&lt;/li&gt;
&lt;li&gt;Added &lt;em&gt;config_client(..)&lt;/em&gt; init to models_init_cb():&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void models_init_cb(void)
{
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Initializing and adding models\n&amp;quot;);

    for (uint32_t i = 0; i &amp;lt; CLIENT_MODEL_INSTANCE_COUNT; ++i)
    {
        m_clients[i].status_cb = client_status_cb;
        m_clients[i].timeout_cb = client_publish_timeout_cb;
        ERROR_CHECK(simple_on_off_client_init(&amp;amp;m_clients[i], i + 1));
        ERROR_CHECK(access_model_subscription_list_alloc(m_clients[i].model_handle));
    }
    ERROR_CHECK(config_client_init(app_config_client_event_cb));
}&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Added an extra model in ACCESS_MODEL_COUNT:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define ACCESS_MODEL_COUNT (1 + /* Configuration server */  \
                            1 + /* Health server */  \
                            2 + /* Simple OnOff client (2 groups) */ \
                            2 + /* Simple OnOff client (2 unicast) */ \
                            1 /* Config client model, not included initially */)
&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Added &lt;em&gt;config_client_relay_set(..) &lt;/em&gt;under button press 3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void button_event_handler(uint32_t button_number)
{
.
.
.
    case 2:
               __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;config_client_relay_set\n&amp;quot;);
              status = config_client_relay_set(CONFIG_RELAY_STATE_SUPPORTED_DISABLED, 7, 31);

              break;&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opened the nRF Mesh app, scanned and found the device (nRF5x Mesh Switch), clicked on it&lt;/li&gt;
&lt;li&gt;Pressing button 2 now resulted in&amp;nbsp;NRF_ERROR_INVALID_PARAM&lt;/li&gt;
&lt;li&gt;Provisioned it, and added both&amp;nbsp;an application key and&amp;nbsp;a publish address for the Configuration Client model&lt;/li&gt;
&lt;li&gt;Pressing button 2 (running config_client_relay_set(..) ) worked fine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I am not sure why it didn&amp;#39;t work for you, maybe you are able to figure out why by looking at the steps above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards, Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Config Relay Set message through Config Client</title><link>https://devzone.nordicsemi.com/thread/150747?ContentTypeID=1</link><pubDate>Thu, 27 Sep 2018 15:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41a13a10-23cb-42d5-b9c9-c8d0b175d042</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I will try to provide you with an answer by the upcoming monday/tuesday&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>