Beacon Tree Mode

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

Beacon Tree Mode

4,263 Views
Federico
Contributor I
I, i try to create a tree mode network with this feature:
1 pan coordinator that trasmit beacon
1 coordinator associated with the pan and that track its beacon. And then trasmit own beacon too.
1 coordinator associated to the second coordinator that isn't pan, track it beacon and try to trasmit own beacon.
The problem occur when the third coordinator try to associate to the second.
Infact during this operation the pan change it address and start to trasmit the beacon whit the new address, the the device associated to its send a pan id conflict message.
Some one have a solution for my problem.
Sorry for my bad english and 1000 thanks in advance.
Labels (1)
0 Kudos
14 Replies

1,230 Views
Federico
Contributor I
If have solved your problem with router in tree beacon network, i have a new question for you!
Hav you ever trasmitt data in beacon payload, I try to do it but I have some prolblem.
I think it is very useful to make a bidirectional link in beacon network.
if have some software about this problem can you send it to me!
Thanks Federico

0 Kudos

1,230 Views
Spell
Contributor I
Hi Federico,
if you read Appendix A of 802.15.4 MAC MyWirelessApp User's Guide you can read that a coordinator never performs PAN id conflict because this is reserved for the PAN coordinator and leaf devices.
However you can disable the PAN Id Conflict detection using macPanIdConflictDetection attribute.

I'm tryng to implement a beaconed network too but I have a lot of problem to start a router, can you send me your code?:smileytongue:

Regards,
Filippo
0 Kudos

1,230 Views
Federico
Contributor I
Sorry but my code don't work!
I make another test but I have a lot of problem too.
When a third device try to connect to the pan or to the router, the device that isn't recall in the procedure, interfere with the other.
That is it change its address and start to send beacon with the new address, and this behavior continuous until I shut down one off the router, then the leaf can associate to the pan.
If have the same problem and you have resolved it say me how!
Thank very much.
Regards Federico
0 Kudos

1,230 Views
Spell
Contributor I
When you call MLME-Start request in router procedure you must set to FALSE the PANCoordinator because only one PAN coordinator can exist in a tree mode network.

I don't understand how to set a device as router, my steps are:
- scan for a PAN coordinator
- associate with it
- set PIB attributes (macPanId, macBeaconOrder, macSuperFrameOrder) to the same used by the PAN
- starts tracking beacon using MLME-Sync
- calculate beacon tx offsets
- call MLME-Start request with PANCoordinator value set to FALSE
This is what freescale support has said to me but it doesn't work beacuse the third device (end device) can't see the router but it see only the PAN.
Are you using BeeStack library or 802.15.4MAC library?
0 Kudos

1,230 Views
Federico
Contributor I
When your device receive a scan confirm message you have to control the superframeSpec and  discard the packet from a pan , in this  way your device find only the  router.
I just set the router with false in pan option but I have any way a conflict. If don't have this problem when a device try to associate can you send me the software of your router and your pan.
Thank you very much
-----best Regards Federico
0 Kudos

1,230 Views
Spell
Contributor I
During the passive scan I find only the PAN coordinator, I don't find the router...
Maybe I don't set correctly the MLME-Start request in the router application, how PIB attributes do you set before calling MLME-Start request?
This is my procedure:
Code:
static uint8_t App_StartRouter(void){  /* Message for the MLME will be allocated and attached to this pointer */  mlmeMessage_t *pMsg;  UartUtil_Print("Sending the MLME-Start Request message to the MAC...");    /* Allocate a message for the MLME (We should check for NULL). */  pMsg = MSG_AllocType(mlmeMessage_t);  if(pMsg != NULL)  {    /* Pointer which is used for easy access inside the allocated message */    mlmeStartReq_t *pStartReq;    /* Return value from MSG_send - used for avoiding compiler warnings */    uint8_t ret;    /* Boolean value that will be written to the MAC PIB */    uint8_t boolFlag;        /* Set-up MAC PIB attributes. Please note that Set, Get,       and Reset messages are not freed by the MLME. */        /* We must always set the short address to something       else than 0xFFFF before starting a PAN. */    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibShortAddress_c;    pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)maDeviceShortAddress;    ret = MSG_Send(NWK_MLME, pMsg);        /* We must set the Association Permit flag to TRUE        in order to allow devices to associate to us. */    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibAssociationPermit_c;    boolFlag = TRUE;    pMsg->msgData.setReq.pibAttributeValue = &boolFlag;    ret = MSG_Send(NWK_MLME, pMsg);        /*Set Beacon Order PIB*/    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibBeaconOrder_c;    pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)mDefaultValueOfBeaconOrder_c;    ret = MSG_Send(NWK_MLME, pMsg);            /*Set SuperFrame Order PIB*/    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibSuperFrameOrder_c;    pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)mDefaultValueOfSuperframeOrder_c;    ret = MSG_Send(NWK_MLME, pMsg);              /*Set macRxOnWhenIdle PIB*/    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibRxOnWhenIdle_c;    pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)macRxOnWhenIdle_c;    ret = MSG_Send(NWK_MLME, pMsg);        macTreemodeStartTime = gOrder000s492ms_c;             /*Set macTreemodeStartTime Order PIB*/    pMsg->msgType = gMlmeSetReq_c;    pMsg->msgData.setReq.pibAttribute = gMPibTreemodeStartTime_c;    pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)macTreemodeStartTime;    /* Send the Set request to the MLME. */    MSG_Send(NWK_MLME, pMsg);            /* This is a MLME-START.req command */    pMsg->msgType = gMlmeStartReq_c;        /* Create the Start request message data. */    pStartReq = &pMsg->msgData.startReq;    /* PAN ID - LSB, MSB. The example shows a PAN ID of 0xBEEF. */    FLib_MemCpy(pStartReq->panId, &mCoordInfo.coordPanId, 2);    /* Logical Channel - the default of 11 will be overridden */    pStartReq->logicalChannel = mLogicalChannel;    /* Beacon Order: 0xF = turn off beacons, less than 0xF = turn on beacons */    pStartReq->beaconOrder = mDefaultValueOfBeaconOrder_c;      /* Superframe Order: Must be equal or less than the beacon order */    pStartReq->superFrameOrder = mDefaultValueOfSuperframeOrder_c;    /* Be a Router */    pStartReq->panCoordinator = FALSE;    /* Dont use battery life extension */    pStartReq->batteryLifeExt = FALSE;    /* This is not a Realignment command */    pStartReq->coordRealignment = FALSE;    /* Dont use security */    pStartReq->securityEnable = FALSE;          /* Send the Start request to the MLME. */    ret = MSG_Send(NWK_MLME, pMsg);    if(ret == gSuccess_c)    {      UartUtil_Print("Done\n");          return errorNoError;    }    else    {      /* One or more parameters in the Start Request message were invalid. */      UartUtil_Print("Invalid parameter!\n");      return errorInvalidParameter;    }  }  else  {    /* Allocation of a message buffer failed. */    UartUtil_Print("Message allocation failed!\n");    return errorAllocFailed;  }}

 Do you thinj is ok?
Best regards,
Filippo

0 Kudos

1,230 Views
Spell
Contributor I
I have set Beacon order to 6 and Superframe order to 1 but when I try to set TreemodeStartTime to 3 return an invalid parameter error.
Which values are you set in these attributes?
0 Kudos

1,230 Views
Federico
Contributor I
#define TREE_MODE_CLUSTER1 0x4000
#define TREE_MODE_CLUSTER2 (TREE_MODE_CLUSTER1 *2)


#define BEACON_ORDER      6
#define SUPERFRAME_ORDER  4
0 Kudos

1,230 Views
Federico
Contributor I
In your previous message you say to disable macPanIdConflictDetection, but in the pib attribute i don't find anything about it!
Can you send to me how you have disable this option in your code.
0 Kudos

1,230 Views
Federico
Contributor I
uint8_t setTreemode(uint32_t treeModeStart,uint8_t bo, uint8_t so)
{
      
  mlmeMessage_t *pMsg;
  uint8_t temp[3];
  uint8_t ret;
 
  #ifdef PRINT_MLME
  Uart_Print("Sending the MLME-Stard Coord message to the MAC...");
  #endif  PRINT_MLME
 
 
  pMsg = MSG_AllocType(mlmeMessage_t);
  if(pMsg != NULL)
    {        
       temp[0]= treeModeStart & 0xFF;
       temp[1]= (treeModeStart >> 8) & 0xFF;      
       temp[2]= (treeModeStart >> 16) & 0xFF;        
      
       #ifdef PRINT_ADDR
         Uart_Print("\nTree delay beacon ");
         Uart_PrintHex(temp,3,0);
       #endif  PRINT_ADDR  
       //Prima di impostare i valori di offset con cui trasmettere il mio beacon
       //vado a settare i valori di bo ed so del coordinatore a cui sono associato
       ret = setBeaconSuperframe( bo, so);       
       if (ret != gSuccess_c) return ret;                     
       pMsg->msgType = gMlmeSetReq_c;
       pMsg->msgData.setReq.pibAttribute = gMPibTreemodeStartTime_c;          
       pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)(temp);
       ret = MSG_Send(NWK_MLME, pMsg);
       if (ret != gSuccess_c)        
          {
            Uart_Print("error tree mode ") ;
            Uart_PrintHex(&ret,1,0);            
          }          
       return ret;
    }

I look your software, and I think you wrong to set the treemodeStartTime.
I use this function, I hope that this can help you.
0 Kudos

1,230 Views
Spell
Contributor I
After many tests I am successful implemented a ZigBee router, maybe...:smileyindifferent:
I have set BO=6,SO=0 and TreemodeStartTime=1500 symbols.
When I try to associate a device I'm able to find the router but I'm not able to received a correct association response.
I always obtain an unsuccessful association error by device, the error is always the same: error code 0xEB (gNoData_c). If I try to associate the same device to a PAN coordinator the association works.
Which it can be the problem?

best regards,
Filippo.
0 Kudos

1,230 Views
Alban
Senior Contributor II
Thread Split because of its lenght. Continued on Part 2
0 Kudos

1,230 Views
Spell
Contributor I
In the attached file there is a correct code I use for setting PIB attribute.
Now the router starts correctly but when I try to associate a device to it I receive a Sync Lost message from router and after that the router sends a Sync Req message for resync with PAN.
0 Kudos

1,230 Views
Spell
Contributor I
My setting are:
Beacon Order = 6
Superframe Order = 0
Tx offset  = 2000 symbols

With these values the router seem starts correctly but I can't associate to it because when association message is received the router lost sync with PAN coordinator.
However I have attached my router code if it can help you.:smileywink:
0 Kudos