Zigbee Network Forming

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Zigbee Network Forming

3,694 Views
zigbeefyp
Contributor I
Hi all,
 
I am currently working on  a zigbee project that is made up of 1 NCB and 2 SRB boards. I would like to automate the process of forming the network and binding the corresponding devices. May I know which part of the code should I edit to do so? Thank you! I'll be here on a long term basis because of my lack of knowledge in zigbee, please bear with me!
 
 
 
zigbeefyp
Labels (1)
0 Kudos
Reply
9 Replies

681 Views
Spell
Contributor I
Hi zigbeefyp,
First at all which codebase are you using?

If you are using Beestack codebase you must call at the end oh BeeAppInit the ZDO_Start routine for start automatically to join the network or to form the network.

regards, Filippo
0 Kudos
Reply

681 Views
zigbeefyp
Contributor I
Hi Filippo,
 
Thank for the reply.
I am using the freescale Beekit beestack codebase 1.0.2.
 
I have searched throught the coordinator's code and I can't really find the part on ZDO_start in the BeeAppInit.c. May I know the exact location in the code. By the way, I would like to find out in which part of the code can I locate the beacon request function. Thank you.
 
Regards,
 
zigbeefyp  
 
 
0 Kudos
Reply

681 Views
Spell
Contributor I
At the end of BeeAppInit routine in BeeApp.c file you must put this function:

Code:
void BeeAppInit (void){
.
.
.
ZDO_Start(gStartWithOutNvm_c);/* Start with one of the following modes:  *  gStartWithOutNvm_c                     *  gStartAssociationRejoinWithNvm_c       *  gStartOrphanRejoinWithNvm_c            *  gStartNwkRejoinWithNvm_c               *  gStartSilentRejoinWithNvm_c            */
}

 Remember, this must be the last function called in BeeAppInit routine otherwise the program doesn't work correctly.

I don't think there is some kind of code for the beacon functions because in beestack the beaconed network topology ins't yet implemented.

regards, Filippo



Message Edited by Spell on 2007-09-25 02:37 PM

Message Edited by Spell on 2007-09-25 02:37 PM
0 Kudos
Reply

681 Views
zigbeefyp
Contributor I
Hi Filippo,
 
Thanks for the reply.
 
The provided code work for my coordinator. Currently, my coordinator is able to form up the network automatically. Might i know does the provided code apply to the end device too? I would like my end device to join the network automatically, so i have placed the provided code in the end device code, but it seem that the code did not work for end device. So is there any addition code i need to add in in order to allow my end device to join the network after power up? In addition, is there any ways i can edit the code such that the coordinator and the end device is able to bind it themselves after they automatically joining the network? Really thanks for your time. Sorry about it as I just started to work with zigbee.
 
Regards,
 
Zigbeefyp 
 
 
0 Kudos
Reply

681 Views
Spell
Contributor I
The code for the end device is the same, I don't know why it doesn't work.

For the automatic binding I'm sorry but I don't know if there is a way for bind automatically both device.
Maybe yes but I never try to do this operation sorry.

regards, filippo

P.S. Howerver bind isn't necessary for send packet to the device, is helpfull only if you have more endpoint in one zigbee device...


Message Edited by Spell on 2007-10-02 11:44 AM
0 Kudos
Reply

681 Views
viswanath
Contributor I

Hi,

     Try this one --u will find the solution------------------

 

 keep this in Zdpmanager .c  in ZC---in Zdpmsgcallback function--------

if( (pIndication->aClusterId[1] == 0x00) && (appState >= mStateBindSuccess_c))
        APP_BIND();

keep this in ASL_interface.c
void APP_BIND(void)
 {
  zbNwkAddr_t  aDestAddress = {0x00,0x00};
  zbNwkAddr_t  aBroadcast = {0xfd,0xff};
 
   ASL_UpdateDevice(appEndPoint,gBind_Device_c);
  ASL_EndDeviceBindRequest(NULL,aDestAddress,endPointList[0].pEndpointDesc->pSimpleDesc);
  
 }

add necessary header files.

0 Kudos
Reply

681 Views
zigbeefyp
Contributor I
When i added the code:
 
ZDO_Start(gStartWithOutNvm_c);
/* Start with one of the following modes:
   gStartWithOutNvm_c                   
   gStartAssociationRejoinWithNvm_c     
   gStartOrphanRejoinWithNvm_c          
   gStartNwkRejoinWithNvm_c             
   gStartSilentRejoinWithNvm_c    */
 
in the BeeApp.c under the BeeAppInit, and i try to compile it, the following error messages appeared:
 
Error : C1815: gStartWithOutNvm_c not declared (or typename)
 
BeeApp.c line 158
 
Warning : C1801: Implicit parameter-declaration for 'ZDO_Start'
 
BeeApp.c line 158
 
Warning: C1420: Result of function-call is ignored
 
BeeApp.c line 158
 
Error : Compile failed
 
I am not sure where went wrong. Is the end device able to start off with gStartWithOutNvm?  Thank you.
0 Kudos
Reply

681 Views
Mads
Contributor V
ZigBeefyp,
 
I can recommend that you read through the chapters and do the steps described in the BeeStack Application developers guide. (bsadg.pdf)
 
This describes all the steps of making a simple ZigBee application, and the only thing you need is to move the code from SW1 to the BeeAppInit() function (do not move it to the BeeAppInit.c file)
 
BR,
Mads Westergreen
0 Kudos
Reply

681 Views
Spell
Contributor I
Be sure that you have included this header file.

#include "ZDOStateMachineHandler.h"
0 Kudos
Reply