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!

  • 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 ! As you suggested me, I followed the links and now I'm trying to actually combine the two codes. But the documentation for this is a bit unclear to me - maybe because of my lack of experience. Anyway, I would like to ask if I understood correctly.

    I understand that I should follow the steps from this link. But I do not know if including the source files refers to (1)folders copy-paste or (2) actually #include files in C?

    That would be my first question. 

    My second question is: Where do all these files need to be copied? Should I make a specific folder with all of them in the SDK big folder? I guess that depends on how they are included in the other .c and .h files, but again - I do not know if I should change some C files too.

    Thank you very much.

  • Hi,

    You don't necessarily need to copy the source files anywhere. "Including the source files" refers to adding the source files into your project. When you open the project go into the left pane(Project explorer), right-click on the Project/a folder then press "Add New File...".

    In addition to adding the sorce files you need to include paths to your include files. Do the following:

    1. Right-click on your project, press "Options.."

    2. In the upper left corner in the drop-down box, change from "Debug"/"Release" to "Common"

    3. Under "Code", press "Preprocessor"

    4. Choose "User Include Directories" and add the path here

    Assuming you are using SES.

  • Hi  and thanks for replying me with detailed info. Now I have another error.

    To sum up what I have done so far: from this tutorial, I followed the all 3 steps like this: 

    Including nRF5 SDK for Mesh functionality in an nRF5 SDK example
    1. Include the following source files from nRF5 SDK for Mesh in the nRF5 SDK example's project file - done. I created a folder in SES like you explained, like this: 


    2. Add the following folders to the project include path of the nRF5 SDK example - done. I added all 15 mentioned folder paths  in the "User Include Directories" like this: 

    ../../../../../../../nrf5_SDK_for_Mesh_v320/mesh/core/api
    ../../../../../../../nrf5_SDK_for_Mesh_v320/mesh/core/include and so on for all 15 folders. 


    3. Add the following preprocessor symbols to the project file of the nRF5 SDK example - done. I added it similarly:

    However, when building the project, I get the error: nrf_mesh_config_app.h: No such file or directory.  

    I notice that it is used in the context:

    #ifdef CONFIG_APP_IN_CORE
    #include "nrf_mesh_config_app.h"
    #endif

    Could you please help me debug this issue? Should I just comment it? I mention that I do not even find this .h file in my Mesh folder. However, I can just copy it from here.

    Thank you in advance & best wishes, Alexa.  

Related