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

Openthread message queue problem on router

Hello! I'm developing thread application with COAP communication. I've got problem with message queue on router. Everything works fine when operating as a child. I have cyclic interrupt for data sending. When my device is in DETACHED state, the message is enqueued. When connetcion is renewed all messages from queue are sent, one after another. Message is dequeued only when coap response handler returns no error. Queue is checked every cyclic interrupt, if there is no any message stored. When node is operating as a child, data flow is good and i can enqueue as many messages as queue size is. None of them is missing. On the other hand, when node is a router, i receive only 5 last messages. I'm monitoring queue parameters an it tells me there is a lot of space left. Despite this something happens to the rest of messages in queue. Coap acknowlegements mechanism provides that all stored messages are sent, so it looks like the problem is somwhere in queue.Does anybody know how to handle it?

Best Regards, Wojciech Rzepecki

Parents
  • Hello Wojciech!

    Unfortunatelly I don't have enough information to solve the problem.

    However i have some suspicious. When device operates as an end-device, it is enough for it to attach to the network in order to start sending data (since it always sends data via the parent).

    Router however participants in mesh forwarding, it has to gather knowledge about current topology in order to route packets. If you try to send all message from your application queue right after its state is changed, then probably packets will be dropped on mesh_forwarder layer. The whole process of route discovery should be very fast, but it is not instant.

    Do I correctly assume that you stop Thread (by otThreadSetEnabled function) on router and reenable it some time after - this is why you expirience DETACHED state on router? If this is the case, do you also call this function when you want to sleep as sleepy end device (this is not needed)?

    What you can do is to build OpenThread libraries with logs enabled. You need to change the log level here: github.com/.../openthread-core-default-config.h to OT_LOG_LEVEL_DEBG. After that, you can observe all logs on RTT.

Reply
  • Hello Wojciech!

    Unfortunatelly I don't have enough information to solve the problem.

    However i have some suspicious. When device operates as an end-device, it is enough for it to attach to the network in order to start sending data (since it always sends data via the parent).

    Router however participants in mesh forwarding, it has to gather knowledge about current topology in order to route packets. If you try to send all message from your application queue right after its state is changed, then probably packets will be dropped on mesh_forwarder layer. The whole process of route discovery should be very fast, but it is not instant.

    Do I correctly assume that you stop Thread (by otThreadSetEnabled function) on router and reenable it some time after - this is why you expirience DETACHED state on router? If this is the case, do you also call this function when you want to sleep as sleepy end device (this is not needed)?

    What you can do is to build OpenThread libraries with logs enabled. You need to change the log level here: github.com/.../openthread-core-default-config.h to OT_LOG_LEVEL_DEBG. After that, you can observe all logs on RTT.

Children
Related