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.

Cloning Coordinator?

Other Parts Discussed in Thread: Z-STACK, CC2520, MSP430F2618, CC2530EM, CC2530

Hi,

i was using z-stack 2.2.0 (zigbee pro) with NV_RESTORE to have 2 (or more) coordinators in the same network (panid) to use them as an backup for the first coordinator,but now i was trying to do it with the new z-stack (2.2.2), and it is not working. WIth the old stack, using the genericapp, when i reset the coordinator, it start with the "Zigbee Coordinator PANID 1234" and jumps the IEEE part. Now it doesnt jump the IEEE, and it increment 1 the panid. (1235).

i tested with both dk kits, cc2520+msp430F2618 and with EXP5438, and with both of them it doesn't work.

does anyone knows how to clone a coordinator with the new z-stack?

we are going to use the coordinators to manage the network using a pc, and if some coordinator goes down, we dont want to restart all the networ, because we will have a huge one.

thanks,

Franz

 

  • Hi Franz,

    To my knowledge the ZigBee specification does not allow for more than 1 coordinator per network.

    Your description above sounds to me like TI has implemented a mechanism in the latest release to assure this (as you obviously found a way/hole in the 2.2.0 release to do it). That means if a second coordinator shows up it automatically moves to another PAN ID (by incrementing the PAN ID). I see the same behaviour when I fire up a second coordinator with exact identical settings; i.e. the second sees that the channel and PAN ID combination is taken and increments the PAN ID to avoid a conflict.

    -LL-

  • LuckyLuke,

    i have this scenario: i will have different networks in differents regions, and each network will have a pan id to identify the region, and each region will have thousands of routers and end devices.

    For monitoring and controling the end devices and routers (my main goal is to control the routers), i will connect each coordinator of one regiaon in one pc, and develop a software for monitoring and controling the network from the region.

    If the Coordinator goes down or if it breaks, i will lost this control of the network. I don´t want to reset the whole network and create a new one with a new PANID. That is the reason i want to clone the Coordinator, to have a backup Coordinator with the same PANID.

    Or maybe can i do it in a different way? I was thinking of using a router as the backup coordinator, and if the coordinator goes down, switch the router to coordinator mode, but i dont know if it is possible.

    Do you have any idea?

    Thanks,

    Franz

  • You're already going to have a connectivity issue if the ZigBee device attached to your control PC dies. I can envision two possibilities:

    1) You have a secure network and the Coodinator is needed. I can't see how it would be possible to clone the device ... with all the keys, tables, etc ... besides, it could be the memory itself that failed.

    2) You have an unsecure network and the Coordinator is acting merely as a Router. In this case, why clone the Coordinator at all? You could swap out the failed Coodinator with a Router ... that Router would happily join the existing network and you could channel your network reporting and control through it.

    Just a thought.

    Scott

  • My thoughts about this are the following:

    A coordinator is only needed for the following tasks:

    - start a network

    - trust center (to decide whether new devices are allowed to join or not)

    So as your network is already up and running it is not needed for starting anymore.

    The TC you only need if you expect new devices to join; however, if no new devices are to be expected you do not need the coordinator anymore. So the NWK would continue to work fine after the coordinator is turned off; unless you are using its end points for a crucial application.

    In case you use no security on nwk layer i.e. you implement it yourself on application layer (as you do not care about interoperability) new ones can join the routers even in absence of the coordinator.

    -LL-

  • Notsane,

    i will use a secure network, so i need the coordinator for managing the keys or i can manage keys from networks with different pan id?

  • LL,

    i will use the coordinator as a trust center.

    i will not add everyday an end device, but if some of them fail, i will need to add them later in the same network.

    i cant implement my own security, because we want to homologate our device, and also want to use some end device from others manufacturers.

     

     

  • Homogulate? Is that a word? [:)]

    As long as the Coordinator is the trust center, I can't imagine any feature in the ZigBee stack that would allow you to clone it ... of course, I could be wrong.

     

  • sorry... my fingers are not coordinated with my mind.. heheh

    I know that i can set in the coordinator another device as the trust center, but i dont know if it need to be another coordinator or it can be a router.

     

  • If you have a secure system, then the Coordinator is the trust center ... no other device can do that. But if your keys are not rotating and no devices are joining, the trust center isn't really doing anything. If that's true, the Coordinator is merely providing Routing functions. If the Coordinator failed at that point, its functions could be taken over by a Router. Of course, if keys rotated or new devices tried to join, there would be no trust center to provide that function at that point.

    Scott

  • Hi,

    I have a network that forms automatically and is controlled through a gateway. When all devices have connected to the network, a command to close the network is sent via the gateway. The gateway node then starts to receive packets from other nodes and delivers them through the gateway. It is also possible to send commands to the ZigBee network through the gateway. And if a node is broken, then the network can be reopened (with the gateway) and a replacement installed. The problem arises if the gateway gets broken. The network is closed and it can not be reopened. Currently the coordinator works as a gateway, but that can be changed. However, if the coordinator fails (even without being the gateway) how do I replace it?

    Possible solutions:

    • Another way to open the network (switch etc.)
      • Is enough if the gateway is a router
      • What if the coordinator has failed?
    • Cloning the coordinator
      • Save needed informations and load it when the gateway is replaced
      • The data can be send and received through the gateway
      • All nodes communicate only with the gateway
      • No binding etc. only many-to-one routing
        • Is it enough to join the network with cloned settings and just send many-to-one rreg?
      • What information is needed?
        • PANid?
        • Do I need an identical MAC address?
        • Information about neighboring nodes etc?

     

    Any suggestions?

    Regards,

    Lasse

  • Hello again,

     

    I tried cloning a coordinator and I got it working. I have pretty simple settings i.e. no security etc.

    Basically I just programmed two CC2530EM boards with same PANid and channel settings and had them powered on non-simultaneously. I had NV_RESTORE on and this way I got two identical coordinators that won't start a new network when powered up.I used the other coordinator to form a network with a bunch of routers. The coordinator is used as a gateway and it receives periodic messages from routers. If I shut down the original coordinator and powered up the spare coordinator, then those periodic messages automatically went to the spare coordinator and commands from the coordinator worked also. I could also switch back to the original coordinator without problems, but having both coordinators on at the same time didn't work.

    This was just a proof of concept, but cloning a coordinator should be possible pretty easily.

     

    Regards,

    Lasse 

  • Hi,

    How do you send messages from the coordinator to the routers an end devices?

    Can you send me an example of the souce code?

    THanks

  • Hi,

    I just use the normal AF_DataRequest command.

     

    Regards,

    Lasse

  • Hi Lasse,

    i got the same problem of JVELL,

    im using 

    char theMessageData[] = "123456789";

     if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,

                           GENERICAPP_CLUSTERID,

                           (byte)osal_strlen( theMessageData )+1,

                           (byte *)&theMessageData,

                           &GenericApp_TransID,

                           AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )

      {

       GenericApp_TxBufClear();

       osal_set_event(GenericApp_TransID, GENERICAPP_SEND_MSG_EVT);

        // Successfully requested to be sent.

     // }

      else

      {

        // Error occurred in request to send.

      }

    in the Generic App Application on the GenericApp_SendTheMessage( void ) function.

    and i also tried to send an text that i receive from UART.

       if ((GenericApp_TxLen = HalUARTRead(0x08, GenericApp_TxBuf+1, GENERIC_APP_TX_MAX)))

      {

        // Pre-pend sequence number to the Tx message.

        GenericApp_TxBuf[0] = ++GenericApp_TxSeq;

      }

     

      HalUARTWrite(0x08, GenericApp_TxBuf+1, GENERIC_APP_TX_MAX);

     

     

     

      if (GenericApp_TxLen)

      {

       if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,

                           GENERICAPP_CLUSTERID,

                           GENERIC_APP_TX_MAX,

                           (byte *)&GenericApp_TxBuf+1,

                           &GenericApp_TransID,

                           AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )

      {

      // GenericApp_TxBufClear();

          GenericApp_TxBufClear(GenericApp_TxBuf,GenericApp_TxLen);

       osal_set_event(GenericApp_TransID, GENERICAPP_SEND_MSG_EVT);

        // Successfully requested to be sent.

      }

      else

      {

        // Error occurred in request to send.

      }

      }

    but in both case, it send a blank message.

    Maybe i im using the wrong parameters in the AF_DataRequest .

    Can you send me an exeample of your code?

    Thanks

  • Hello again,

    Does this problem of yours have anything to do with cloning a coordinator? Or do you just have problem sending messages? I mean if this is a common problem then you could start a new thread concerning message sending.

    Your AF_DataRequest part looks ok, but do you declare "GenericApp_DstAddr" and have correct values in it?

    Something like that:

        afAddrType_t GenericApp_DstAddr;

        GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;

        GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;

        GenericApp_DstAddr.addr.shortAddr = 0x0000; //0x0000 is the coordinator, this should be your target address

     

    If you are using the sample GenericApp, then those values are filled in when the device is bound to an another device. If you have a packet sniffer, then you could use it to see if anything is sent. And there's that sending error part:

      {

        // Error occurred in request to send.

      }

    You could put some kind of error processing part there. Maybe just light up led etc. so you know that an error occurred. And have you checked that you actually go to the send the message function?

     

    Hope that helps,

    Lasse

  • Hi Lasse,

    using the packet sniffer and the Daintree Network Analiser, i realise that i am sending the message correct, cut it seems that i am not receiving it. 

    I using the MessageMSGCB function, but it not working.

    I ll copy this post to another thread. http://e2e.ti.com/support/low_power_rf/f/158/p/47897/169322.aspx

     

    Thanks

     

     

    void GenericApp_MessageMSGCB( afIncomingMSGPacket_t *pkt )

    {

      HalLcdWriteScreen( (char*)pkt->cmd.Data, "msg received" );

      switch ( pkt->clusterId )

      {

        case GENERICAPP_CLUSTERID:

          // "the" message

    #if defined( LCD_SUPPORTED )

          HalLcdWriteScreen( (char*)pkt->cmd.Data, "rcvd" );

    #elif defined( WIN32 )

          WPRINTSTR( pkt->cmd.Data );

    #endif

          break;

      }

    }

     

  • Hi,

    I have the same issues.  My coordinator is attached to a PC and commands can be issued to gather statistics, etc. 

    I have a fixed PAN ID and NV_RESTORE defined on both coordinator and routers.  If my coordinator hardware is fried, how do I recover my network?

    I attempted to take a second  board with same firmware, PANID and NV_RESTORE, but no luck. I assume the routers need to rejoin??

    I've heard cloning the coordinator or recomissioning the network, but I'm not sure what the procedure is for this.

    Could I have code so that if the routers do not talk to the coordinator after X number of days, that I wipe NV memory and reset, forcing the routers to rejoin the new coordinator?

    Can anyone share their knowledge or experience?

    Thanks.

    Michael

     

  • Hi,

    Ihave got a CC2530 kit having in mind to implement a sensor node, but i don't have any idea about how to work with that kit.

    Can  u give me guidance as step by step procedure.

  • If anyone still wants to know how to clone a Coordinator the easiest way, have a look here:

    e2e.ti.com/.../1749150

    cheers

  • Yes, that works but it needs flash programmer to dump flash. If someone need to clone a ZC within application, he has to use the steps in sunmaysky.blogspot.tw/.../how-to-clone-existing-z-stack.html.