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

Consecutive messages latency problem

Hi,

I want to build a mesh network which includes least 12 server node an 1 client node. 

I used light_switch example to send 12 byte message packets to client node from each server node and I ran into some problems. The first of these is  the latency problem while sending consecutive messages from one server node with using timer. I debugged the code and the problem wasn't  about timer. Each time when timer flag sets, interrupt function works as it's supposed to be. In timer function, I used modified app_onoff_status_publish() function that can send 12 byte array message. This modified function also works without any problem when it's called by a button in button_event_handler(). The problem occurs when I set a timer to 2 second, the message publication works approximately in every 5-6 seconds while a indicator LED toggles its status in every 2 seconds. It means timer function works well. I also used ERROR_CHECK(app_onoff_status_publish()) function to understand problem. When the timer start to work end of the first 2s there wasn't any error but  at the second time  it gave Mesh error on the RTTViewer screen. After a quick research, I found something about segmented message and 11 byte issues and reduce the message array length to 10 Byte but problem not solved. What is the reason of this 5-6 second latency. How can I reduce this latency? 

My second problem is messages can overlap  sometimes when 4 server node connected to mesh network and publishing with close time intervals. Server nodes  publish a 12 byte message includes their unicast address information. When the message arrives to client side, there is no corruption in the message content expect for the node addresses. Do you have any suggestions to prevent this?

Any help would be appreciated.

Regards

Parents
  •   I found the error source in transport.c. Why I get this error while sending 12B message? First time it sends without problem when checking status with ERROR_CHECK() function but second time it gives this error with "Mesh error at 8" message. What is the relationship between this error and waiting 5-6 seconds? I have used RTTViewer to find exact  location of error and got this code. What does this error mean? What I have to do to get rid of error?

Reply
  •   I found the error source in transport.c. Why I get this error while sending 12B message? First time it sends without problem when checking status with ERROR_CHECK() function but second time it gives this error with "Mesh error at 8" message. What is the relationship between this error and waiting 5-6 seconds? I have used RTTViewer to find exact  location of error and got this code. What does this error mean? What I have to do to get rid of error?

Children
  • Hi.

    Sorry about the delay.

    The "Mesh error 8" (NRF_ERROR_INVALID_STATE is occuring because there is only allowed to send one Segmented message at a time.

    The message will be sent as a segmented message and reassembled on the peer side if one of the following conditions are true:

    NRF_ERROR_INVALID_STATE returns when;
    There's already a segmented packet that is being to sent to this destination. Wait for the transmission to finish before sending new segmented packets.

    ___

    You will either have to wait until you receive the NRF_MESH_EVT_TX_COMPLETE  event before sending again.
    Or you need to make sure that the requirements of the segmented message isn't met.

    Br,
    Joakim

Related