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

adding Simple_on_off Model to light_switch example and provision and configure it with provisioner example.

Hi 

  I am using Mesh SDK v4.2.0 and I want to add Simple_On_Off Model to the Light_Switch example and provision and configure it with the provisioner example.

So far I have added Simple_On_off Model to the Light_Switch example and can provision it with provisioner but it shows while configuring the model

                      node_setup.c,  282, opcode status field: 2 

 The issue is in provisioner in node_setup.c but could not solve it, need some advice.

Regards

Himanshu

  • Hi,

    The provisioner example is made specifically for the (unchanged) examples from the SDK. It uses the unique Uniform Resource Identifier (URI) from the beacon of the other examples, in order to figure out what models to expect. This means that the provisioner expects to configure generic on/of models after provisioning a light switch example. If you have changed the example, then the number and type of models may differ from what the provisioner example expects. You then have to change the provisioner example as well.

    Regards,
    Terje

  • Hi,

     Thanks for the response.

    Can you explain what are the changes needed to be made in the provisioner to provision and configure other models?

    Right now I want to provision and configure Simple_On_Off Model.

    Regards

    Himanshu

  • Hi,

    You need to look into (at least) the following files:

    • node_setup.c
    • config_scenarios.h
    • config_steps.h

    and add the code required for the devices, models and configuration steps that you need. Please note that the comment about "setup_select_steps()" in some of those files is out-dated.

    You should also consider using a new URI for your modified example. URIs are defined in example_common.h, and then you need to both change the code of the on/off node to use the new URI, and the provisioner example to connect that URI to your new configuration steps.

    Regards,
    Terje

  • Hi,

      Thanks, for the response. You have been a great help.

    I have modified the light_switch server and client to do the task. They are working fine.

    Now I want to know if we can provision and configure multiple servers to a single client using provisioner example, if yes then how?

    Regards,

    Himanshu

  • Hi,

    The configuration needed depend on the use case: What direction do the data go, what are the involved models, etc. For instance, with light bulbs / switches, the light bulb is the server (as it holds the state) and the light switch is the client (as it sends messages to and from the server, in order to change the state on the server.) Because of this, for lights and switches, the switches are configured to publish to a group address, and the lights are set to subscribe to one or more group addresses, so that each switch controls a given set of lights. Those sets can overlap, so for instance one button can turn al lights on/off, while other buttons control a few or individual lights.

    I strongly recommend using the nRF Mesh app, for getting familiar with configuration, as with that app you do the configuration manually. Then decide on the needs of a dedicated provisioner device.

    Usually in a Bluetooth mesh network, the provisioner role is performed from a smartphone or similar. The provisioner example is for demonstration and development purposes. Even if you are working on a product that needs to get configured without any user interaction, it can be a good idea to do the configuration from a smartphone. At the very least, for the provisioning process one would usually want some interaction in order to confirm that the device being provisioned is the correct one.

    Regards,
    Terje

Related