<?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 configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44728/how-to-configure-nodes-using-a-custom-provisioner</link><description>Hello, 
 I am trying to program my own provisioner. I am able to connect to a device, following this Provisioning Procedure . 
 How can I now configure the node? As far as I know I have to set an Appkey, as well as a Subscription/Publication Address.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Mar 2019 15:55:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44728/how-to-configure-nodes-using-a-custom-provisioner" /><item><title>RE: How to configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/thread/176007?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 15:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7056df15-94e8-4220-83cc-8a7f0aaa54c2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Kilian,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I understand that sometime it seems to be overcomplicated but to be able to make&amp;nbsp;the library generic enough we would need to do so.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that provisioning and configuration are 2 different procedures. Provisioning can only be done by the provisioner directly when the configuration is just normal Mesh activity and can be performed by any node (which has configuration client) and can be relayed.&lt;/p&gt;
&lt;p&gt;What you described is correct. You can find the list of the steps we design the provisioner to do in the light switch example in node_setup.c, please look for&amp;nbsp;client_config_steps. We basically have a state machine and going through every step in the array starting with&amp;nbsp;NODE_SETUP_CONFIG_COMPOSITION_GET.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/thread/175940?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 13:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d47c52f-2806-4a0d-93d6-41bea97900fa</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Yes I have tried the Provisioner example. The Problem with that is, that it is very complex and hard to understand. It uses a lot of interleaved functions and structures to do extremely simple thing (same with the light switch example...).&lt;/p&gt;
&lt;p&gt;I have already figured out, how to provision a node. To be exact: I receive a NRF_MESH_PROV_EVT_LINK_CLOSED in my provision_evt_handler following the procedure i pointed to. My problem is that I now want to set the publication address of the just provisioned node to the unicast address of my provisioner (or any other address).&lt;/p&gt;
&lt;p&gt;If I compare it to the example i see, that in the &amp;quot;provisioner_helper.c -&amp;gt;&amp;nbsp;prov_evt_handler -&amp;gt; case:&amp;nbsp;NRF_MESH_PROV_EVT_LINK_CLOSED -&amp;gt; Provisioning Successful&amp;quot; the function&amp;nbsp;node_setup_start() from node_setup.c gets called. Somewhere in there the publication and subscription addresses must be set. After some digging around I think in the function&amp;nbsp;config_step_execute(). According to that function i need to do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get the Composition Data:&amp;nbsp;config_client_composition_data_get(0x00);&lt;/li&gt;
&lt;li&gt;Add Appkey to the Node:&amp;nbsp;config_client_appkey_add(NETKEY_INDEX, m_appkey_idx, mp_appkey);&lt;/li&gt;
&lt;li&gt;Bind Appkey to the Model:&amp;nbsp;config_client_model_app_bind(element_address, m_appkey_idx, model_id);&lt;/li&gt;
&lt;li&gt;Set Publication of Model:&amp;nbsp;config_client_model_publication_set(&amp;amp;pubstate);&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Is that correct?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kilian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/thread/175926?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 12:55:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17fb5bfe-bfb9-4063-be69-ce3fe5d7fbf8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Kilian,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you tried to test the Provisioner example ? You were asking for &amp;quot;&lt;span&gt;Example of what to do with the standard API&amp;quot; but isn&amp;#39;t it the provisioner example does exactly that ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I understand that you may want to do something&amp;nbsp;not exactly the same as what the provisioner doing. But I would suggest to modify the provisioner instead of copy ans paste the code into your application before you fully understand how to modify the provisioner.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If possible, could you give some more information on what you are planing to do ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please note that provisioning process requires much more than what you posted. What you posted is how to generate and assign the key internally on the provisioner, not about provisioning a peer device. Please refer to the provisioning procedure in the documentation that you pointed to. This is handled in prov_provisioner.c and provisioning.c&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/thread/175678?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 13:23:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e0d7966-a924-402a-a31f-483d16d7a57c</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;thanks for your fast answer. Is there also a an Example of what to do with the standard API, instead of the PyACI?&lt;/p&gt;
&lt;p&gt;I was already modifying the Light Switch Provisioner, but I just don&amp;#39;t understand the whole Key Handling. I have copied this Code from the Light Switch Provisioner Example:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;// Node Setup --------------------------------&lt;/em&gt;&lt;br /&gt;&lt;em&gt; mesh_key_index_t netkey_handle;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; mesh_key_index_t appkey_handle;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; mesh_key_index_t devkey_handle;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;uint8_t netkey;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; uint8_t appkey;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; uint8_t self_devkey;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;/* Generate keys */&lt;/em&gt;&lt;br /&gt;&lt;em&gt; rand_hw_rng_get(&amp;amp;netkey, NRF_MESH_KEY_SIZE);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; rand_hw_rng_get(&amp;amp;appkey, NRF_MESH_KEY_SIZE);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; rand_hw_rng_get(&amp;amp;self_devkey, NRF_MESH_KEY_SIZE);&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;/* Add default Netkey and App Key */&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ERROR_CHECK(dsm_subnet_add(0, netkey, &amp;amp;netkey_handle));&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ERROR_CHECK(dsm_appkey_add(0, netkey_handle, appkey, &amp;amp;appkey_handle));&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;/* Add device key for the own config server */&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ERROR_CHECK(dsm_devkey_add(0x0001, netkey_handle, &amp;amp;self_devkey, &amp;amp;devkey_handle));&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This works and doesn&amp;#39;t give an Error. When I now try to set a publication for my Model I get a&amp;nbsp;NRF_ERROR_INVALID_PARAM Error. This is the Code for that:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;nrf_mesh_address_t addr = {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; .type = NRF_MESH_ADDRESS_TYPE_UNICAST ,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.value = 0x0001,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Address of my Provisioner&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.p_virtual_uuid = NULL&lt;/em&gt;&lt;br /&gt;&lt;em&gt; };&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;access_publish_period_t pub_period = {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.step_res = ACCESS_PUBLISH_STEP_RES_BITS,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.step_num = ACCESS_PUBLISH_STEP_NUM_BITS&lt;/em&gt;&lt;br /&gt;&lt;em&gt; };&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;config_publication_state_t pubstate = {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.element_address = 0x00F0,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Address of my Node&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.publish_address = addr,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.appkey_index = 0,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.frendship_credential_flag = false,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.publish_ttl = ACCESS_TTL_USE_DEFAULT,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.publish_period = pub_period,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.retransmit_count = 1,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.retransmit_interval = 1,&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.model_id = ACCESS_MODEL_VENDOR(0xFFAA, 0xF001)&amp;nbsp; &amp;nbsp;// Model ID and Vendor ID of my Node&lt;/em&gt;&lt;br /&gt;&lt;em&gt; };&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;br /&gt;&lt;em&gt; uint32_t status = config_client_model_publication_set(&amp;amp;pubstate);&amp;nbsp; &amp;nbsp; &amp;nbsp; // This Returns the Error&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Do I need to add the Appkey to my Node first? and if so how? Or do you see any other mistake I could have made?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kilian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure Nodes using a Custom Provisioner</title><link>https://devzone.nordicsemi.com/thread/175668?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 13:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58c0926a-93df-4190-9f81-a9d4463fcc4a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Biliban,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried our provisioner inside light switch example ? Please refer to the node_setup.c where we do the configuration for the light switch client and light switch server.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also have a look &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Mesh_SDK/v3-1-0/md_scripts_interactive_pyaci_doc_demo_configuration"&gt;here &lt;/a&gt;to get to know what a provisioner should do when doing configuration.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>