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

Get temperature and heartbeat data after mesh provisioning

Hi dear Nordic engineers and enthusiasts,

I am currently testing and researching on the functionalities of Nordic Thingy 52 in Bluetooth Mesh. I have tested with the provided mesh provisioning demo:

https://github.com/NordicPlayground/thingy52-mesh-provisioning-demo

and it is indeed cool.

In the mesh demo, the client is able to send a message (button pressed), and then the server which subscribe will react eventually. It works well.

Now it comes to my question that is it possible for the servers (the lamps for instance, thingy in the case here) to send the pass the following messages on via (in) mesh network to a gateway (e.g. Raspberry Pi 3):

  • Message 1: their temperature data collected
  • Message 2: their heartbeat data, to tell how long their battery can still last

I had tried to understand the codes behind the mesh provisioning demo provided by Nordic. It seems that heartbeat.c publish heartbeat message, but I am still figuring the way to retrieve this message at the gateway. Besides, the temperature data should be able to be passed via the mesh network right?, beside the functionalities of button pressed, e.g. in the GPIOTE_IRQHandler.

I sincerely appreciate your time and effort looking into this concern. Thank you so much! I am looking ward to hearing from you.

Best regards,

  • Hi,

    In the provisioning demo, if you configure the publication address of the light bulb (the server), it will send a message to the publication address when the state is changed. You can make your own model to do similar thing to report the temperature. 

    I don't think you can add the battery status to the heartbeat. It meant to have only the initial TTL to know how far a node is to the other. 

    You can think of using health message instead. But it also has a limitation that the client has to subscribe to the server. Group address is not possible. 

    In your case I would think of making your own proprietary model to broadcast data about the battery. 

    Note that the demo was based on an old SDK: v2.2. The current SDK is v3.1 . I would suggest to start your development on a new SDK. 

  • Hi Hung Bui,

    Thank you for your kind reply and insights. I have some following questions:

    1. If GPIOTE_IRQHandler is responsible for handling the event generated by a button press, then which will it be for access to the temperature data? Do I have to generate UUID, or write on CCCD (Client Characteristic Configuration Descriptor), for forwarding the temperature sensor data? 
    2. Thanks for the correction. You are right, Heartbeat msg are for telling whether the node is still active and how far the recipient is from it. As you mentioned about health message, the health_server.c sends the attention about the faults of the node. What is of my concern is that whether is it possible that the node will forward its status of e.g. low battery, let's say less than 5% of battery, using the nodes in the mesh as hopping points to pass the data to the gateway. In the end, the low-battery-node (faulty node) could then be located and replaced before its operation stop.

    I appreciate your time Hung Bui. I hope to hear from you again.

  • Hi,

    1. What do you meant by "temperature data" ? Are you planning to have an external temperature sensor ? Or you want to collect the temperature data from the internal sensor ? If you plan to collect the temperature internally on the chip, you need to call sd_temp_get()

    2. You can configure the health client to send the health message to the gateway and it will be forwarded by other nodes to the gateway. But the gateway need to subscribe to that health client. And other nodes wouldn't read that message, they will only forward. 

  • Hi Hung Bui,

    1. By 'temperature data' I refer to the data that are collected by the internal sensor of thingy in a Bluetooth mesh network. (Actually my concern is how to retrieve and manage data sent in a mesh network, it could be humidity data as well). Is sd_temp_get() a method in the actual thingy firmware project? I couldn't find the method neither in thingy52 mesh provisioning demo project nor in ble_app_thingy_s132_pca20020.uvprojx.
    2. Thank you! I've got it now. What is needed to be done are programming the subscription of the gateway to the health client and followed by sending of health message from health client to all the subscribers. Okay I will implement it this way.

    Thanks again!

    Best regards,

  • Hi Boon, 

    I'm not sure why SES couldn't find it. But if you have a look at the nrf_soc.h file, you can find the SD_TEMP_GET API call defined. 

Related