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

mesh message issue

Hello!

I use light switch example in a 52DK with a 4.1.0 mesh SDK. I modified the original project and implemented the custom element model for sending arrays via mesh. it works fine, but with some issue. Then the client sends message , the server gets it but two times, instead of one. I am sure , that the client sends message only one time. Why it happens?

Parents
  • Hi,

    If you send unacknowledged messages, the light switch client example operates with a define APP_UNACK_MSG_REPEAT_COUNT which is set to 2 in main.c. This leads to the message sent two times on the application layer.

    For on/off messages this does not do any difference, as two consecutive on messages or two consecutive off messages has the same effect as only one of the respective message. Those are "idempotent" messages, i.e. the number of messages received doesn't change the resulting behavior.

    If your messages are not idempotent, you should either make them idempotent (for instance by adding sequence numbers and keep track of what message numbers have been received) or use acknowledged messages (that are only transferred once on the application level.)

    Regards,
    Terje

Reply
  • Hi,

    If you send unacknowledged messages, the light switch client example operates with a define APP_UNACK_MSG_REPEAT_COUNT which is set to 2 in main.c. This leads to the message sent two times on the application layer.

    For on/off messages this does not do any difference, as two consecutive on messages or two consecutive off messages has the same effect as only one of the respective message. Those are "idempotent" messages, i.e. the number of messages received doesn't change the resulting behavior.

    If your messages are not idempotent, you should either make them idempotent (for instance by adding sequence numbers and keep track of what message numbers have been received) or use acknowledged messages (that are only transferred once on the application level.)

    Regards,
    Terje

Children
Related