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

multicast only received by CoAP server not client

Hey Nordic devzone,

I am tinkering with the following multiprotocol examples: ble_thread_dyn_mtd_coap_cli (client) ble_thread_dyn_template (server)

Currently the client can be controlled using the BSP buttons or a smartphone with the nordic toolbox apps.

When I press a BSP button 2 on the client a multicast message gets send out to the servers to turn on the light. I have altered the ble_thread_dyn_template to setup a connection with a thingy52, on when it does it sends out a multicast message with the thingy52 MAC address and the IPv6 peer address. Only this message is only captured by all the other servers not the client in this case.

I altered the function :

static void thread_coap_init(void)
{
    thread_coap_configuration_t thread_coap_configuration =
    {
        .coap_server_enabled                = true,
        .coap_client_enabled                = false,
        .coap_cloud_enabled                 = false,
        .configurable_led_blinking_enabled  = false,
    };

    thread_coap_utils_init(&thread_coap_configuration);
}

To set the coap_server_enabled to true, where before the coap_client_enabled was set to true. My application still works the same but the ble_thread_dyn_mtd_coap_cli example is still not picking up my multicast messages.

It most likely has to do with the scope in the function : thread_coap_utils_multicast_light_request_send

switch (scope)
{
case THREAD_COAP_UTILS_MULTICAST_LINK_LOCAL:
    p_scope = "FF02::1";
    break;

case THREAD_COAP_UTILS_MULTICAST_REALM_LOCAL:
    p_scope = "FF03::1";
    break;

default:
    ASSERT(false);
}             

If i check the IPv6 thread addressing site I can see the following multi cast adressing 'domains'

ff02::1	Link-Local	All FTDs and MEDs
ff02::2	Link-Local	All FTDs and Border Routers
ff03::1	Mesh-Local	All FTDs and MEDs
ff03::2	Mesh-Local	All FTDs and Border Routers

Would I need to alter the switch to include any of the other multicast scopes?

Thanks in advance for any tips

Parents
  • Hey Hung,

    I erased the flash on the client side that seems to have helped. The client is now receiving the messages. Although it is warning me that the messages are not of the right format:

    <info> app: Received CoAP message that does not match any request or resource
    

    I added my coap messages in thread_coap_utils.c & .h and compiling both versions with the same files. Will hook up the sniffer and see if I can find what is going wrong.

Reply
  • Hey Hung,

    I erased the flash on the client side that seems to have helped. The client is now receiving the messages. Although it is warning me that the messages are not of the right format:

    <info> app: Received CoAP message that does not match any request or resource
    

    I added my coap messages in thread_coap_utils.c & .h and compiling both versions with the same files. Will hook up the sniffer and see if I can find what is going wrong.

Children
No Data
Related