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

  • Hi, thank you for your reply. I use acknowledged message. 

Reply Children
  • Hi,

    In that case, at least as long as your application is based on the light switch client model example, your code works the same as generic_onoff_client_set(), and you only call it once for a message, that message should only appear once on the application layer in the receiving end.

    Can you share an example project, that can run on a DK, showing the behavior?

    Regards,
    Terje

Related