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
  • 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.

Children
Related