<?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>CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102991/config_openthread_networkkey-in-prj-conf-not-working</link><description>Summary: I am running the Nordic CLI sample and find that I cannot override the default networkkey or channel. I’ve added entries to my prj.conf file that don&amp;#39;t give the desired effect. Any ideas on what I’m doing wrong? Thanks in advance! Details: The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Aug 2023 15:49:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102991/config_openthread_networkkey-in-prj-conf-not-working" /><item><title>RE: CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/thread/443599?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 15:49:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5025fb7-ca93-4f89-9483-97dda6c81749</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I explained previously, these values from Kconfig are set only in &lt;code&gt;openthread_start()&lt;/code&gt; . The only way to jump into that function is if from, and only if &lt;code&gt;CONFIG_OPENTHREAD_MANUAL_START&lt;/code&gt; flag is set: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/l2/openthread/openthread.c#l591-l596" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/l2/openthread/openthread.c#L591-L596" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/net/l2/openthread/openthread.c#L591-L596&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to be able to set networkkey and channel, you will have to implement openthread API calls (as in the snippet in the previous reply). Of course, he can use KConfig entries there, and even reuse &lt;code&gt;&lt;span&gt;CONFIG_OPENTHREAD_NETWORKKEY&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;/span&gt; etc.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/thread/443224?ContentTypeID=1</link><pubDate>Sat, 26 Aug 2023 00:13:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d355cad-e0e6-403e-a0f9-fac81755b928</guid><dc:creator>SteveKranz</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;I guess I was hopeful that I could construct a build image that had defaults that represented what I had specified in the prj.conf file.E.g overriding the defaults that normally would be used. But maybe you are saying that is not a valid manner to accomplish this? Still curious if maybe there is a setting I&amp;#39;m missing in prj.conf or alternate syntax that might get me there. Thanks in advance.&lt;/p&gt;
&lt;p&gt;Steve.&lt;/p&gt;
&lt;p&gt;PuzL Labs, LLC&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/thread/442570?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2023 12:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2da3c334-53a7-476d-a375-ee2f66b86b08</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It depends on what you want to achieve. For example for the CLI sample, you can enable automatic Thread startup with the flag: CONFIG_OPENTHREAD_MANUAL_START=n&lt;/p&gt;
&lt;p&gt;Then, in Zephyr, &lt;code&gt;openthread_start()&lt;/code&gt; is called which sets flags used by you, but Thread starts automatically.&lt;/p&gt;
&lt;p&gt;If you look into &lt;code&gt;openthread_start()&lt;/code&gt;implementation, you can see that Thread API functions &lt;code&gt;otLinkSetChannel()&lt;/code&gt; and &lt;code&gt;otThreadSetNetworkKey()&lt;/code&gt; are used. you can also be called for example from &lt;code&gt;main.c&lt;/code&gt; in our CLI sample, setting channel and networkkey without starting Thread. Sample code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
 otNetworkKey networkKey;
 struct openthread_context *ot_context = openthread_get_default_context();
 net_bytes_from_str(networkKey.m8, 16, (char *)&amp;quot;00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff&amp;quot;);
 otThreadSetNetworkKey(ot_context-&amp;gt;instance, &amp;amp;networkKey);
 otLinkSetChannel(ot_context-&amp;gt;instance, 15);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, our CoAP samples show how the default networkkey and channel can be set, and used with &lt;code&gt;openthread_start() &lt;/code&gt;call.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/thread/442363?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 14:56:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:527a5edf-237b-431b-8126-f3bc07fd3815</guid><dc:creator>SteveKranz</dc:creator><description>&lt;p&gt;Thanks Amanda, I am glad to hear you can reproduce the issue and are checking with the team. As for the alternate way you suggested, yes, that is what I&amp;#39;ve been doing as a [temp] workaround, but really need to have a solution where the build right out of the gate has the desired defaults and not requiring any additional user CLI interaction on first boot.&lt;/p&gt;
&lt;p&gt;Thanks again, I hope to hear something back soon.&lt;/p&gt;
&lt;p&gt;Steve K.&lt;/p&gt;
&lt;p&gt;PuzL Labs, LLC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_OPENTHREAD_NETWORKKEY in prj.conf not working.</title><link>https://devzone.nordicsemi.com/thread/442353?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 14:27:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dfda3f2-79d3-413c-8c5b-9878ec3ce5c2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can reproduce the issue with&amp;nbsp;&lt;span&gt;NCS v2.4.1 CLI sample and nRF52840DK. I would check with the team. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The alternate way is to set the network key and channel with commands as the commands. See the example in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/openthread/cli/README.html#testing"&gt;the CLI sample documentation&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda Hsieh&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>