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

Build simple mesh network.

Hello.

I am trying to build something like this in the picture below:


so my guess is that I need mesh functionality.


So my initial questions are.

Are there any tutorials describing how to connect those nrf52 into mesh network? How to customize criteria for adding nodes, let say some kind of key authentication before adding node to such network?
How co communicate with individual nodes from perspective of "Relay node"?

I tried to compile this example -> github.com/.../Nordic-Thingy52-mesh-demo but it seems like mission impossible, it seems that there is some next issue to fix, missing headers files etc.

For example I would like to get temperature from every node in such network. Any ideas where to start?

Best regards.

  • Hello again.

    Something (the example) worked but let’s say I would like to customize the behaviour of this example in that way that I’d like to send back temperature from server to client whenever button 1 on client is pressed. There is this function uint32_t sd_temp_get(int32_t * p_temp) so getting temperature should be quite easy. The first question is which function is responsible for handling this event (button pressed) on server side and how can I send temperature to client? On client side it is button_event_handler (if I am not mistaken).
    Another question is. How can I read those temperatures sent by servers back to client?
    Let’s say my network configuration looks like in the picture below and I am sorry for my drawing look unprofessional, I used paint Wink

  • Sorry for the delayed response. I have been travelling for business & have been unable to respond to this case unfortunately. 

    twar said:
    The first question is which function is responsible for handling this event (button pressed) on server side and how can I send temperature to client?

    You also have a button_event_handler on the server side. If you take a look at the proxy server example from mesh sdk v2.2.0, you can see this code:

            case 0:
            {
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "User action \n");
                hal_led_pin_set(ONOFF_SERVER_0_LED, !hal_led_pin_get(ONOFF_SERVER_0_LED));
                app_onoff_status_publish(&m_onoff_server_0);
                break;
            }

    When you press button 1 on the server, the status message will be sent to the client, informing the client about the LED status change (LED on server will toggle).

    What if you create your own custom model based on the generic on off client & server models & update the __app_onoff_server_t struct in app_onoff.h to send a status message with the LED state, in addition to the temperature?

    twar said:
    On client side it is button_event_handler (if I am not mistaken).
    Another question is. How can I read those temperatures sent by servers back to client?

    Yes, the button event handler handles the button press event on the client side. On the client side, you should be able to send a get message to the server & receive a status message from the server (see the generic_onoff_client_get function in generic_on_off_client.h).

    I would both of the functionality with the regular light switch examples first & make sure you can send the LED status message with LED state from the server to the client via a button press on the server. Then, I would test by pushing a button on the client, which should then send a get message to the server. You should then receive the server LED status back.

    Once you have figured that out, then I would update the generic on off models to include a temperature value too by creating your own custom model.

    This case may also be useful to take a look at.

Related