This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Setting a Publish address to a mesh model after provisioning and binding App_key returns a EBUSY(-16) error code

Hello Support,

I just started to play with the self provisioning "Mesh-Demo" sample to get a hang of the BLE Mesh. Since I am working on the nRF52480 DK and don't have a Microbit board, I have decided to adapt the Light_Switch sample for my client node and Light sample for my Server node. 

After removing the Heartbeat functionality and replacing it with Generic On Off service, I am successfully able to initialize the mesh and bind App_Key to the Gen_OnOff_Cli model. However, when I try to set the publish address to a specific Unicast address, I keep getting a 'Mount device busy'(-16 code) error. 

Here are my publish parameters

struct bt_mesh_cfg_mod_pub pub = {
		.addr = 0x000e,
		.app_idx = 0,
		.ttl = 1,
		.period = BT_MESH_PUB_PERIOD_SEC(1),
	};
 I have chosen 0x000e as my client node's address.

Here is my Mesh element structure with just one element

static struct bt_mesh_cfg_cli cfg_cli = {
};

static struct bt_mesh_elem elements[] = {
#if DT_NODE_EXISTS(DT_ALIAS(sw0))
	BT_MESH_ELEM(1,
		     BT_MESH_MODEL_LIST(
			     BT_MESH_MODEL_CFG_SRV,
				 BT_MESH_MODEL_CFG_CLI(&cfg_cli),
			     BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub),
			     BT_MESH_MODEL_ONOFF_CLI(&buttons[0].client)),
		     BT_MESH_MODEL_NONE),
#endif

function call sequence shown below

dk_leds_init();
dk_buttons_init(NULL);
bt_mesh_init(&prov, model_handler_init());
.
.
bt_mesh_provision(net_key, net_idx, flags, iv_index, addr, dev_key);
.
.
bt_mesh_cfg_app_key_add(net_idx, 0x000e, net_idx, app_idx, app_key, NULL);
bt_mesh_cfg_mod_app_bind(net_idx, 0x000e, 0x000e, app_idx, BT_MESH_MODEL_ID_HEALTH_SRV, NULL);
bt_mesh_cfg_mod_app_bind(net_idx, 0x000e, 0x000e, app_idx, BT_MESH_MODEL_ID_GEN_ONOFF_CLI, NULL);
bt_mesh_cfg_mod_pub_set(net_idx, 0x000e, 0x000e, BT_MESH_MODEL_ID_GEN_ONOFF_CLI, &pub, NULL);

Finally here is my Proj.conf

CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

CONFIG_BT=y
CONFIG_BT_ECC=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_SETTINGS=y

CONFIG_BT_MESH=y
CONFIG_BT_MESH_RELAY=y
CONFIG_BT_MESH_SUBNET_COUNT=1
CONFIG_BT_MESH_APP_KEY_COUNT=1
CONFIG_BT_MESH_MODEL_GROUP_COUNT=2
CONFIG_BT_MESH_ADV_BUF_COUNT=10
CONFIG_BT_MESH_LABEL_COUNT=0
CONFIG_BT_MESH_PB_ADV=n
CONFIG_BT_MESH_CFG_CLI=y
CONFIG_BT_MESH_LOOPBACK_BUFS=8

CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600

CONFIG_DK_LIBRARY=y
#CONFIG_BT_MESH_DK_PROV=y
CONFIG_BT_MESH_ONOFF_CLI=y
CONFIG_BT_MESH_ONOFF_SRV=n

Few other threads suggest that there could be an issue in the publish timing. I have tried three timing parameters in the Pub_param struct. 1, 3 and 10 seconds. None fixed the issue. Could you please point out what could be wrong? Thanks

Edited the Mode ID used in the function call sequence..

Parents
  • Hi,

    What Mesh SDK are you using? Are you using the light switch example from our SDK? 

    Can you give more details on what you are trying to do? If you only want to try out the GenericOnOff models, then they are already implemented in the Light switch example. It seems like you are using another example as you have to replace the Heartbeat functionality with Generic On Off model. 

    Also what are you use to provision the node?

  • Hello,

    I am working with the latest nRF connect SDK.

    I am primarily using the Mesh-demo sample which is self provisioning. Since I wanted to use my DK, I am adding the Model_handler portion of light_switch sample to create the Gen_OnOff models. I have just commented out the Heartbeat functionality that comes with the Mesh-Demo sample.

    I am trying to establish a mesh network with two nodes(self provisioned) simulating the Light and Light_switch examples just without the provisioner. My plan is to play around with this network and eventually use a provisioner in the future.

    Update: I saw the following debug info "No multi-segment message contexts available". I tried increasing the CONFIG_BT_MESH_TX_SEG_MSG_COUNT in my proj.conf from 1 to 3 and it fixed the issue.

Reply
  • Hello,

    I am working with the latest nRF connect SDK.

    I am primarily using the Mesh-demo sample which is self provisioning. Since I wanted to use my DK, I am adding the Model_handler portion of light_switch sample to create the Gen_OnOff models. I have just commented out the Heartbeat functionality that comes with the Mesh-Demo sample.

    I am trying to establish a mesh network with two nodes(self provisioned) simulating the Light and Light_switch examples just without the provisioner. My plan is to play around with this network and eventually use a provisioner in the future.

    Update: I saw the following debug info "No multi-segment message contexts available". I tried increasing the CONFIG_BT_MESH_TX_SEG_MSG_COUNT in my proj.conf from 1 to 3 and it fixed the issue.

Children
No Data
Related