EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: danergo2 on April 22, 2016, 07:43:10 am

Title: [Bitcloud] Message transmitting to ED
Post by: danergo2 on April 22, 2016, 07:43:10 am
Hi,

another question has been come up to me this morning.

if CS_END_DEVICE_SLEEP_TIME is set correctly, and I call APS_DataReq from the Coordinator to send something to an ED,
will the stack know that the ED might be in "sleep" at the moment, and do some kind of buffering?
What I mean would the APS_DataConf be called right after APS_DataReq or it will wait for CS_END_DEVICE_SLEEP_TIME?

So, in general is it enough and reliable to only do a simple APS_DataReq? Or I need to handle by hand to store a message in the memory until I hear from ED and then send to it?

Thank you!
Title: Re: [Bitcloud] Message transmitting to ED
Post by: ataradov on April 22, 2016, 09:54:00 am
will the stack know that the ED might be in "sleep" at the moment, and do some kind of buffering?
Yes and yes.

What I mean would the APS_DataConf be called right after APS_DataReq or it will wait for CS_END_DEVICE_SLEEP_TIME?
It will wait for ED to check in, but total timeout can be up to CS_END_DEVICE_SLEEP_TIME * 1.5 or some thing like this.

So, in general is it enough and reliable to only do a simple APS_DataReq? Or I need to handle by hand to store a message in the memory until I hear from ED and then send to it?
With BitCloud, yes. In general ZigBee - no. According to IEEE 802.15.4 + ZigBee transaction will expire in ~7.5 seconds. Most manufacturers ignore this and hold the request for as long as required, but there may be some that don't.
Title: Re: [Bitcloud] Message transmitting to ED
Post by: danergo on April 26, 2016, 05:42:27 am
Thanks, Alex!

Let me ask one more thing.

Same scenario, but now ED wants to send data to C. If ED is sleeping at the moment, and I do an APS_DataReq(...), will it wake up immediately and send, or it will wait for the sleeping interval and send afterwards?


Thank you!
Title: Re: [Bitcloud] Message transmitting to ED
Post by: ataradov on April 26, 2016, 05:46:06 am
Same scenario, but now ED wants to send data to C. If ED is sleeping at the moment, and I do an APS_DataReq(...), will it wake up immediately and send, or it will wait for the sleeping interval and send afterwards?
If it is sleeping, then how would you do APS_DataReq()? If device can run the code, it is not sleeping.

And ED can send data at any time, it does not have to be synchronized with the parent in any way.

But remember that if you request APS ACK, then this ACK will be received though normal polling (1 second default).
Title: Re: [Bitcloud] Message transmitting to ED
Post by: danergo on April 26, 2016, 05:57:52 am
For sleeping I mean "SYS_EnableSleepWhenIdle". Sorry for the wrong phrasing.

So basically, ED is in idle, CS_END_DEVICE_SLEEP_PERIOD is quite large (like 30000 ms).
If the ED is in the middle of this period
Title: Re: [Bitcloud] Message transmitting to ED
Post by: ataradov on April 26, 2016, 06:02:31 am
or it will initialize the sending as soon as possible?
This.

There are 2 distinct time intervals that EDs follow:
1. Poll interval. This is typically very short (1 second by default). C (or R) will only send data to the ED after ED sends poll message (Data Request in terms of IEEE 802.15.4). So data rate towards ED is defined by this interval. Even if ED is fully awake at the moment, it still can't receive data faster than this interval.
2. Sleep duration. This is the bigger interval (can be minutes and hours). ED expected to send at least one poll request in this interval.
Title: Re: [Bitcloud] Message transmitting to ED
Post by: danergo on April 26, 2016, 06:16:36 am
Very clear and nice summary. Thank you very much.