This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use Bluetooth Mesh GATT provisioning with regular BLE stack?

I am running an example from Mesh SDK (v2.1.1) named "ble_app_uart_coesixt". I see device in Bluetooth list, everything is ok. But I need to provision this device using my smartphone without other devices. My goal is to provision device and than communicate with regular BLE uart profile. I can't understand how to combine "light_switch proxy_client" with coexist example. As I see it is just GATT service, and I don't need a "proxy" feature itself, only need to provision device with BLE. How can I do it?

  • Hi,

    You will need to use the proxy functionality to provision the device via the nrf mesh iOS/Android app. It might be easiest to try out the light switch proxy client & proxy server examples first & then add the uart functionality to those examples, like explained here. It could also be useful to take a look at this Youtube video on provisioning with the nrf mesh app.

    Kind Regards,

    Bjørn

  • I did this steps:

    1. Copy coexist example to sdk folder as written inside readme file
    2. Open this project (compiles and runs succesfully)
    3. Add proxy files (mesh_gatt.c, proxy.c, proxy_filter.c, nfv_mesh_prov_bearer_gatt.c, mesh_adv.c)
    4. Add preprocessor MESH_FEATURE_GATT=1 and GATT_PROXY=1
    5. Build (without errors or warnings), erase flash, start debug
    6. And than it just falls into breakpoint inside app_error_weak.c.

    Then I did this in file main.c:

    1. Comment all APP_TIMER_DEF() ... BLE_DB_DISCOVERY_DEF()
    2. Comment all BLE callbacks and local methods.
    3. Leave only log_init(), timers_init(), power_management_init(), ble_stack_init(), mesh_main_init(), mesh_main_start()
    4. It runs successfully and can be provisioned

    If I uncomment only gatt_init() with NRF_BLE_GATT_DEF(m_gatt) then it fall to breakpoint AFTER attempt to connect in nRF Mesh. If I uncomment only advertising_init() with BLE_ADVERTISING_DEF(m_advertising) then it falls as startup at breakpoint.

    I can't say where is problem, because softdevice can't use debug stepping. As I understand it conflicts with radio module or something. Can you provide an example for both GATT Proxy and BLE stack coexist?

  • I got an update Mesh 2.2.0. Seems your team forget to add ticker.c/ticker.h source files or forget to remove them from the included files in the project.

    I did the same steps, now it seems working but not fully.

    1. sd_ble_gap_adv_set_configure returns NRF_ERROR_NO_MEM. I had to comment all advertising calls in main.c, so in this case only mesh uses it.
    2. An error occurs when calling sd_ble_gatts_exchange_mtu_reply at mesh_gatt.c.517. I had to commect all m_gatt calls in main.c to let only mesh have access to sd_ble_gatts_*
    3. This configuration runs without BLE services (because I had to comment adv and gatt), but all other code do not provide conflicts, so I can do a provision.
    4. I will try to figure out the way to start BLE services. I hope you can advice me
  • Hi,

    There were some issues with the uart_coexist example. The ticker files have been removed in mesh sdk version 2.2.0 because they are deprecated. Have you taken at the documentation provided here yet?

    Kind Regards,

    Bjørn

  • Hi,

    I read the documentation provided for old and new Mesh stack. There is basic steps to run this example and I already did it and run it successfully. The problem is that there is no working example with Mesh GATT proxy AND regular BLE stack at the same time. Previously I tried to describe my steps to reproduce the problem.

Related