Autoconfiguring of heartbeat destination and source nodes for nRF52840dongle

Hello,

I'm here again because this time I need to autoconfigure (configuring from inside program, no use of any nrf app) heartbeat destination node and source node.

For destination node, my idea could be this:

struct bt_mesh_cfg_cli_hb_sub hb_sub = {
			.src = 0x42,
			.dst = 0xFE,
			.period = 10,
			.count = 1,
			.min = 1,
			.max = 1,
		};
		res = bt_mesh_cfg_cli_hb_sub_set(net_idx, 0xFE, &hb_sub, NULL);

where:

  • 0x42 is the unicast address of heartbeat source
  • 0xFE is the unicast address of heartbeat dst
  • net_idx is the network index

For source node, my idea could be this:

struct bt_mesh_cfg_cli_hb_pub hb_pub = {
			.dst = 0xFE,
			.count = 100,
			.period = 1,
			.ttl = 5,
			.feat = 0,
			.net_idx = net_idx,
		};
		res = bt_mesh_cfg_cli_hb_pub_set(net_idx, 0x42, &hb_pub, NULL);

where:

  • 0x42 is the unicast address of heartbeat source
  • 0xFE is the unicast address of heartbeat dst
  • net_idx is the network index

These snippets are placed where the program executes autoconfiguring for chat and light/light switch models.

Questions:

  1. Is this the right way to autoconfigure heartbeat models?
  2. For source node, in my example feat = 0: does this mean that heartbeat begins after reset, with no need of any trigger events?
  3. Is there a callback function for every received heartbeat message of destination node, in which I can insert some log_info instructions to verify that something is working?

Thanks in advance for your help and best regards

Parents
  • Hello,

    Sorry for the late reply. I saw that you managed to figure out the issue in your previous ticket, regarding auto-binding in Bluetooth Mesh. Our samples are made with a provisioner in mind, so I wouldn't know exactly how to do this without one. 

    Is this the right way to autoconfigure heartbeat models?

    I am not sure. Does it work?

    For source node, in my example feat = 0: does this mean that heartbeat begins after reset, with no need of any trigger events?

    Yes, I think so.

    Is there a callback function for every received heartbeat message of destination node, in which I can insert some log_info instructions to verify that something is working?

    For the callback, please see my colleague, Hieu's, reply here. If you are not sure whether your callback is working, please test it with a provisioner first, to make sure that it is actually being sent. 

    Best regards,

    Edvin

Reply
  • Hello,

    Sorry for the late reply. I saw that you managed to figure out the issue in your previous ticket, regarding auto-binding in Bluetooth Mesh. Our samples are made with a provisioner in mind, so I wouldn't know exactly how to do this without one. 

    Is this the right way to autoconfigure heartbeat models?

    I am not sure. Does it work?

    For source node, in my example feat = 0: does this mean that heartbeat begins after reset, with no need of any trigger events?

    Yes, I think so.

    Is there a callback function for every received heartbeat message of destination node, in which I can insert some log_info instructions to verify that something is working?

    For the callback, please see my colleague, Hieu's, reply here. If you are not sure whether your callback is working, please test it with a provisioner first, to make sure that it is actually being sent. 

    Best regards,

    Edvin

Children
  • Hello,

    here are the summary of the answers to my questions:

    1. Yes, it works! The snippets I proposed are the correct ways to autoconfigure heartbeat source and destination nodes
    2. Yes
    3. I read Hieu's reply and, thanks to it, I managed to realize a perfectly working callback function

    So, now I have an autoconfigured heartbeat source node which sends heartbeat messages to an autoconfigured heartbeat destination node, and this sends  a note through serial channel everytime a heartbeat message is received.

    Very good.

    Thanks to all of you for your help

Related