App key does not bind in Mesh provisioner in nrf52840

Hi, i am using "mesh provisioner" example in nrf52840. ncs v2.2.0
i am trying to provision nearby device, that is also nrf52840 running "ble_periphera_lbsl_coex" example.
And i manually set publish group address and subscribtion on mesh provisioner but it does not get app key " bt_mesh_cdb_app_key_get()".
On the other hand "ble_peripheral_lbs_coex" that has continiuos publish of time interval "2 Sec".but it shows "err-125" while publishing 


Following are my code and log of mesh_provisioner:

.

*** Booting Zephyr OS build v3.2.99-ncs1 ***
Initializing...
Bluetooth initialized
Mesh initialized
Loading stored settings
Created CDB
Provisioning completed
Configuring self...
Configuration complete
Waiting for unprovisioned beacon...
Device 916442e5ed624fceae9bbd1a129d6031 detected, press button 1 to provision.
Provisioning 916442e5ed624fceae9bbd1a129d6031
Waiting for node to be added...
Added node 0x0002
Configuring node 0x0002...
*** Booting Zephyr OS build v3.2.99-ncs1 ***
Initializing...
Bluetooth initialized
Mesh initialized
Loading stored settings
Using stored CDB
Using stored settings
Waiting for unprovisioned beacon...
Waiting for unprovisioned beacon...

 
struct bt_mesh_cfg_mod_pub pub = {
		.addr = 0xC000,
		.app_idx = 0,
		.ttl = 1,
		.period = BT_MESH_PUB_PERIOD_SEC(1),
	};


err = bt_mesh_cfg_mod_pub_set_vnd(net_idx, node_addr, node_addr,0x000A, 0x0059, &pub, NULL);
			if (err || status) {
				printk("Failed publishhh (err: %d, status: %d)\n", err,
				       status);
			}

err = bt_mesh_cfg_mod_sub_add_vnd(net_idx, node_addr, node_addr,0xC000, 0x000A,0x0059, NULL);
			if (err || status) {
				printk("Failed subscribe (err: %d, status: %d)\n", err,
				       status);
			}

Mesh_provisioner reboots after  bt_mesh_cdb_app_key_get().

  • I tried the provisioner example on nrf52832 DK and it works fine,

    but when i try to add publication and subscription config's, the provisioner reboots multiple times and only after a few reboots the configurations has been set on the provisionee

    I have added the pub & sub config in function configure_node():

    for (int i = 0; i < elem.nvnd; i++)
    		{
    			struct bt_mesh_mod_id_vnd id =
    				bt_mesh_comp_p0_elem_mod_vnd(&elem, i);
    
    			printk("Binding AppKey to model 0x%03x:%04x:%04x\n",
    				   elem_addr, id.company, id.id);
    
    			err = bt_mesh_cfg_mod_app_bind_vnd(net_idx, node->addr, elem_addr,
    											   app_idx, id.id, id.company, &status);
    			printk("Vnd Key bind (err: %d, status: %d)\n", err,
    				   status);
    			if (err || status)
    			{
    				printk("Failed (err: %d, status: %d)\n", err,
    					   status);
    			}
    			err = bt_mesh_cfg_mod_pub_set_vnd(net_idx, node->addr, elem_addr, id.id,
    												  id.company, &pub, &status);
    			printk("Pub set (err: %d, status: %d)\n", err,
    				   status);
    			if (err || status)
    			{
    				printk("Failed (err: %d, status: %d)\n", err,
    					   status);
    			}
    			uint16_t sub_addr = 0xC000;
    			err = bt_mesh_cfg_mod_sub_add_vnd(net_idx, node->addr, elem_addr, sub_addr, id.id,
    												  id.company, &status);
    			printk("Sub add (err: %d, status: %d)\n", err,
    				   status);
    			if (err || status)
    			{
    				printk("Failed (err: %d, status: %d)\n", err,
    					   status);
    			}
    		}

    publication parameters:

    struct bt_mesh_cfg_mod_pub pub = {
    	.addr = 0xC000,
    	.uuid = NULL,
    	.ttl = 4,
    };

    Following is the LOG of the mesh_provisioner:

    Waiting for unprovisioned beacon...
    Waiting for unprovisioned beacon...
    Device a5752069b9df48bb8000000000000000 detected, press button 1 to provision.
    Provisioning a5752069b9df48bb8000000000000000
    Waiting for node to be added...
    Added node 0x0004
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: -116, status: 0)
    Failed (err: -116, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: 0, status: 0)
    Sub add (err: 0, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized
    Loading stored settings
    Using stored CDB
    Using stored settings
    Configuring node 0x0004...
    Element @ 0x0004: 2 + 1 models
    Binding AppKey to model 0x004:0002
    Binding AppKey to model 0x004:0059:000a
    Vnd Key bind (err: -116, status: 0)
    Failed (err: -116, status: 0)
    Pub set (err: -116, status: 0)
    Failed (err: -116, status: 0)
    Sub add (err: -116, status: 0)
    Failed (err: -116, status: 0)
    Element @ 0x0005: 1 + 1 models
    Binding AppKey to model 0x005:0059:000a
    Vnd Key bind (err: 0, status: 0)
    Pub set (err: -116, status: 0)
    Failed (err: -116, status: 0)
    Sub add (err: 0, status: 0)
    Configuration complete
    Waiting for unprovisioned beacon...
    Waiting for unprovisioned beacon...

    Why does this reboot happens??

Related