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

Change The Subscription Addresses Of Client In Mesh

Hi,

I am working on light switch example. I am broadcasting a message from client to servers using the API access_model_publish() with the opcode SIMPLE_ON_OFF_OPCODE_SET_UNRELIABLE. there are 3 servers in total, 0x105, 0x106, 0x107. Even though message is delivered in all three servers, I am getting the status of only  two servers (0x105, 0x106). I am taking this status from the function handle_status_cb() of the simple_on_off_client.c code. Why I am not able to get the status of the third server? I guess this is because client is only subscribed to 0x105 and 0x106. I need status of two more servers. In order get the status of remaining servers what configuration should I change?  

  • Hi!

    I'm sorry about the delay.

    Have you made any progress on your issue?

    I'll get back to you by the end of the day with an answer for you.

    Best regards,
    Joakim.

  • Hi Joakim,

    Thank you for replying. I have some doubts. Hope you will be able to help. Creating new case for each of them might take some time to get answered. That's why I am asking here. I have made some progress.

    I want to make several servers to send message to client. Client should receive their uni-cast address too. I looked through node_setup.c and found that I have to change a whole lot to make that happen. I don't need group cast, just uni-cast method. Each server should send message to client with their unicast address. Is that possible?

    I have another doubt too. Is there anyway I could find the current ttl value of the node? With each hop ttl decrements right?  I want to know whether the message is initiated by current node and/or how many nodes message have hoped to get the current node.

    Can I receive a string message that I send from server to client from the function handle_status_cb() through access_message_rx_t. Or is it only possible through mesh_evt_cb()

    Thank you

    Arya

  • Arya said:
    I want to make several servers to send message to client. Client should receive their uni-cast address too. I looked through node_setup.c and found that I have to change a whole lot to make that happen. I don't need group cast, just uni-cast method. Each server should send message to client with their unicast address. Is that possible?

     Yes, you can use unicast address for sending messages to a particular node. You can find out how the light switch client node sends unicast messages to the server by taking a look at the button_event_handler() in the main.c file. The simple_on_off_client_set() function will send a unicast message to the first provisioned & configured server when button 1 is pressed on the client. 

    The simple_on_off_client_set() then calls access_model_reliable_publish(), which is where the unicast address of the server gets retrieved via the dsm_address_get() function.

    The unicast address also gets displayed in the provisioner during the app_health_event_callback() function in main.c

  • Hi Joakim,

    We can send unicast message to only two servers right (0x105, 0x106)? That is why I am getting status back to client only from them right? I want to get status of some more servers in client. How is that possible? Should I change everything in node_setup.c?

  • Hi Joakim, How can I send message to the client from servers 0x0107 and 0x0108? Is it possible? I looked in node setup.c and found that we have to more clients to do this. Is there any other way?

Related