Bluetooth Mesh sensor data

Hello,

I am currently working on a mesh sensor system. I have got one sensor board and one board for connecting in the mesh system.
Now I want to be able to send the sensor data from the board where it is connected to, to the other and than print it in the debugger or console or how you want to call it.

Does anyone have an idea how I can send the data that I get every second and place it in bluetooth mesh packets so it will be sent to the other board. And also how to print it when the other board received it.

Thanks :)

  • I have seen that. Overall that page is just reference to reference so that is extremely hard to normally read and hard to understand if you are just beginning with mesh.

    So it is not really of use to me. I do have that example with a server sensor and a client sensor on my boards. But I am trying to figure out what part of the code includes the mocked sensor data and sends that data over bluetooth.

    Also I got a weird problem. When I provision both boards with one on sensor server and the other on sensor client. And after that I try to click the onboard buttons to send data, it works normally I think. When I click a button on the server board, the client recieves a bunch of data (No idea where that data comes from because I think the server just sends a variable and not a bunch of text aswell). But when I turn off the client for a few seconds and turn it back on, only the data from the server board gets read on the client, but when I click a button on the client, then it said transmission false. Like the board can't recieve data back for some reason.

  • Chriis said:
    Overall that page is just reference to reference so that is extremely hard to normally read and hard to understand if you are just beginning with mesh.

    Yes, overall it is a reference to everything you need to know to understand the server sample located in <nRF5 SDK for Mesh InstallFolder>/examples/sensor, and I do agree that it is hard to follow if you're relatively new to Mesh so I understand the frustration which it might induce, but unfortunately this is where the entry level for applications such as these lies.

    Chriis said:
    But I am trying to figure out what part of the code includes the mocked sensor data and sends that data over bluetooth.

    Have a look at static void app_sensor_get_cb and static void button_event_handler(uint32_t button_number) in server/src/main.c and follow the code with some breakpoints 

    Chriis said:
    (No idea where that data comes from because I think the server just sends a variable and not a bunch of text aswell).

    Are you able to locate where in the code you find the same strings of text as is printed?

    Chriis said:
    But when I turn off the client for a few seconds and turn it back on, only the data from the server board gets read on the client, but when I click a button on the client, then it said transmission false. Like the board can't recieve data back for some reason.

    I will have to look into this behavior to see if it is as expected or not. 

    ---

    Since you mention that you're a beginner with Mesh: if your project allows you to use nRF Connect SDK instead of nRF5 SDK for Mesh, I can recommend you the following resources to get you started and to expand your knowledge with both the new SDK and Mesh:

    I addition to the documentation you linked, I would like to recommend you to have a look at these two webinars regarding Bluetooth Mesh:

    1. https://webinars.nordicsemi.com/introduction-to-bluetooth-mesh-4
    2. https://webinars.nordicsemi.com/developing-bluetooth-mesh-products-4

    The first webinar is only a concept introduction, while the second webinar shows you how to modify the Light and switch samples and should explain how to add a vendor model to the samples.

    In addition, if you're new or intermediate with nRF Connect SDK and Bluetooth Low Energy, I do also recommend you have a look at 

    1. https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/i Introductory course to nRF Connect SDK. I recommend you start here if you ever switch over to NCS from nRF5 SDK.
    2. https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/ will be a good supplement to familiarize yourself with Bluetooth Low Energy, which Bluetooth Mesh is based on. It is not quite the same, but it will break down the abstraction somewhat more. 

    Kind regards,
    Andreas

  • Hey, I have been working on mesh the last week. Now I have created a program with a working LPN that reads sensor data. Now I need to make a working Friend Node.

    I base my code of the sensor client example and the light switch server. I want the functionality of the sensor client but including friend functionality. however I can't seem to find what enables Friend funcionality on the light switch server.

    I use SDK for Mesh V5.0.0

    When I try to enable Friend in nrf_mesh_config_core.h and compile it gives these errors. What Do I need to add or what am I missing?


    What enables the friend functionality on the light switch server? 

    And what do I need to implement in the Sensor client program to be able to friend it?

  • Glad to hear that you got the LPN working!

    Based on the error messages it looks like you need to add some missing .c/.h files to your project. Could you look items such as "undefined reference to 'friend_needs_packet'" in your SDK and see in which files they are located? I believe you might be missing friend.c and mesh_friend.h, similarly to what you can see in this case

    Kind regards,
    Andreas

  • Hey, 

    you are right.

    I missed the friend.c file. Implemented it and it works.

Related