Post a new topicPost a reply Page 1 of 1   [ 5 posts ]
Author Message
 Post subject: XBee - ZB Cyclic Sleep
PostPosted: Wed Jul 04, 2012 12:13 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
Hi,
I want to ask how to make the Zigbee module (XBee-ZB) go into cyclic sleep?
First, I tried to change the modules parameters and write in the SM command (4) , in the router module, using the X-CTU program (I read in the X-CTU that when I change the SM into anything other than 0 it automatically changes the module into an end device). I also made sure that the SP in the coordinator equal to that in the end device. However, when I did that the Zigbees couldn’t communicate and no packets were received when the coordinator was sending to the sleeping “router”. Even when I tried to return the Zigbee module to the No Sleep mode (SM0) it didn’t work and the router never returned to receive any packets from the coordinator. It only can send to the coordinator. I tried to reload the firmware again, sometimes it worked but the last time it didn’t.
Second, I left these two modules and worked on another two, but this time I didn’t play in their parameters or change the SM commands (No play in the X-CTU) I tried to give the zigbee the command for cyclic sleep through the waspmote program I used this function:
Quote:
xbeeZB.setSleepMode(1);

And I put (4) instead of (1). But when I came to the sleeping period and tried to use this fuction:
Quote:
uint8_t asleep[3]={0xAF,0x00,0x00};
xbeeZB.setSleepTime(asleep); // Set Sleep period to 0,32 seconds

I couldn’t understand many stuff:
1-How ‘AF’ produced a sleeping period of 32 seconds! Or even 0.32 seconds. I mean what’s the coding here? How to make it 1 second or 2…?
2- do I put this same line code in the coordinator’s waspmote and it automatically would mean that it has to buffer the packet for this amount of time? Or it has another code?
3- I don’t really get the job of these functions: “Time Before Sleep” - “Number of Sleep Periods” - “Sleep options”. I read their parts in the guide but I still can’t fully understand what they exactly do. Are they obligatory and necessary functions to make cyclic sleep mode work correctly, or they are just extra options?

Thank You for your help.


Top
 Profile  
 
 Post subject: Re: XBee - ZB Cyclic Sleep
PostPosted: Thu Jul 05, 2012 11:03 am 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
I want to add to that i've tried to use the exact example for low power mode for XBee and i noticed that the Zigbee go into the cyclic sleep mode normally till it receives a message and then it keep awak. it doesn't go back to the cyclic sleep even though the codes for the cyclic sleep is in the loop function. it prompt that the sleep mode is set OK but then it also says that MAC received OK which indicates that the XBee is still awake (because when it is sleeping it can't get any MAC address, it prompt error in receiving MAC address) However, sometimes, randomly, it prompts "error in receiving MAC address" but this rarely happens after receiving a message. and it happens once or twice and then keep prompting MAC received OK

do you have any interpretations or solution for our problem?

Thanks


Top
 Profile  
 
 Post subject: Re: XBee - ZB Cyclic Sleep
PostPosted: Thu Jul 05, 2012 2:55 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7818
Smart Agriculture,

You should take into account that Coordinators and routers can not sleep. Only end devices allow sleep modes. Maybe this is the cause of your problems.

Besides that, after sleeping, you should wait a certain period to join again the network.

Let us know your comments.

Regards.


Top
 Profile  
 
 Post subject: Re: XBee - ZB Cyclic Sleep
PostPosted: Thu Jul 05, 2012 3:11 pm 

Joined: Mon Apr 30, 2012 10:28 am
Posts: 17
Ok I noticed this issue and I tried to change the XBee firmware into End Device, but still it sleeps as long there's isn't any coordinator around it. once I just open the waspmote with the coordinator (with no sending functions) the end device gets out of the sleep mode and never goes back! it's really wirred. that means we can never have a network with sleeping end devices which is exactly the opposit of their work!

could you please help with a detailed answer. (a code sample other than the example already there)

and please explain to me the functions "sleep options" "Time before sleep" "Number of sleep periods" and how to settle the sleep period
(how does 0xAF, 0x00, 0x00 in this code
Quote:
uint8_t asleep[3]={0xAF,0x00,0x00};
xbeeZB.setSleepTime(asleep); // Set Sleep period to 0,32 seconds

means 0.32 seconds? what if i want to settle it to a different timing like 1 second or 2, how to write it? and the same question here:
Quote:
uint8_t awake[3]={0x13,0x88,0x00};
xbeeZB.setAwakeTime(awake); // Set time the module remains awake
I even don't know how long is that!


Top
 Profile  
 
 Post subject: Re: XBee - ZB Cyclic Sleep
PostPosted: Mon Jul 09, 2012 9:24 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7818
Smart Agriculture,

Regarding sleeping period parameter and other related ones, there is a mistake in our guide.

Values must be introduced in hexadecimal numbers, and they are 10 ms values For example:
for a 20 seconds sleep period you should use hex value 7D0 (2000 in decimal).
On the other hand AF0 value shown in guide corresponds to 28 seconds.

Sleeping period can be set from 32 ms to 28 seconds, and for larger periods you should use cyclic sleep.

We are fixing Zigbee programming guide for a better explanation of sleeping modes.

In the meantime, maybe you find useful Digi's documentation where also these issue is discussed.

Sorry for the inconvenience.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 5 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use