<?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>simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45608/simple-coap-example-and-thread-network</link><description>Dear nordic, 
 I have some doubts in this example based on thread. Thread says one node join to the network using by commissioning. 
 1. In this example where we start commissioning? its confusing me i checked this example node can join any time in this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 May 2019 11:47:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45608/simple-coap-example-and-thread-network" /><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/185946?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 11:47:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81bc0912-3106-4cb1-9fe3-fbe617f8bab2</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Default key 00112233445566778899aabbccddeeff is set inside of OpenThread in the file key_manager.cpp, line 50&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-857607150a7d41ecb983f448c8ea64af/pastedimage1557315627997v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is the key that is used in the precommissioned examples, it can be changed by using &lt;strong&gt;otThreadSetMasterKey:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-857607150a7d41ecb983f448c8ea64af/pastedimage1557315781738v2.png" alt=" " /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But only in the precomissioned examples. It willl be generated when the Thread network is formed and every joining node would obtain it during commissioning.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/185848?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 08:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ce9852e-28bf-4a29-893f-9f81f84b15fd</guid><dc:creator>Emile Albert</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking for the location of this hardcoding. I found the location of panid and channel setting but not the location of the network key hardcoding. Could you help me ?&amp;nbsp;&lt;/p&gt;
[quote userid="5630" url="~/f/nordic-q-a/45608/simple-coap-example-and-thread-network/181876"]By pre-commissioned, I mean that device just after first boot receives hard-coded configuration that includes e.g.:&lt;br /&gt;PHY Channel, Pan ID, Master Key etc. Effectively you don&amp;#39;t see the commissiong process in those examples because it is skipped, and normal network attachment starts.[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/181876?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 14:01:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0e20b3e-3ccb-45e5-96a2-812e04249b95</guid><dc:creator>Lukasz Duda</dc:creator><description>&lt;p&gt;Hello &lt;a href="https://devzone.nordicsemi.com/members/alan-ajit"&gt;Alan Ajit&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;First of all, thank you for using nRF5 SDK for Thread and Zigbee. In the beginning, I would encourage you to switch to the newest version (3.0.0) just recently released.&lt;/p&gt;
&lt;p&gt;What I&amp;nbsp;pulled out from your description is that you are using &lt;em&gt;simple_coap_client&lt;/em&gt; and &lt;em&gt;simple_coap_server&lt;/em&gt; examples. Those examples are configured to be pre-commissioned. The rationale behind this decision was to enable prototyping application without a need of time costly commissioning each time. By pre-commissioned, I mean that device just after first boot receives hard-coded configuration that includes e.g.:&lt;br /&gt;PHY Channel, Pan ID, Master Key etc. Effectively you don&amp;#39;t see the commissiong process in those examples because it is skipped, and normal network attachment starts.&lt;/p&gt;
&lt;p&gt;All SDK examples use the generic &lt;em&gt;thread_utils&lt;/em&gt; module that exposes API for specifying&amp;nbsp;if pre-commissioning should be done or not. In case this option is disabled, the normal commissioning has to be performed.&lt;/p&gt;
&lt;p&gt;See this &lt;a href="https://www.threadgroup.org/Portals/0/documents/support/CommissioningWhitePaper_658_2.pdf"&gt;link&lt;/a&gt; to get more details about commissioning in Thread.&lt;/p&gt;
&lt;p&gt;There are two main in-band ways on how to commission a device to the network. The first one is to use an external commissioner (phone). The example on how to do that is well described here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.thread_zigbee.v3.0.0%2Fthread_border_router.html&amp;amp;cp=5_2_2_6_0_6&amp;amp;anchor=br_commissioning"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.thread_zigbee.v3.0.0%2Fthread_border_router.html&amp;amp;cp=5_2_2_6_0_6&amp;amp;anchor=br_commissioning&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The native commissioning, where the commissioner is one of the nodes in the network, you can test using two CLI nodes as follow:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node 1 (Commissioner - pre-commissioned):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; factoryreset&lt;br /&gt;&amp;gt; panid 0xabcd&lt;br /&gt;Done&lt;br /&gt;&amp;gt; channel 13&lt;br /&gt;Done&lt;br /&gt;&amp;gt; masterkey 00112233445566778899aaaaaaaaaaaa&lt;br /&gt;Done&lt;br /&gt;&amp;gt; ifconfig up&lt;br /&gt;Done&lt;br /&gt;&amp;gt; thread start&lt;br /&gt;Done&lt;br /&gt;&amp;gt; state&lt;br /&gt;Leader (wait for this state)&lt;br /&gt;&amp;gt; commissioner start&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node 2 (Joiner)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; eui64&lt;br /&gt;aabbccddeeff1122&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Node 1 (Commissioner - pre-commissioned):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; commissioner joiner add aabbccddeeff1122 PSKd123&lt;br /&gt;Done&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node 2 (Joiner)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; ifconfig up&lt;br /&gt;Done&lt;br /&gt;&amp;gt; joiner start PSKd123&lt;br /&gt;Done&lt;br /&gt;Join Successful!&lt;br /&gt;&amp;gt; thread start&lt;br /&gt;Done&lt;br /&gt;&amp;gt; state&lt;br /&gt;Child&lt;/p&gt;
&lt;p&gt;You can inspect code related with above commands &lt;a href="https://github.com/openthread/openthread/blob/master/src/cli/cli.cpp"&gt;here&lt;/a&gt;, so you can apply it with your project.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the end, you can also check our &lt;em&gt;nfc_meshcop&lt;/em&gt; example which shows how to commission a device with the help of NFC which is used to retrieve EUI64 and PSK of the device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When it comes to OpenThread and PSK generation. The PSK for the device (PSKd) is generated manually by the device itself (this is one of the parameters of this &lt;a href="https://github.com/openthread/openthread/blob/master/include/openthread/joiner.h#L99"&gt;joiner function&lt;/a&gt;). More complicated is the second Pre-Shared Key type for Commissioner (PSKc). Indeed in order to create it you need information about Extended Pan Id and Network Name. You can read section 8.4.1.2.1 Derivation of PSKc for all details. This derivation happens automatically if you use an external commissioner (mobile phone with Thread Commissioning application). Although if you want to generate PSKc manually, there is a nice tool written in C++ for that - &lt;a href="https://github.com/openthread/ot-br-posix/tree/master/tools"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I hope that helps. Let me know if you need more information about commissioning a new device to the Thread network.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/180224?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 09:17:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05273298-8b0b-4e7c-840a-506bf351c361</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi Alan.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m waiting on response from the development team on this question.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/179660?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2019 07:00:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:785480fc-7090-4c30-b79b-21bb1b5fcf7d</guid><dc:creator>Alan Ajit</dc:creator><description>&lt;p&gt;Thanks for your replay sir, but i have doubt in this example i think this example is not related to border router. Its just start commissioning first time and start a thread network after another device enter to this network. but my question is where in this example(simple coap server and simple coap client start commissioning how this work ) can you describe how the device join in this network?&lt;/p&gt;
&lt;p&gt;where start commissioning?&lt;/p&gt;
&lt;p&gt;where start joiner joining to network?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think the first device turn to leader and start thread network. the remaining device enter to this network but where the leader start commissioning(i searched in that code i didn&amp;#39;t find anywhere)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple coap example and Thread network</title><link>https://devzone.nordicsemi.com/thread/179527?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 13:27:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d099b34-9aef-4f14-927b-a18e44f4b443</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;All of the examples in the SDK are pre-commissioned, that means that the Master Key and Mesh Local Prefix is hardcoded by default.&lt;/p&gt;
&lt;p&gt;Could you take a look at &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Thread_SDK/v2-0-0/thread_border_router?46#br_commissioning"&gt;this &lt;/a&gt;section in the documentation?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>