Hi all,
I couldn't find another thread talking about this, so I figured I would ask it here and see if you could help me. I have a ZigBee network setup that uses the APS ACKs. The basic flow is end device sends a request to coordinator, coord acks it, sends a response message, and end device acks the response. What happens sometimes though is, for whatever reason, sometimes the end device doesn't ack the coord fast enough (this is ok, it is doing work so maybe just doesn't respond in time), so the coord sends a retry.
The problem I am having is that both the original message AND the retry are getting sent to my end device application message call back (the end device eventually acks them both, stopping retries, but the main problem is that my application is processing receiving that message twice). Both of the messages have the same APS sequence number (because one of them is a retry). Does the stack allow messages with the same APS sequence number to be delivered to the application? Is there a setting to not allow duplicate messages through to the application?
Thank you very much for your help.
Matt
Apparently so, and no. You will need to add a message sequence number to the Application layer data that you send using AF_DataRequest(), and then filter incoming messages at the Application layer based on this sequence number, which will be tedious since it will be different for every sender of data (so hopefully you only need to filter for one sender).
Hi Harry,
Thank you for your helpful information, but I still have some questions, I need your help.
1st When I use z-stack, I should add a message sequence number to avoid the duplicate frame, really?
I know the "SerralApp " example use a sequence number to avoid duplicate frame.
2nd If the Z-stack use the APS counter to filter the duplicate?
I can't find any operation of APS counter, if it is operated in the APSDE_DataReq( &req); The APSDE_DataReq is not open source
3rd What is the function of "transID" in APSDE_DataReq_t ?
Z-stack said that "transID" is used as the sequence number. For test I have set it always to 0xAA, but I didn't find any change when in transmit. Using the Packet Sniffer I can't find the "transID"(0xAA) in the Frame.
4th How does the NWK sequence number work in Z-stack?
NWK layer is not open soure code for user. so I am wondering about if the NWK sequence number can filter the duplicate.
thank you a lot !
Jerry Yao
You're not asking anything new - the question is answered, plain and simple: if you want to avoid duplicate messages, add a message identification (i.e. counter) to your Application layer payload.
Don't burn your precious time wondering/worrying about what you cannot see or control (i.e. the variables/counters used by the libraries). Focus on what you have control over: your Application layer payload.
ZigBee is not TCP/IP, get used to it or find a different protocol to solve your problem. As an aside, take a look at the ZCL - maybe you can solve your problem by using a ZCL Profile, in which case, the ZCL does all of that messy filtering work for you.
Hi Harry, You are right, thank you very much!