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

Combining Mesh and Blinky examples

Hello everyone.

I would like to set-up a mesh network of Thingy:52 devices and an nRF52840, which would help me communicate from the an external stimulus to the phone, via this mesh network.

The steps that I have done are: I tried the the Light switch demo Ok & thingy52-mesh-provisioning-demo Ok and the BLE Blinky Application Ok. So, my goal is to send a notification on the phone, when a button on the other end is pressed. Something like that:

[external button -> on, to start communication] -------> [client starts Bluetooth communication (nRF52840)] ------> [server (Thingy:52), relay] ------> [phone running 'Blinky App', receives notification].

Do you have an idea/suggestion of how I should combine the two examples? From what I understand, the phone cannot participate in the Mesh, so the tricky part should be a code on the nRF52840, which helps the board (1) join the mesh and subscribe to notifications, while (2) also writing into a characteristic something, to send a notification on the phone.

Thank you in advance!

Parents
  • Hi,

    I suggest you have a look at the coexistence examples from our Mesh SDK, you can use that as a reference to combine a mesh example and an example from nRF5 SDK. 

    This document is also relevant.

  • Hello and thanks for replying me! It looks very useful.

    Ok, I will try these and come back if I am in trouble, thank you so much!

    Best wishes!

  • Hi,

    From the documentation Integrating Mesh into nRF5 SDK examples

    • If you are adding you own mesh functionality rather than working from an existing mesh example, you also need to add the file nrf_mesh_config_app.h. Copy it from the examples/templates folder in mesh stack repository into your project folder, and remove #error message at the top of the file. Make other appropriate changes to the file content, like adjusting ACCESS_ELEMENT_COUNT and ACCESS_MODEL_COUNT to the required number of elements and models.

    Can you try copy from the template instead and remove #error message at the top of the fil? Does it make any difference? Also, go through the "Optional changes" in the document.

    A comment on combining the two examples though. I think it might be easier doing it the other way around, use a mesh example(for example light switch) and then add the nRF5 functionality to it instead.

  • Hi 

    Copy it from the examples/templates folder in mesh stack repository into your project folder,

    I did that. But I would like to point out that nrf_mesh_config_app.h does not go in the project folder, i.e. C:\SESProj\nRF5_SDK_1530\examples\ble_peripheral\ble_app_blinky\pca10056\s140\ses, like you are proposing. 

    Instead, it goes to C:\SESProj\nrf5_SDK_for_Mesh_v320\mesh\core\api, where all .h files for the project are. Otherwise it will throw errors. 

    Can you try copy from the template instead and remove #error message at the top of the fil? Does it make any difference?

    I did erase those 3 lines and I do not get that specific error anymore. Instead, other errors arise, from the file mesh_opt_gatt.h not being found. (and I neither find this in any folder nor on the internet).

    think it might be easier doing it the other way around, use a mesh example

    Thanks for your suggestion, but it's completely unclear to me how to follow the original tutorial. If I switch to the other way round, I don't know which files from the SDK I should move to the Mesh folder. So, I will try to follow the original post, with the hope that it will work some day.. Disappointed

  • Have you taken a look at the SDK UART coexistence example? It is an example where mesh is merged into the nRF5 UART example. This example can be used as a reference as to how you can merge mesh into the Blinky example.

  • Hi! Sorry for the delay, I have been trying this example which you advised me.

    It builds successfully. However, I cannot test it. My steps are the following:

    1. Follow the 4 steps from the SDK UART coexistence example.

    2. Try to connect via nRF Mesh App - not sucessfull No entry sign The board is not found in the app. 

    3. Try to connect via nRF Connect - not sucessfull No entry sign  I can connect to the board. But whenever I try to write something in the field Mesh Proxy Data In, I get disconnected to the board (and I can reconnect back, but still the message is not received).

    Do you have any ideas how to make this example work? Thanks a lot for your ideas and help!

  • Hi,

    The Coexistense examples doesn't support PB-GATT so you won't be able to see/provision it using the nRF Mesh app. You need to use the provisioner example found in our SDK and provision it like you would with the light switch example. After you have provsioned it you can connect to it via nRF Connect and send data to the node.

Reply Children
  • Hello,

    so you won't be able to see/provision it using the nRF Mesh app.

    - ok, I did not know that. Thanks. Slight smile

    I used the phone for the light switch example, because I do not have so many boards (in the example, it's specified that we can use either a board or the phone, so I just used the phone). 

    So, you are saying that I should use another development kit for provisioning, instead.  

  • Yes, you need to use another development board to do the provisioning. 

  • Hello! Thanks for this info, I have been waiting for another dev board until now.

    Ok, so the last step from my project would be to actually integrate the Mesh project into the Nordic Blinky project, like I said in the beginning. But before trying to follow that tutorial (which I failed until now), I would like to ask you some questions.

    Mag So, on one hand, the provisioning needs to be done from the nRF Mesh phone Application (this works for the Mesh project).
    Mag On the other hand, for the combined example, provisioning cannot be make from the phone and needs to be made by a dev board.

    This is not so feasible, because I would like to deploy this combined mesh+blinky on many Thingy:52, which will act as a range extender, like I presented in the beginning:

    [server (Thingy:52), relay]

    But this can only be achieved if I specifically assign them with the same group address from the phone. So this cannot be just randomly done by a devboard.
    I hope that I explained well enough my concern.

    Do you see the problem that I will have even if I try to combine the two exampls? Maybe I should try another approach (?). Thinking Do you have any ideas?

    Thanks! Sun with face

  • Hi,

    I might have been misleading with the coexistence example. It was meant to use as a reference on how you can merge the blinky example and mesh example. 

    For provisioning, all nodes in the network need to be provisioned by the same provisioner. (Actually, it can be multiple provisioners, but then the provisioners must exchange information about the network beforehand, such as network key, already provisioned nodes, app keys, etc.) 

    So if you want to provision everything from the phone you can add support for PB-GATT yourself. I haven't done this myself but there should be many threads on this forum discussing about this already. I suggest you try to search around the forum, and this will be helpful.

  • Hi  and thanks for your help.

    Ok, now I understand that it may be more complex than I originally imagined Smile

    Thanks for your references! 

Related