<?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>BLE Mesh Custom Model Appkey Index not updating during self-provisioning process, always equals 0xFFFF</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120109/ble-mesh-custom-model-appkey-index-not-updating-during-self-provisioning-process-always-equals-0xffff</link><description>Hello, 
 I am new to BLE Mesh and working with Zephyr. However, I&amp;#39;ve found the supported BLE Mesh samples to be very helpful in understanding the protocol and the environment. 
 I am working on evaluating BLE Mesh by modifying the mesh_demo sample. My</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Mar 2025 13:46:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120109/ble-mesh-custom-model-appkey-index-not-updating-during-self-provisioning-process-always-equals-0xffff" /><item><title>RE: BLE Mesh Custom Model Appkey Index not updating during self-provisioning process, always equals 0xFFFF</title><link>https://devzone.nordicsemi.com/thread/529312?ContentTypeID=1</link><pubDate>Thu, 27 Mar 2025 13:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04bae85a-2199-47ea-af17-a51a2cec268a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Cam,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;status of whether an app key is added, and which models it is bound to is stored in NVM.&amp;nbsp;During initialization, you can simply check the status and then proceed&amp;nbsp;depends on what the current state is.&lt;/p&gt;
&lt;p&gt;It has been a long time, and I don&amp;#39;t know if I had tried this then, but instead of a reset to split apart the sequence, you can also try adding a delay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Mesh Custom Model Appkey Index not updating during self-provisioning process, always equals 0xFFFF</title><link>https://devzone.nordicsemi.com/thread/529040?ContentTypeID=1</link><pubDate>Wed, 26 Mar 2025 12:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f60831db-ef25-40f7-91e0-a844e13fcb2e</guid><dc:creator>Cam Martell</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. Are you referring to these steps you outlined:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On initialization when the device is not yet provision, add the app key to the&amp;nbsp;node. The model features won&amp;#39;t work yet in this boot.&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;On initialization where the device has been provisioned, run the key binding. From this point on, the features should work normally.&lt;/li&gt;
&lt;li&gt;Thus, to get things run, after flashing the device and let it run for the first time, simply reset it and things should&amp;nbsp;then work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If so, I am a bit unsure what this would look like in the source code. Are you suggesting that I try adding the app key first on boot, then provisioning the device second, followed by binding the app key? Or is there some other order of operations. I don&amp;#39;t understand how the multiple boot ups would work in this case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Would I need to add some conditional to check if the app key has already been added? If it hasn&amp;#39;t, add the app key and reboot, if it has, provision and do the key binding? Or is this different than your crude workaround?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Mesh Custom Model Appkey Index not updating during self-provisioning process, always equals 0xFFFF</title><link>https://devzone.nordicsemi.com/thread/528942?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2025 22:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93e08aaf-df3e-46ea-9e35-f43427ee94fe</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello Cam,&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;found some issues about the order the operations in a similar setup in my last reply in this DevZone case:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/97803/bluetooth-mesh-demo-example-automatic-provisioning"&gt;Bluetooth: Mesh Demo example automatic provisioning&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you enable more logging and see if that is what is happening here?&lt;/p&gt;
&lt;p&gt;In that same DevZone case, I also wrote about why the self-provisioning setup&amp;nbsp;is recommended against for production.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>