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

Custom BLE packets on mesh network

Hello

I have a mesh node that needs to broadcast a custom BLE packet

To start advertising I call bt_le_adv_start and it works as expected.

I'm curious about the error that I see in the RTT log

00> [00:08:41.658,050] <dbg> bt_mesh_net: bt_mesh_net_relay: Relaying packet. TTL is now 9
00> [00:08:41.658,172] <err> bt_mesh_adv_legacy: Advertising failed: err -120

My understanding is that his is because my app started advertising and the mesh network cannot relay the packet

I tried to call 

bt_mesh_relay_set(BT_MESH_FEATURE_DISABLED,BT_MESH_TRANSMIT(0,1));
before calling bt_le_adv_start  but I get same error -120.
What's the proper way to disable mesh relay?
Is there a way for custom advertising and mesh relay to coexist in a provisioned mesh node?
Thank you
  • From what I can tell the sample  enables extended advertising and configures 2 advertising sets

    But I don't see it doing anything else different from normal mesh initialization or ble advertising initialization 

    I enabled extended advertising i.e 

    CONFIG_BT_EXT_ADV=y
    CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
    On a provisioned device I now I get this
    [00:05:06.649,291] <wrn> bt_hci_core: opcode 0x2036 status 0x01
    00> [00:05:06.649,322] <err> bt_mesh_adv_legacy: Advertising failed: err -5
    At this point I have not called ble_adv_start to start advertising my custom packet - this is mesh only
    Any ideas?
    Thanks
  • Hi,

    I will need some time to take a look. Will give you an update by tomorrow.

  • Thank you!

    Look forward

  • Hi,

    It seems like the Legacy advertiser somehow is configured in. In the mesh Kconfig the used advertising bearer is defined as a choice:

    Meaning that it should not be possible to have both active at the same time.

    To verify that the extended adv is active you might search the build folder of the project for CONFIG_BT_MESH_ADV_EXT=y. If it is not there is something wrong in the prj.conf most likely.

    The build config can be found in [Project path]/build/zephyr/.config.

Related