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

Segmented messages and access_model_publish()

Hello,

I have implemented functionality that enables me to send messages back and forth between two nodes in the network with a timer (both nodes has a server and client functionality). I.e. a client receives a message, starts a timer, and republish the message to the other node in the timeout handler of the timer. I am currently sending segmented messages due to the size, and I am aware that I can not have repeats when publishing unreliable messages due to the segmentation. However, when I am sending messages back and forth between my nodes, I expected that as long as repeats are set to zero, this would not be a problem no matter how fast I republish a message after it is received. But when my interval between the messages is below some threshold, I get the following error message for the first node: app_error_weak.c,  122, Mesh error 8 at 0x0002B501. This happens after the message is received one time. That is, I am able to send the message from the first node, then the second node receives it and republishes the message at the timeout (this works every time no matter what interval I use), and the first nodes receive this message but fails to republish due to the error described above. Why is this? If I set the time_ticks of my timer to approximately > 700, I am able to send the message back and forth with no occurring error, but if I reduce the time_ticks, the first node fails upon the second attempt to send the message.

I have tried to implement error handling regarding this problem, i.e. try to call access_model_publish() again after some time if it returns an error status, but with no success. Is there something I can do to fix this?

  • Hi. 

    Have you been able to track down where the Mesh error 8 (NRF_ERROR_INVALID_STATE) originates from?

    Maybe you can take a look at this previous ticket, and the suggestions from my colleague Hung?
    https://devzone.nordicsemi.com/f/nordic-q-a/51653/mesh-network/ 
    This ticket seems to have some similarities to your issue. 

    Best regards, 
    Joakim

  • Hi, Joakim,

    Indeed, my issues are very similar to the ticket you are referring to, and my mesh error originates from packet_tx() in access.c.

    I tried to change the parameters in a similar way as the guy in the ticket you are referring to, and now I am able to send consecutive unacknowledged messages in a much shorter interval than with the original parameters. Before, as I said earlier (which was a bad explanation), I could send consecutive unacknowledged messages from the same device/element approximately every 1400 ticks, that is 1,4 seconds, without getting the mesh error. Now I am able to send consecutive unacknowledged messages much faster. near 200 ticks (0,2 seconds) before the mesh error occurs.

    I know that the message I am sending is sent because I am starting an event at the other device when it receives the message. Therefore, it should not be several segmented messages ongoing at the same time. 

    So, what could this issue come from? Can I leave the parameters as it is now? I.e., TRANSPORT_SAR_TX_RETRY_BASE_TIMEOUT_DEFAULT_US  MS_TO_US(200) and TRANSPORT_SAR_TX_RETRIES_DEFAULT (2)? Or could that cause any problems later?

  • Hi again.

    Amadeus said:
    So, what could this issue come from?

    What issue are you referring to here?

     

    Amadeus said:
    Can I leave the parameters as it is now?

     If it is working without any errors, I don't see any reason that you couldn't use them. But you did refer to an issue (quote above)?

    - Joakim

  • Yes, the issue I am referring to is that I get a mesh error if I, from the same device, sends two unacknowledged messages with an interval of less than about 1,4 seconds. I do not understand why this mesh error occur, neither do I understand why tweaking the parameters referred to above helps. 

    Changing the parameters have not caused any deviation in functionality compared to before as far as I can see, and as long as I can keep them this way without fearing any problems in other parts of the code, I certainly will. However, I am curious to know what's causing the mesh error with the default parameters.

  • What kind of message are you sending back and forth?

    If the message payload is larger than 11 bytes, the packet will be segmented and it would take longer time to reach to the destination.

Related