<?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>NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92307/nrf-connect-sdk-bluetooth-mesh-how-to-bind-an-existed-appkey-to-a-local-model</link><description>Dears all, 
 When a bluetooth mesh node is done provisioning and added an appkey, I want to bind that appkey to local models. 
 I could not find any API for that. 
 Can you help me. 
 Best regards.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Oct 2022 08:36:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92307/nrf-connect-sdk-bluetooth-mesh-how-to-bind-an-existed-appkey-to-a-local-model" /><item><title>RE: NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/thread/389547?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2022 08:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0175956-631a-4197-a32f-6a597c0205d2</guid><dc:creator>binhla</dc:creator><description>&lt;p&gt;Dears,&lt;/p&gt;
&lt;p&gt;I just post this for any one that need.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;struct bt_mesh_comp bm_comp = {
    .cid = CONFIG_BT_COMPANY_ID,
    .elem = bm_elements,
    .elem_count = ARRAY_SIZE(bm_elements),
};

/*****/
bt_mesh_init(&amp;amp;bm_prov, &amp;amp;bm_comp);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void app_bm_local_config(void) {
    for (int e_idx=0; e_idx &amp;lt; bm_comp.elem_count; ++e_idx) {
        struct bt_mesh_elem *element = bm_comp.elem + e_idx;
        for (int m_idx = 0; m_idx &amp;lt; element-&amp;gt;model_count; ++m_idx) {
            struct bt_mesh_model *model = element-&amp;gt;models + m_idx;
            if (model-&amp;gt;id == BT_MESH_MODEL_ID_CFG_SRV || model-&amp;gt;id == BT_MESH_MODEL_ID_CFG_CLI || 
                model-&amp;gt;id == BT_MESH_MODEL_ID_HEALTH_SRV || model-&amp;gt;id == BT_MESH_MODEL_ID_HEALTH_CLI) 
                continue;
            if (model-&amp;gt;keys[0] == 0xFFFF) {
                model-&amp;gt;keys[0] = 0; /*Appkey index is 0*/
            }
            for (int k_idx=0; k_idx &amp;lt; CONFIG_BT_MESH_MODEL_KEY_COUNT; k_idx++) LREP_RAW(&amp;quot;%d &amp;quot;, model-&amp;gt;keys[k_idx]);
            if (model-&amp;gt;pub) {
                if (model-&amp;gt;pub-&amp;gt;addr == 0) {
                    model-&amp;gt;pub-&amp;gt;addr = 0xC000; /*Publish to group address 0xC000*/
                }
            }
        }
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It worked with me. But It cannot save the configuration so every time the SOC is restart, the&amp;nbsp;app_bm_local_config() must be call&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;
&lt;div id="eJOY__extension_root" class="eJOY__extension_root_class"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/thread/389094?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 01:35:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ead4c2-64e4-4de2-8779-9b256eb2d960</guid><dc:creator>binhla</dc:creator><description>&lt;p&gt;Dears&lt;/p&gt;
[quote userid="20690" url="~/f/nordic-q-a/92307/nrf-connect-sdk-bluetooth-mesh-how-to-bind-an-existed-appkey-to-a-local-model/388941"]How are you provisioning your device?[/quote]
&lt;p&gt;I have implement the provisioner on an ESP32 SOC. I also use the nRF Mesh&amp;nbsp;mobile app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="20690" url="~/f/nordic-q-a/92307/nrf-connect-sdk-bluetooth-mesh-how-to-bind-an-existed-appkey-to-a-local-model/388941"]The Configuration Client model is a foundation model defined by the Bluetooth mesh specification. It provides functionality for configuring most parameters of a mesh node, including encryption keys, model configuration and feature enabling.[/quote]
&lt;p&gt;I think the Configuration Client is for the Provisioner, not for the Nodes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I want is APIs that can be used by the Nodes themselves.&lt;/p&gt;
&lt;p&gt;If the Configuration Client can be implemented on the Nodes and config locally, please imfrom me.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regarads.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div id="eJOY__extension_root" class="eJOY__extension_root_class"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/thread/388941?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 10:01:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3870faf4-7a35-4d68-b649-c6dfea455ecd</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user=""]When a bluetooth mesh node is done provisioning and added an appkey[/quote]
&lt;p&gt;How are you provisioning your device?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="binhla"]So, that mean there are no api for binding appkey to a local model?[/quote]
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/mesh/cfg_cli.html#configuration-client"&gt;&lt;span&gt;Configuration Client&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Configuration Client model is a foundation model defined by the Bluetooth mesh specification. It provides functionality for configuring most parameters of a mesh node, including encryption keys, model configuration and feature enabling.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/mesh/cfg_cli.html#c.bt_mesh_cfg_app_key_add"&gt;bt_mesh_cfg_app_key_add()&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Br,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/thread/388720?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 09:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc971b2c-0e54-40cb-80ec-b8780ce17945</guid><dc:creator>binhla</dc:creator><description>&lt;p&gt;Dears,&lt;/p&gt;
&lt;p&gt;Thank you for your prompt response.&lt;/p&gt;
&lt;p&gt;So, that mean there are no api for binding appkey to a local model?&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;
&lt;div id="eJOY__extension_root" class="eJOY__extension_root_class"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect SDK: Bluetooth mesh, How to bind an existed appkey to a local model?</title><link>https://devzone.nordicsemi.com/thread/388699?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 08:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6d78277-ec4a-49c5-90cd-818d0ba8fc34</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You can configure the node using the nRF Mesh application after the device has been provisioned.&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>