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,

Reply
  • 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,

Children
Related