This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2538: PAN ID and Connection for Coordinator and Router

Part Number: CC2538
Other Parts Discussed in Thread: CC2530, Z-STACK

Tool/software: TI-RTOS

Hi,

I have the following Zigbee config:

1pc --- Coordinator (CC2538, Zstack 3.0.1)

2pc --- Zigbee Router (CC2530, Zstack 3.0.1)

All Coordinator and the router PAN ID are set to 0x1234 in f8wConfig.cfg as below:

-DZDAPP_CONFIG_PAN_ID=0x1234

Question1:

When I power on the Coordinator and the 2 Routers (I use Ubiqua to monitor the status), sometimes one of the router /or Coordinator shows PANID = 0x1235 !!

If I reset the power and try again, situation is the same. But if I re-download program and try again, sometimes it seems ok.(i.e., all Coordinator and the 2 routers show panid: 0x1234!!) Why it occurs? Is it related to the power on sequence?

Queston2:

When all PAN ID are 0x1234, in Ubiqua graphc view, it shows 1 coordinator and 2 Routers. But they are 3 separate nodes!! (i.e., no lines to join between the Coordinator and the router!!  All the Coordinator and the Router display "Depth: 0"; "Status: Associate"). So, how to link up the Coordinator and the Router please?

Note: in the Router side, the program can jump into ZDO_STATE_CHANGE and the nwk state is DEV_ROUTER!!

 

Thank you very much

Bruce Lam

 

  • I suppose your router forms distributed network with PANID 0x1234 and cause PANID conflict. Please provide sniffer log to check what happens.
  • Hi YK,

    Please see the attached ubiqua. This time retry, one of the router can be link. but the other still have PAN ID 0x1235.

    By the way,  in the init function, I put the following setting, I am not sure whether it is related to this issue or not.

    Actually, what I expected is after power up all the coordinator, router, End device. They will automatically link together to form a one big network!!

    (So, please let me know if there exist any potential problem when I use the following settings)

    In Coordinator (CC2538, Zstack 3.0.1),

      bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_FINDING_BINDING);

      NLME_PermitJoiningRequest(255);

    In Router (CC2530, Zstack 3.0.1),

      bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING);

       NLME_PermitJoiningRequest(255);

    In End Device (CC2530, Zstack 3.0.1),

      bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_FINDING_BINDING);

    capture 20190210 1409.rar

    Bruce Lam

  • I think the router forms distributed network by itself. I can only suggest you enable network steering on ZC and do factory reset to the ZR to make it join again.
  • Hi YK,

    Ok. let me try.

    But you said "enable network steering on ZC" , so, the changes in Coordinator(See red) is as follows: Please confirm.

     bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING| BDB_COMMISSIONING_MODE_FINDING_BINDING);

     NLME_PermitJoiningRequest(255);

    About ZR, could you please tell me how to do factory reset on ZR?

     

    Thank you very much

    Bruce Lam

     

     

  • If you use CC2538DK, you can do factory reset from LCD UI.
  • Hi Bruce,

    For ZR projects, erase all device memory using IAR or FLASH-PROGRAMMER-2 and remove BDB_COMMISSIONING_MODE_NWK_FORMATION from zstack_bdbStartCommissioningReq.commissioning_mode & DEFAULT_COMISSIONING_MODE or set BDB_ROUTER_FORM_DISTRIBUTED_NWK_ENABLED to FALSE

    Regards,
    Ryan

  • Hi YK, Ryan,

    After trying , the following bdb_startCommissioning setting seems OK (for 1st time to join only).

    For Coordinator:

    bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING |BDB_COMMISSIONING_MODE_FINDING_BINDING |BDB_COMMISSIONING_MODE_INITIATOR_TL);

     NLME_PermitJoiningRequest(255);

    For Router:

    bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL);
      NLME_PermitJoiningRequest(255);

    For End Device:
    bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING);

    Problem discovered:
    When the Coordinator, Router program are downloaded and join in the 1st time, it success!! (I use ubiqua to check, the network depth (Coordinator) is 0, the network depth (Router) is 1).
    But after Coordinator and Router are reset power and try again, Coordinator and Router cannot rejoin!! (ie., the network depth (Coordinator and Router) are all 0 !!)
    The End device rejoin seems OK.

    So, is there any further setting required such that Coordinator and Router can be rejoined after power reset?

    Thank you very much
    Bruce Lam

  • What do you mean coordinator and router cannot rejoin? Can you attach sniffer and elaborate your issue with the sniffer log?
  • Dear YK,

    Please see the attacahed rar file. (the pdf has elaboration).

    Based on my understanding, in Zigbee connected network, the depth of the coordinator is 0, the child of the coordinator (either router or End device) has the depth 1. So, I expect when Coordinator and the router are join together, the depth of ZC should be 0; depth of ZR should be 1. (If my conclusion is wrong, pleasae correct me)

    In ubiqua data, when ZC and ZR are 1st join, it is OK.

    After ZC and ZR power reset, all the depth are 0. So, that's why I said "ZC and ZR cannot rejoin after power reset".

    Thank you very much

    Bruce Lam

    Ubiqua capture 20190218.rar

  • Hi Bruce,

    What hardware and example applications do you use to replicate the issue? Please list all changes made to Z-Stack variables. Have you followed any changes are recommended in the Known Issues Wiki? processors.wiki.ti.com/.../Zigbee_Known_Issues_and_Proposed_Fixes

    On a side note, you do not need to enable BDB_COMMISSIONING_MODE_INITIATOR_TL if you are not using the TouchLink feature.

    Regards,
    Ryan

  • I don't think it means "ZC and ZR cannot rejoin after power reset" when you see "ZC/ZR power reset, all the depth are 0". After you do ZC/ZR power reset, can ZR send your private cluster message to ZC and get response? From link status in your 20190218 (First join-- OK).cubx, I think your network looks fine.
  • Hi Ryan,

    For Coordinator(CC2538),  

    I based on GenericApp to modify  (folder path "Home Automation -- GenericApp-- CC2538") .

    About the hardware, it is 3rd party zigbee cc2538 gateway(i.e., CC2538 + WIFI IC).

    For Router (CC2530) /End device (CC2530),  

    I based on GenericApp to modify  (folder path "Home Automation -- GenericApp-- CC2530DB") .

    About the hardware, it is 3rd party zigbee cc2530 development board.

    About the list of changes(ZC and ZR) made to Z-Stack variables, please see attached setting. (if you found anything wield about the setting, please let me know)

    Note: if you want to see ZED Zstack variable changes, please let me know.  

     

    About" the known issue and proposed fix in wiki"(i.e., the link you provided), I have not yet tried when I start to raise my question in the forum.

    About the list of the proposed fix, I did the following proposed fix a while ago but the problem still exists!!

    2.1 Memory Leak in zcl.c

    2.2 Network association issues after prior APS Remove or Leave Request

    2.3 Soft Reset/Freezing/Stack Overflow due to BDB_REPORTING on CC2530/CC2531

    2.15 Errors due to BDB header build types    (Due to the fact that I cannot found znp.cfg, so assume I don't need to handle this issue, am I correct please?)

    But anyway, let me try the other proposed fix.  But please let me know when you have idea about what's wrong in my ZC,ZR Zstack settings.

     

    Thank you very much in advance

    Bruce Lam

    zigbee ZC setting.rar

    zigbee ZR setting.rar

     

  • Hi  YK,

    As I remember, after ZC ZR power reset, some of the ZEDs cannot be controlled through ZC. (But I am not aware whether the lost control ZEDs are the one which is linked to the router!!).   But anyway, let me double confirm in my side.

    Yes, in  20190218 (First join-- OK).cubx, it works fine, all ZEDs can be controlled.  But after ZC, ZR power reset, there exists no DEVICE ANNOUNCE data in ubiqua capture which is strange..

    By the way, I come up with 1 thing about Zstack which need to be clarified:

    (1) In Zstack structure design, when I do join device (ZR /or ZED), is it necessary for the user to "press button(as default) when power up" and then Zstack will jump into something like "Network adjustment mode"?  Actually, I have no buttons in our ZC, ZR and ZED product!!

    Thank you very much in advance

    Bruce Lam

  • Bruce,

    ZR devices only provide a Device Announce during the first join, on a silent rejoin the Link Status message is a clear indication that the router has properly rejoined the network. Do not judge network connection based on the "Depth" property as provided by the packet sniffer software. I agree with YK that your network appears intact unless you can no longer send/receive private cluster messages.

    You can commission a device without user hardware interaction, just take the Zstackapi_bdbStartCommissioningReq APIs outside of the key processing and place them inside initialization instead.

    Regards,
    Ryan
  • Hi Ryan, YK,

    About Ryan mention "silent rejoin", I suddenly remind 1 thing:

    Please confirm whether  ZDO_STATE_CHANGE will be triggered or not after silent rejoin.  If not,  is there any event trigger for "silent rejoin"? 

    Actually, after ZED join /rejoin the network, I assume ZDO_STATE_CHANGE will be triggered and do some hand shaking between ZED and ZC. (Please see the code below)

    Then, the ZC will get my "self-defined" DeviceID from ZED.  And then, my program in ZC can control the ZED based on the "self-defined" deviceID.

    ____________________________________________________________________________________ 

    zclXXXXXX_event_loop( uint8 task_id, uint16 events )

    {

          .....

           case ZDO_STATE_CHANGE:

             zclBEC2_0_R1App_NwkState = (devStates_t)(MSGpkt->hdr.status);

                 if ( (zclBEC2_0_R1App_NwkState == DEV_ROUTER) || (zclBEC2_0_R1App_NwkState == DEV_END_DEVICE) )

                  {

                            ...For end device, I put some code here to send data(include "self defined device ID") to ZC ...

                  }

     }

    __________________________________________________________________________________________________

    Thank you very much

    Bruce Lam

  • ZDO_STATE_CHANGE will be triggered.
  • Hi YK, Ryan,

    After detail checking, the problem is fixed. Thank you very much indeed.

    The ZR  have a bug in my own program which cause inifinte loop.(So, all the ZED through router cannot be controlled.)

    Even the bug is fixed, ZC and ZR still show the depth are all 0 in ubiqua after power reset.

    But, as you say, the ZC and ZR are actually link together although the ubiqua shows the ZC ZR depth all 0.  

    Thank you very much

    Bruce Lam