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

how many device

Hi
I just have a simple question and that's where the code keeps Bluetooth mesh control how many devices it has in its stack that it has provides keys to.
for every time I restart an device, it's still in the mesh network, but the counter I've made thinks there is no one, so where can I keep track how many devices there are in the network

Parents
  • hello pca10056,

    Within Bluetooth Mesh, only the Provisioner device is aware of which devices have been configured into the mesh network and as such it is the sole arbiter of the make up of any single mesh network. It is also (via whatever persistent storage mechanism you choose) the only device within the mesh network that knows the mesh unicast addresses of all the nodes (along with other vital pieces of information).

    The current (v1.0) Mesh specification does not specify the format in which this mesh network meta-data is held or how an implementer should either backup that data or provide resilience/failover. I believe that there are moves afoot to establish a JSON type format for provisioning data which can be stored/accessed/restored etc.


    Within the Nordic stack, if you look at the light-switch demo, the client (which also acts as the provisioner) stores this data in persistent storage (flash). Look for the dsm_* for the persistent storage functions and specifically the provisioned_device_handles_load(void) function (in main.c) (see snippet below...) which determines the number of nodes that the light-switch client has provisioned/configured into its mesh..

    /**
     * Retrieves stored device state manager configuration.
     * The number of provisioned devices is calculated from the number of device keys stored. The device
     * key for each server is stored on provisioning complete in the `provisioner_prov_complete_cb()`.
     *
     * @returns Number of provisioned devices.
     */
    static uint16_t provisioned_device_handles_load(void)
    {
        uint16_t provisioned_devices = 0;

    Regards,

  • thanks, do not know if you can help with this too, but is there a way  the client can detect  that the node is turned off for a while, so the client not write to node, before the node is ready

  • hello,

    If you look at the latest v1.0.1 version of the mesh lightswitch demo, you will see that Nordic have implemented the Health client/server model. So every 10 seconds (although this is configurable) the provisioned/configured servers will publish a health status message back to the client.

    If the client fails to get a health status in any timeframe from a specific server node then you could determine that the server node is not ready or functional and base your firmware logic off that.

    Let us know if you need any additional clarification.

    Regards,

Reply
  • hello,

    If you look at the latest v1.0.1 version of the mesh lightswitch demo, you will see that Nordic have implemented the Health client/server model. So every 10 seconds (although this is configurable) the provisioned/configured servers will publish a health status message back to the client.

    If the client fails to get a health status in any timeframe from a specific server node then you could determine that the server node is not ready or functional and base your firmware logic off that.

    Let us know if you need any additional clarification.

    Regards,

Children
Related