Bluetooth Mesh -> When associating a vendor model to an Element, the Nordic Mesh App fails to retrieve the models if there are more than one model.

When creating a Bluetooth Mesh Vendor model (https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/bt/bt_mesh/vendor_model/dev_overview.html) and if the vendor model is associated to the first element:

static const struct bt_mesh_elem elements[] = {
BT_MESH_ELEM(0, root_models, vnd_sampleModel ),
//BT_MESH_ELEM(1, sensrvModel, BT_MESH_MODEL_NONE ), // For some reason enabling further Models makes the NRF app unable to get the models.
};

The Mesh App works fine and can retrieve the node available models, including the vendor one, and work with it.  The same is true if instead of vnd_sampleModel it is replaced by the standard BT_MESH_MODE_NONE. So nothing new here.

The issue arises, if, for example, on the above case the Element 1 is activated. If Element 0, has the vendor model set as none, the Mesh app works fine and can retrieve both Element 0 and Element 1.

If however the vendor model is declared either on the Element 0 or Element 1, the Mesh app fails to retrieve the available models.

Parents Reply Children
  • Are you using vanilla Zepher? If so, Could you try to use the nRF Connect SDK (NCS) last version? Since our support is based on NCS.

  • Hi, I have the issue both in the NCS release and in the standard Zephyr:

    *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
    Initializing...
    Bluetooth initialized
    Mesh initialized

    If you pick up the standard example on the bluetooth folder:

    (...)/zephyr/samples/bluetooth/mesh

    And change the example to add a generic vendor model on main.c file on line 214 just below the gen_onoff_set function:

    #define MOD_LF 0x0000 // Linux Foundation model id
    #define OP_VENDOR_SAMPLE_ACTION1 BT_MESH_MODEL_OP_3( 0x00, BT_COMP_ID_LF)

    static int vnd_action1(const struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf) {
    return 0;
    }

    static const struct bt_mesh_model_op vnd_sample_ops[] = {
    { OP_VENDOR_SAMPLE_ACTION1, BT_MESH_LEN_EXACT(0), vnd_action1 },
    BT_MESH_MODEL_OP_END,
    };

    static const struct bt_mesh_model vnd_sampleModel[] = { //
    BT_MESH_MODEL_VND( BT_COMP_ID_LF, MOD_LF, vnd_sample_ops, NULL, NULL ),
    };

    and above the bt_mesh_model_op gen_onoff_srv_op declaration and then create a new model definition below the models declaration, for example:

    static const struct bt_mesh_model other_models[] = {
    BT_MESH_MODEL(BT_MESH_MODEL_ID_GEN_ONOFF_CLI, gen_onoff_cli_op, NULL,
    NULL),
    };

    And change the elements declaration to:

    static const struct bt_mesh_elem elements[] = {
    BT_MESH_ELEM(0, models, vnd_sampleModel ),
    BT_MESH_ELEM(1, other_models, BT_MESH_MODEL_NONE ),
    };

    Compile it, flash it (I'm using the NRF52840 dongle), when provisioning BOTH applications for Android and iPhone hang when retrieving the available models.

    If element 1 is deleted, then the provisioning works fine.

    If the vnd_sampleModel is moved to element 1, it also fails.

  • Hi, 

    I can reproduce the issue with your modification and see the following debug log:

    Mesh initialized
    [00:00:01.709,503] <wrn> bt_l2cap: bt_l2cap_recv: Ignoring data for unknown channel ID 0x003a
    [00:00:06.489,227] <dbg> bt_mesh_access: bt_mesh_model_recv: app_idx 0xfffe src 0x0001 dst 0x0003
    [00:00:06.489,288] <dbg> bt_mesh_access: bt_mesh_model_recv: len 3: 800800
    [00:00:06.489,288] <dbg> bt_mesh_access: bt_mesh_model_recv: OpCode 0x00008008
    [00:00:06.489,318] <err> bt_mesh_access: comp_add_elem: Too large device composition
    [00:00:06.489,349] <err> bt_mesh_cfg_srv: dev_comp_data_get: Failed to get CDP0, err:-7

     This means, the max TX segment configuration is not correct, and thus there are not enough buffers to store bigger composition data. Please try to set CONFIG_BT_MESH_TX_SEG_MAX=5 to allow transmissions of messages up to 5 segments long to solve the problems. After adding this config, I see this issue goes away with the Android app on my side.

    -Amanda H.

  • Hi, sorry for the delay.

    Yes, the setting does indeed resolve the issue. Thank you.

Related