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

bt_mesh_transport: No matching TX context for ack

I have a custom model that is declared as follows

BT_MESH_MODEL_PUB_DEFINE(vnd_pub, NULL, 3 + 8);
struct bt_mesh_model vnd_models[] = {
    BT_MESH_MODEL_VND(MODEL_CID, MODEL_ID, vnd_ops,
              &vnd_pub, NULL),
};
static struct bt_mesh_elem elements[] = {
    BT_MESH_ELEM(
        1, BT_MESH_MODEL_LIST(
            BT_MESH_MODEL_CFG_SRV,
            BT_MESH_MODEL_HEALTH_SRV(&_health_srv, &_health_pub),
            BT_MESH_MODEL_BATTERY_SRV(&_batt_ctx.srv),         
            BT_MESH_MODEL_CFG_CLI(&_config_client),
            BT_MESH_MODEL_HEALTH_CLI(&_health_client)
            ),                          
            vnd_models),
};
// mesh composition
static const struct bt_mesh_comp _comp = {
    .cid = CONFIG_BT_COMPANY_ID,
    .elem = elements,
    .elem_count = ARRAY_SIZE(elements),
};
I can provision with the nRF mesh app without problems but when I set up publish parameters on the custom model -I get "Invalid publish parameters" from the app and in the log I get
"bt_mesh_transport: No matching TX context for ack"
Any ideas ? I set  publish address to 0xFFFF, period to 5 seconds retransmit to 2 and retransmit interval to 300 ms
Tried different values - no luck . What does the "no matching TX context for ack"  error mean?
Thank you
Parents
  • Hi,

    You will typically get the "No matching TX context for ack" error if you have not successfully set up publish parameters on the device. The "Invalid publish parameters" error from the app would mean that the attempt to set new publish parameters for the device failed, in which case the device would have some missing publish parameters.

    In order for a Bluetooth mesh device to publish, it must have a publish address, and it must have an application key bound to the model doing the publishing. Have you configured both of these from the app?

    Please note also that the group address 0xFFFF, the "all nodes" address, is only addressing the first element (the primary element) of each node. It is not intended for general broadcasting to all models of a certain type, as there may be instances of that type of model on non-primary elements on some nodes. Those models will not receive the message.

    Regards,
    Terje

Reply
  • Hi,

    You will typically get the "No matching TX context for ack" error if you have not successfully set up publish parameters on the device. The "Invalid publish parameters" error from the app would mean that the attempt to set new publish parameters for the device failed, in which case the device would have some missing publish parameters.

    In order for a Bluetooth mesh device to publish, it must have a publish address, and it must have an application key bound to the model doing the publishing. Have you configured both of these from the app?

    Please note also that the group address 0xFFFF, the "all nodes" address, is only addressing the first element (the primary element) of each node. It is not intended for general broadcasting to all models of a certain type, as there may be instances of that type of model on non-primary elements on some nodes. Those models will not receive the message.

    Regards,
    Terje

Children
  • I used the nrf mesh app to provision the device and that succeeded . I can set up publishing on the battery model just fine. It's only  the custom model that fails. Can you clarify what you mean by "you have not successfully set up publish parameters on the device." ? See the device composition data above. Is there anything missing?
    On your second statement, 
    My custom model is in the primary element In case I need to move it to another element, what address should I be using to send the message to all nodes? Or is that not possible?
    Thanks

  • Hi,

    Regarding my first comment I was thinking you may be missing the publish address configuration, but since it is for an ack it may also be something wrong with the model implementation. We do have a vendor model development overview as part of the SDK documentation, as well as a walk-through of the code for the vendor specific chat sample. You may be missing a step, such as a callback function, or missing functionality from one of the callbacks?

    There is no standarized message going to each and every element for all nodes. You then have to configure every model to subscribe to a group address, and send the message to that group address.

    Regards,
    Terje

  • I tried using the custom model from onof_level_lighting_vnd_app sample instead of the model that I created. I get the same result . Status 0x07 configuring publication with mesh shell and "invalid publish parameters"  in mesh mobile app. Here is exactly the model definition. Can you spot anything that may cause this?
    -------------------

    // Battery server definitions
    struct bt_mesh_battery_srv _batt_srv = BT_MESH_BATTERY_SRV_INIT(batt_get);
    // health server
    static const struct bt_mesh_health_srv_cb _health_srv_cb = {
        .attn_on = attention_on,
        .attn_off = attention_off,
    };
    static struct bt_mesh_health_srv _health_srv = {
        .cb = &_health_srv_cb,
    };
    BT_MESH_HEALTH_PUB_DEFINE(_health_pub, 0);

    // from onoff_level_lighting_vnd_app sample
    struct vendor_state {
        int current;
        uint32_t response;
        uint8_t last_tid;
        uint16_t last_src_addr;
        uint16_t last_dst_addr;
        int64_t last_msg_timestamp;
    };
    BT_MESH_MODEL_PUB_DEFINE(vnd_pub, NULL, 3 + 6);
    struct vendor_state vnd_user_data;
    #define CID_ZEPHYR 0x0002
    /* Mapping of message handlers for Vendor (0x4321) */
    static const struct bt_mesh_model_op vnd_ops[] = {
        { BT_MESH_MODEL_OP_3(0x01, CID_ZEPHYR), BT_MESH_LEN_EXACT(0), vnd_get },
        { BT_MESH_MODEL_OP_3(0x02, CID_ZEPHYR), BT_MESH_LEN_EXACT(3), vnd_set },
        { BT_MESH_MODEL_OP_3(0x03, CID_ZEPHYR), BT_MESH_LEN_EXACT(3), vnd_set_unack },
        { BT_MESH_MODEL_OP_3(0x04, CID_ZEPHYR), BT_MESH_LEN_EXACT(6), vnd_status },
        BT_MESH_MODEL_OP_END,
    };
    struct bt_mesh_model vnd_models[] = {
        BT_MESH_MODEL_VND(CID_ZEPHYR, 0x4321, vnd_ops,
                  &vnd_pub, &vnd_user_data),
    };
    struct bt_mesh_cfg_cli       _config_client;

    struct bt_mesh_model root_models[] = {
        BT_MESH_MODEL_CFG_SRV,
        BT_MESH_MODEL_HEALTH_SRV(&_health_srv, &_health_pub),          
        BT_MESH_MODEL_BATTERY_SRV(&_batt_srv),          
        BT_MESH_MODEL_CFG_CLI(&_config_client),
    };
    static struct bt_mesh_elem elements[] = {
        BT_MESH_ELEM(0, root_models, vnd_models),
    };

    // mesh composition
    static const struct bt_mesh_comp _comp = {
        .cid = CONFIG_BT_COMPANY_ID,
        .elem = elements,
        .elem_count = ARRAY_SIZE(elements),
    };
  • Apparently update callback <is> mandatory in vendor pub for the publish to work. Your doc does say that but perhaps it should be emphasized more for dummies like me :)

    Thanks for helping resolve this

  • Hi,

    I am happy to hear that you figured out what was the issue. Thank you for sharing the resolution! And don't worry, I don't blame anyone for missing this kind of implementation detail.

    Regards,
    Terje

Related