Why my end device leave and join the same network on every Power reset ?

  • I am using the DIGI SMT 32k module and configure that Module as end device by writting the function as mention below…

void Write_ZS_Para(void)
{

unsigned char cmd[2];

cmd[0]= 'Z';
cmd[1]= 'S';

xbee_cmd_simple (&xdev,cmd,2);

cmd[0]= 'S';
cmd[1]= 'M';
xbee_cmd_simple (&xdev,cmd,4);

cmd[0]= 'S';
cmd[1]= 'P';
xbee_cmd_simple (&xdev,cmd,200);

cmd[0]= 'S';
cmd[1]= 'T';
xbee_cmd_simple (&xdev,cmd,65530);

cmd[0]= 'A';
cmd[1]= 'C';
xbee_cmd_simple (&xdev,cmd,1);

cmd[0]= 'W';
cmd[1]= 'R';
xbee_cmd_simple (&xdev,cmd,1);

}

  • But problem is … When I am Switch OFF my End device and Switch ON … at that time …end device leave the network and join the same network again…

  • As I have written “WR” after finishing all command in my function … Once it join the network ,it must not leave the network … AM I correct?

  • Why my end device leave and join the same network on every Power reset ?

  • Waiting for your valuable reply.

Did you configured the router/coordinator properly? http://www.digi.com/wiki/developer/index.php/XBee_Sleeping_Problems

I have configure SP , SN and ST value in router same as end device that is

SN =1;
SP = 200;
ST = 65530;

And In coordinator set the SP = 200…

  • Can you tell me the function that used to change the local RF parameter … mean to say function for local AT command… As you can see I have used function

cmd[0]= ‘Z’;
cmd[1]= ‘S’;

xbee_cmd_simple (&xdev,cmd,2);

for profile set… Can used the same for “WR” local AT command ?

If Yes then What will be the value do I need to enter in

cmd[0]= ‘W’;
cmd[1]= ‘R’;

xbee_cmd_simple (&xdev,cmd,2);

in to third function argument… ?

Maybe I’m not userstanding your question, but if you ‘pin-sleep’ the Xbee, then when it wakes it should not need to rejoin (assuming the parent Sn/SP is correct). It wakes and automatically contacts it’s parent. The same is true for SM=4 (which you have in your example).

However, if you power the Xbee off, when it regains power it will attempt to rejoin the last network it belonged to. It will always attempt to first join the same network it connected to before power was lost, but if you leave the ID (PAN ID) value a default of 0, then it has the right to give up on the old network and seek a new one.

You certainly can use WR at a local console. Before worring about this more, I would read each of your settings and see if they retained the desired values after a power cycle. If they did, then your WR worked, but I am quite sure after power down/up, the node must (or will) rejoin.

  • In my router code …I am writting the ZS =2 at every power ON… but in that I never seen … when router get power OFF to ON and it leave the network and Rejoin again…

  • Where as in my end device found that when my unit get power off and Power ON then enddevice leave the network and rejoin the same network again…

  • Why this happening only in endevice … did I made and mistake in to setting RF paramater in to endevice?

Thanks,
Sandip Nandwana