bt_mesh_model_send relayable?

Hello, 

I am looking into relay nodes and my nodes do not seem to relay,

All nodes are provisioned with the same provisioner and have the same keys 

The following configs are enabled - 

CONFIG_BT_MESH_RELAY=y
CONFIG_BT_MESH_RELAY_ENABLED=y
CONFIG_BT_MESH_RELAY_RETRANSMIT_COUNT=5


The messages that are sent are vendor model messages using:
bt_mesh_model_send sent to BT_MESH_ADDR_ALL_NODES. 

bt_mesh_model_send does not have any acknowledgement, am I correct in saying bt_mesh_model_send cannot be relayed? and if not any pointers what to look for in this issue
Parents
  • Hi,

    I've picked up your case and will be looking into this early next week. In the meanwhile, do you got access to the Mesh specification? And which version of NCS are you using (it is relevant w.r.t what version of the Mesh spec you're using)?

    Kind regards,
    Andreas

  • Here is my test process that may aid in finding the issue:

    1 - Flash Unit A & B with the same project

    2 - Bind Keys to both A&B for VND models

    3 - A sends a message X address, B should relay

    Code to send Vendor message: 

    Node: the code below works, no issues with BT_MESH_ADDR_ALL_NODES, however no relays

    struct bt_mesh_model *mod = vnd_mod_pub_ctx.mod;
    
        struct bt_mesh_msg_ctx ctx = {
                .addr = sendAddr,
                .app_idx = mod->keys[0],
                .send_ttl = BT_MESH_TTL_DEFAULT,
        };
    
        BT_MESH_MODEL_BUF_DEFINE(buf, opcode, len);
        bt_mesh_model_msg_init(&buf, opcode);
    
        net_buf_simple_add_mem(&buf, bufferIn, len);
        net_buf_simple_add(&buf, '\0');
    
        return bt_mesh_model_send(mod, &ctx, &buf, &bmns_vnd_model_cb, NULL);

    struct bt_mesh_model_pub vnd_mod_pub_ctx;
    
    static struct bt_mesh_model bmns_vendor_models[] = {
            BT_MESH_MODEL_VND_CB(CONFIG_BMNS_COMPANY_ID,
                                 BMNS_VND_MODEL_SRV_OPCODE,
                                 opcode_list,
                                 &vnd_mod_pub_ctx,
                                 NULL,
                                 NULL)
    };

    build output configs (set in prj.conf, this snippet is to show they are actually set)

    GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BT_MESH_RELAY, 1);
    GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BT_MESH_RELAY_ENABLED, 1);

    from the nRF mesh app, relay is enabled, retransmission count is
    "5 retransmits and total transmissions: 6"

    retransmission interval 20ms

    Note: 

    Sending it to All Nodes, All relays, or to node B, is received by node B, and not relayed on.
    Sending it to a different address, is not received by node B

  • Update: I have tried with my dev kits with the light switch/ light example and that relays. Tested through distance. 

    However I did not see any relay logs - 

    These configs are enabled - 
    CONFIG_BT_MESH_LOG_LEVEL_DBG=y
    CONFIG_BT_MESH_ACCESS_LOG_LEVEL_DBG=y

    Are there any relay log configs?

  • Hi, 

    Thank you for describing the test setup, I will go through it and see if I can spot whats going on

    Shahin97 said:
    if you have a link to a Bluetooth sig spec that would be a good reference material.

    You can download the various Bluetooth SIG specs here:  https://www.bluetooth.com/specifications/specs/?types=specs-docs&keyword=mesh&filter= For Mesh you will need the Mesh Protocol and Mesh Model v1.1 specs

    Kind regards,
    Andreas

  • Hi again,

    I've had the time to go through your query somewhat closer today, and I have a couple of items for discussion:

    1. Regarding acking of groupmessages: According to the specification it is not recommended to ack group messages, i.e you should not expect these to get acked due to both pollution on the Mesh network as well as you will never have full control over how many nodes there are that is configured to listen to the same group addresses.
      1. The same argument goes for messages going to "all nodes". You typically don't know how many nodes a network has and which nodes it has. 
    2. BT_MESH_ADDR_ALL_NODES is only sent to the primary element on each node, i.e the element that has the unicast address for the node itself.
    3. Given that your Time To Live (TTL) is larger than 1 your messages should relay until TTL reaches 1 (or 0, but in this case TTL was 0 from the start).

    Could you elaborate some more regarding how you are able to observe if a message has been relayed or not?

    Kind regards,
    Andreas

  • Apologies for the delay, I am working on another project, I will look at this next week.

  • No worries, take the time you require and feel free to ping me again when you're ready

    Kind regards,
    Andreas

Reply Children
Related