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

How can I get the number of nodes (or devices) in the mesh network?

Hi there.

This is my first time to utilize BLE mesh of NRF5.

I just wonder that the library supports getting the number of nodes in the mesh network.

When utilizing the ble central and ble peripheral, getting rssi or physical address can be easily done

by using library for example, sd_ble_gap_rssi_get(m_conn_handle,&p_rssi,&p_ch_index)

Is there a fuction getting the number of existing nodes in the mesh network?

Parents
  • Have a look at this question might be of help:
    https://devzone.nordicsemi.com/f/nordic-q-a/32953/how-many-device.

    "Only the Provisioner device is aware of which devices have been configured into the mesh network"

  • Hi,

    You can find the number of devices provisioned in this struct: network_stats_data_stored_t.

    /** Structure to store the state of the provisioning process of the network nodes */
    typedef struct
    {
        uint16_t provisioned_devices;
        uint16_t configured_devices;
        uint16_t last_device_address;
        uint16_t next_device_address;
        const char * p_client_uri;
    
        uint8_t  netkey[NRF_MESH_KEY_SIZE];
        uint8_t  appkey[NRF_MESH_KEY_SIZE];
        uint8_t  self_devkey[NRF_MESH_KEY_SIZE];
    } network_stats_data_stored_t;
    
    #endif /* NETWORK_SETUP_H__ */

  • Thanks Mttrinh

    To my knowledge, only provisioner can know how many nodes and states of nodes in a network whereas provisionee can't.

    Then, Is it possible to make single device works as provisonee and provisioner at the same time?

    In my guess there is two categories in the nodes; provisioner and provisionee(the client and server in the light_switch example and the beaconing in the beaconing example).

    Thanks.

    For your information, I'd like to inform you our background.

    We' d like to install multiple BLE device of the same type in specific zones. Since it is hard to check whether each device is working by pairing individually, we' d like to use BLE mesh for checking it.
    Our idea is simple. If we install five devices in the same space, we periodically check the number of the nodes in the network for maintenance. If one of the devices are broken or runned out of its internal battery, the number of the nodes will change. Due to operational limitation, same types of devices can be installed in a zone rather than multiple kinds of devices.  

  • Hi,

    Yes, only the provisioner know how many nodes there is in the network. It is possible to have a single device be both a provisioner and a provisonee. We had an example where we combined the provsioner with client in Mesh SDK v1.0.1. I assume you want to combine them so that the node knows how many nodes there are in the network?

    I would suggest you have a look at the Heartbeat message for your use-case. It can be used to supervise the network. Heartbeat messages are transmitted by nodes periodically. A heartbeat message indicates to other nodes in the network that the node sending the heartbeat is still active. Also have a look at this post, it is a good starting point.

Reply
  • Hi,

    Yes, only the provisioner know how many nodes there is in the network. It is possible to have a single device be both a provisioner and a provisonee. We had an example where we combined the provsioner with client in Mesh SDK v1.0.1. I assume you want to combine them so that the node knows how many nodes there are in the network?

    I would suggest you have a look at the Heartbeat message for your use-case. It can be used to supervise the network. Heartbeat messages are transmitted by nodes periodically. A heartbeat message indicates to other nodes in the network that the node sending the heartbeat is still active. Also have a look at this post, it is a good starting point.

Children
Related