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,

    I have just created 10 instances of client element/model on light_switch client node, the instances are created fine, checked in the debug terminal. 

    But the provisioner can only configure 3 models/elements as in the unchanged light_switch client example.

    My question is how can I configure multiple instances of clients from the provisioner.

     

    Regards,

    Himanshu

  • Hi,

    In the provisioner example, the file config_scenarios.h lists what configurations are to be performed for each scenario. For the CONFIG_SCENARIO_LIGHT_SWITCH_CLIENT_EXAMPLE scenario, CONFIG_ONOFF_CLIENT is listed twice, and so the provisioner will try to configure two generic on/off clients when it finds a light switch client. If you have added more generic on/off client models to the light switch example, then you can add more CONFIG_ONOFF_CLIENT entries in that scenario in the provisioner example.

    Note that the CONFIG_... macros are only listing steps, that will be performed by the function config_step_execute() in node_setup.c. This means those steps (the switch cases in config_step_execute()) will need an update as well, as for instance the step for configuring the on/off client uses the function server_pub_address_get() (also in node_setup.c) to figure out what address to publish to, and it has hard coded the use of two addresses: The client node is intended to have two on/off client models, which will have consecutive element addresses, and therefore if the client address is an odd number it will publish to the "odd" group, and if the client address is an even number it will publish to the "even" group. You probably have other requirements, and so you must change the existing implementation (or add a new one) that sets up the 10 client nodes with subscriptions and publications, so that they subscribe and publish to the right addresses for your scenario.

    Regards,
    Terje

  • Hi

    Thank you for your help. Now I am able to create 10 models of the client and communicate with servers on group address.

    Regards

    Himanshu

  • Hi, Him,

    I have provisioning prblems after change to the mesh v4.2  vendor model simple_on_off.  In the mesh_main.c , error occurs at models_init. Can you share how modify for provisioning?

Related