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

combine light switch and remore mesh don't control light

Hi all,

After I combile light switch example and remote example for my client and server board . Function Remote run fine . But when I push button for send unicast message . 2 board seem dont receiver correct .I define light switch and remote is different elements . I use Mesh SDK v2.0.1 . Show my picture : 

  

Please show me my mistake. Thank very much

  • Hi Giang, 

     

    Remote you mean remote provisioning client or server ? 

    I assume it's server. 

    If you have a look into the code (button_event_handler() ) you can find that  "Ignored. Node is not configured.\n" thrown when the light switch client is not configured. 

    You need to configure the client locally, in this case setting the publication address. It's similar to this case. Have a look at Mesh SDK v1.x to see how it works. 

  • Exactly what I do is : 

    1. Add provision remote client to light switch client.

    2. Add provision remote server to light switch server.

    I want client is gateway and servers is node , can remote and send data.

    But, I'm confused between choosing provisioner example is gateway.  Can you give me 1 correct model of mesh network ?

    And I have a question:

    1. When I use provisioner example + (light switch client + remote server - Node1) + (light switch server + remote server - Node 2) . Provisioner is provisioning and config for 2 node correct . But don't send data control light . If I delete code

     /* TODO: This should be handled by the configuration server model. */
        mesh_key_index_t net_key_index;
        uint32_t count = 1;
        ERROR_CHECK(dsm_subnet_get_all(&net_key_index, &count));
        m_netkey_handle = dsm_net_key_index_to_subnet_handle(net_key_index);
    
        uint8_t appkey[NRF_MESH_KEY_SIZE] = {0};
        ERROR_CHECK(dsm_appkey_add(0, m_netkey_handle, appkey, &m_appkey_handle));
        ERROR_CHECK(dsm_address_publish_add(PROVISIONER_ADDRESS, &m_provisioner_address_handle));
        ERROR_CHECK(access_model_application_bind(m_remote_server.model_handle, m_appkey_handle));
        ERROR_CHECK(access_model_publish_address_set(m_remote_server.model_handle, m_provisioner_address_handle));
        ERROR_CHECK(access_model_publish_application_set(m_remote_server.model_handle, m_appkey_handle));
        ERROR_CHECK(access_model_publish_ttl_set(m_remote_server.model_handle, 6));
        ERROR_CHECK(pb_remote_server_enable(&m_remote_server));
        ERROR_CHECK(pb_remote_server_prov_bearer_set(&m_remote_server, nrf_mesh_prov_bearer_adv_interface_get(&m_prov_bearer_adv)));
    

    in each Node . It send data control light correct . But remote function of each Node don't run if I use remote client example for provisioning . 

    How I can use both remote function and control light function ?

    Can you explain for me the meaning of the above code?

    2. Can I use provisioner example for config Node ?

    Thank very much !

  • Hi ,

    After I using light switch client provisioning for light switch server . I only need use access_model_publish_address_set for Set publish address for the client to the corresponding server . We can send data to each other . It correct ?

  • There are 2 separated procedures, one is provisioning and second is configuration. Have a look here.

    The remote provisioner only do the provisioning part. You need a configuration client to do the configuration part. This is handled by node_setup.c and provisioner_helper.c 

    If you simply combine the light switch example and the remote provisioning example, you won't be able to configure the server. In addition, the light switch client need to be configured as well. 

    Configuration is the process of exchanging&binding the application key and assigning publication/subscription address. That what you need to do. Without configuration, your nodes won't function. 

    To understand the process of provisioning and configuration, I strongly suggest you to try playing with the interactive python script we have. The instruction is here.

Related