Same Node as BLE Mesh and BLE Server (Dual Role)

Hi,

I am Currently running BLE Mesh with nrF5340DKs, I refer all nodes as Cores but 1 as Master, Master receives and Stores data as well send data to PC Serially for further analysis.

Now I am trying to replace PC with Mobile Phone, Where Mobile as BLE Client and Master(Just a Mesh Node) as BLE Server(with Read & Write Char.).

So we need the Mesh Node(Master) act as a mesh node to collect mesh data and as BLE Server for mobile app(nrf Connect mobile app) connectivity concurrently.

I trying to add BLE Server Characteristics to my Mesh Application code but not working as expected, I tried some basic ideas like

disable Mesh advertisement after provisioning and enable Ble advertisement etc. Mesh Works but BLE Server doesn't.

When Call reset mesh api after provisioning i am able to connect with BLE App but Mesh doesn't work.

Please suggest how to achieve expected results and related resources if available.

Toolchain/SDK -> 2.9.1

Thank you in Advance!

Parents Reply Children
  • light_switch_coex.zip

    Hello Hung Bui,

    Thanks for your response, yes exactly what I need.
    However this project is not supported for nrf5340dk.
    I tried to use it by creating new project(or take light Switch example) for nrf5340dk and then replace files with your suggested project to build it.
    This got build without any error but seems advertisement is not working.
    I have Attached updated coexistence example for nrf5340dk for you reference.

    below is output for you refrence.


    Booting Mesh and Peripheral Coex v2.9.1 - unknown commit ***<\r><\n>
    *** Using nRF Connect SDK v2.9.1-60d0d6c8d42d ***<\r><\n>
    *** Using Zephyr OS v3.7.99-ca954a6216c9 ***<\r><\n>
    Initializing...<\r><\n>
    [00:00:00.430,633] <27>[0m<inf> fs_nvs: 8 Sectors of 4096 bytes<27>[0m<\r><\n>
    [00:00:00.430,633] <27>[0m<inf> fs_nvs: alloc wra: 0, fe8<27>[0m<\r><\n>
    [00:00:00.430,664] <27>[0m<inf> fs_nvs: data wra: 0, 0<27>[0m<\r><\n>
    [00:00:00.454,254] <27>[1;33m<wrn> bt_hci_core: opcode 0x203a status 0x01 <27>[0m<\r><\n>
    [00:00:00.454,254] <27>[1;33m<wrn> bt_hci_core: Controller does not support 'LE_READ_MAX_ADV_DATA_LEN'. Assuming maximum length is 31 bytes.<27>[0m<\r><\n>
    [00:00:00.456,359] <27>[0m<inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)<27>[0m<\r><\n>
    [00:00:00.456,390] <27>[0m<inf> bt_hci_core: HW Variant: nRF53x (0x0003)<27>[0m<\r><\n>
    [00:00:00.456,420] <27>[0m<inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 121.4259 Build 3078678206<27>[0m<\r><\n>
    [00:00:00.457,061] <27>[0m<inf> bt_hci_core: No ID address. App must call settings_load()<27>[0m<\r><\n>
    Bluetooth initialized<\r><\n>
    [00:00:00.484,588] <27>[0m<inf> bt_hci_core: Identity: EF:4E:DB:64:EE:FE (random)<27>[0m<\r><\n>
    [00:00:00.484,619] <27>[0m<inf> bt_hci_core: HCI: version 6.0 (0x0e) revision 0x209a, manufacturer 0x0059<27>[0m<\r><\n>
    [00:00:00.484,649] <27>[0m<inf> bt_hci_core: LMP: version 6.0 (0x0e) subver 0x209a<27>[0m<\r><\n>
    [00:00:00.487,426] <27>[0m<inf> bt_mesh_provisionee: Device UUID: c416c145-10af-4be8-bbe9-3ebaef50e417<27>[0m<\r><\n>
    [00:00:00.489,532] <27>[1;33m<wrn> bt_hci_core: opcode 0x2036 status 0x01 <27>[0m<\r><\n>
    [00:00:00.489,562] <27>[1;31m<err> bt_mesh_pb_adv: Failed enabling advertiser<27>[0m<\r><\n>
    [00:00:00.491,668] <27>[1;33m<wrn> bt_hci_core: opcode 0x2036 status 0x01 <27>[0m<\r><\n>
    [00:00:00.491,699] <27>[1;31m<err> bt_mesh_pb_gatt: Failed enabling advertiser<27>[0m<\r><\n>
    Mesh initialized<\r><\n>
    Created a new identity for LBS: 1<\r><\n>
    [00:00:00.493,896] <27>[1;33m<wrn> bt_hci_core: opcode 0x2036 status 0x01 <27>[0m<\r><\n>
    Creating LBS service adv instance failed (err -5)

Related