This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I'm quite new to ZigBee and Z-Stack. I'm trying to send messages to sleeping end devices by using indirect messaging. I'm using sample light and sample switch for testing purposes. The indirect messaging itself works, but I can't get error messages out of the system for buffer overflows. I'm having two different configurations, where I'm trying to get different outcomes. I have ZStack-MSP2618-2.2.0-1.3.0 in use.
Case1:
Coordinator - Router - End device
Coordinator and router are sample switches and end device is the sample light. I bind coordinator and end device, so they are working together nicely. I have increased the msg hold time for router and coorinator to 30mins and set the maximum msg hold number for devices to 3:
nwk_globals.c:
// To hold msg for sleeping end devices for 30 mins:
#define CNT_RTG_TIMER 60
#define NWK_INDIRECT_MSG_TIMEOUT 30
// Maximum msgs to hold per associated device.
#define NWK_INDIRECT_MSG_MAX_PER 3
I have increased the polling rate for end device to 10seconds so messages will surely be queued so the buffer will overflow in that time frame.
So what I'm trying to accomplish here is to find out, how to make router send Network Status Command (see ZigBee spec) with status code "0x05 No indirect capacity" back to message originator (here it would be the coordinator). I'm sending more than 20 messages between the end device polls. From packet sniffer I can see that all messages are sent to router and acknowledeged, but router never sends the Network Status Command "0x05 No indirect capacity". I have also tried the scenario by disabling the end device polling, and the outcome is the same. Any ideas?
Case2:
Coordinator - End device
Same settings as in case1. Here I'm trying to get TRANSACTION_OVERFLOW error (see 802.15.4 spec) to application level. Like in case1, I'm generating so many messages that it should make the overflow in coordinators indirect buffer. How can I catch the TRANSACTION_OVERFLOW error?
Thanks,
Markus
Still struggling with this. I switched to ZigBee Pro, but I haven't made any progress.
In case2 I printed to terminal event and status codes from function "void MAC_CbackEvent(macCbackEvent_t *pData)" in file zmac_cb.c, but status is never the MAC_TRANSACTION_OVERFLOW 0xF1, defined in mac_api.h, even thought the buffers should overflow. (Is this the right function?)
Any ideas would be deeply appreciated,
Markus
Mayby I should also say that I'm using simple API also for testing.
I've made some progress. I noticed that it gives no extra value to print status and event variables in MAC_CbackEvent function, since the status value raises to application level to call back function zb_SendDataConfirm.
I am generating 15 messages to sleeping end device. I've been able to get status message MAC_TRANSACTION_EXPIRED 0xF0 "indirect data transmission failed because the peer device did not respond before the transaction expired or was purged".
I still wonder why I don't get the buffer overflow status, since I've increased the hold times for indirect messages:
nwk_globals.c:
// To hold msg for sleeping end devices for 30 mins:
#define CNT_RTG_TIMER 60
#define NWK_INDIRECT_MSG_TIMEOUT 30
#define NWK_INDIRECT_MSG_MAX_PER 3
f8wConfig.cfg:
-DNWK_INDIRECT_MSG_TIMEOUT=60000
I also noticed something strange. I number the messages I'm sending to sleeping device. I can notice that it sends correctly first three messages 0, 1, and 2, as it's supposed to. After that when sleeping device later polls for data, it receives message 0 at first poll and message 1 with second poll, and this goes on forever. I guess I'm doing something very wrong, since it looks like the buffer never empties itself.
I'll be reporting about my progress later. I wouldn't mind if this thread wouldn't continue as a monolog [:D]
Markus_S said:I also noticed something strange. I number the messages I'm sending to sleeping device. I can notice that it sends correctly first three messages 0, 1, and 2, as it's supposed to. After that when sleeping device later polls for data, it receives message 0 at first poll and message 1 with second poll, and this goes on forever. I guess I'm doing something very wrong, since it looks like the buffer never empties itself.
This was something strange and it's not happening again.
I studied the ZigBee spec and it says that the network layer should generate network status indication and pass it to next higher layer in case network layer has failed to deliver the frame to its child (1_053474r17ZB_TSC-ZigBee-Specification.pdf, chapter 3.2.2.30 NLME-NWK-STATUS.indication).
I found potential function (well, it's not network layers next higher layer(?) as ZigBee spec says) from nwk_globals.c "nwk_Status()", which I will start to study more next. With my premilinary study, I couldn't find any place in Z-Stack code that this function would be called.
Hello,
I'm not sure why you require a 30 min message timeout, but I think this is not the best way to architect the system? NWK INDIRECT MSG TIMEOUT should be set to something like 20 for a poll rate like 10 seconds. Try to match it like that. I don't know of a way to get the transaction overflow status. You should be able to get a buffer full status if you are trying to jam too many messages down to the nwk layer. If the end device only wakes up once in a while, you should only try to send messages when you receive one from it. The end device then should be awake until it received an application level acknowledgment from the source.
Best,
-- Double O
Hi,
Thanks for your reply Double O. Well the point isn't the 30min message timeout, but to get the notification back to sender when indirect buffer runs out of capacity. The problem is to make sure messages wouldn't dissappear (without using application level acknowledgements), so I would need the "0x05 No indirect capacity" notification (or similar).
E.g. network would consist of coordinator, router and 15 end devices, and all EDs would be routers childs. Now, if coordinator would send indirect messages simultaneosly to all EDs, some of those messages would dissappear because routers indirect buffer would run out of capacity (assuming the indirect buffer size is the default). Router sends MAC acknowledgement back to coordinator, even when it's indirect buffers are full, so coordinator doesn't know that some of the messages are dissappearing.
Since the routing/indirect mechanism works on lower levels in stack, I don't have an idea how to get the "No indirect capacity" notification. So would you have any suggestions how I could get the notification, or is this even possible? Or would you have any other suggestions how to find out when routers indirect buffer runs out of capacity?
Markus