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 ,

    I have 1 provisioner and 1 server .

    Provisioner has 2 client , 1 client for group address, 1 client to match to server .

    I can send from provisioner to server by 2 way ok (simple_on_off_client_set and simple_on_off_client_set_unreliable) . But I still dont receiver data from server . I follow example light switch client at SDK 1.x . Can you show me the code at this example  for the function receiver data from server of client . Thank !!!

  • In the example, the client receive data from the server by the status message reply to the set command of the client (handle_status_cb() with SIMPLE_ON_OFF_OPCODE_STATUS ) , it can also send its status when the client send a simple_on_off_client_get() to get the status. 

    By design, the command set/get should go from the client to the server, the server reply with its status. 

    If you want to send data from the server node to the client node, you can implement a client on the server node and a server on the client node as well. 

  • Hi, 

    In Provisioner has 2 client , client 1 for group address, client 2 to match to server.

    - Provisioner config for serrver : 

    LOG: Set: on/off server pub addr: 0x00FC

    - In side client 2 , I add code : 

        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Adding subscription to client\n");
        uint16_t element_address = PROVISIONER_ADDRESS + 2;
        nrf_mesh_address_t address = {NRF_MESH_ADDRESS_TYPE_INVALID, 0, NULL};
        address.type = NRF_MESH_ADDRESS_TYPE_UNICAST;
        address.value = 0x00FC;
        access_model_id_t model_id;
        model_id.company_id = ACCESS_COMPANY_ID_NORDIC;
        model_id.model_id = SIMPLE_ON_OFF_CLIENT_MODEL_ID;
        config_client_model_subscription_add(element_address, address, model_id);

    Why client of provisioner still dont receiver messager from server Node ?

    I still misunderstand where? 

    Thank

  • Hi Giang, 

    You are doing it incorrectly. config_client_model_subscription_add() is only used when you are a config client and you want to configure a remote node. I already explained this. 

    Have you really read the case I gave you in earlier answer?

    This case. Please follow it. I quoted here:

    Basically you need to call dsm_address_subscription_add() to add the group address to the DSM address database. And then call access_model_subscription_add() to assign the server model to listen to that address.

     

    In addition, when you call a function, always check for the return code to make sure there is not any problem with the call. You should not call config_client_model_subscription_add() without any check. 

     

    Please study the access_setup() function in the light switch client in SDK v1.0.1. In that example we setup 4 clients locally, assign publication address of the three server to three of the clients. And the last client, we assign the GROUP_ADDRESS (0xCAFE) to the publication address. In your case, you probably want to add the subscription address instead of publication address. Please study that function and let me know which part you don't understand. 

    How do you plan to send data from the server node to the client node ? I provided you 2 solutions , one is to send via STATUS reply, another is to send as a client (having another element on the server node to work as client) 

  • hello 

    how can i download the mesh SDK v1.x to try to understand how to configure manually the client with the provisioner in the same board ??? 

Related