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.

Selecting a coordinator



My problem is that in the system we are building, there will be typically one coordinator, and one end device.

If multiple of these systems are deployed in the same area, and the end device is powered down and back up, it needs to remember which coordinator it was last connected to, and reconnect to that one. Its not possible to run it all under one coordinator, as the coordinators are not owned by the same user.

Currently, as far as I can tell, the PANID is ignored by the end device – it will connect to a coordinator that is configured to a different PAN id as itself.

The end device needs to get a list of coordinators available, and then select the appropriate one.

Also, the coordinator should ideally be able to check to see if the PANID it would use is in use, and pick a different one if it is.

  • If you have a device join a network and you would like that device to be able to sleep or be turned off, come back up and remain a member of the same network (not go through the discovery and joining process again) then you can use the NV_RESTORE feature which saves the state of the device to Non-Volatile memory and refreshes the status of the device on the network when it is powered back up.  Please check the developer's guide for more information on NV_RESTORE.

  • What is the correct procedure to force a device to join a "new" network after it has already joined a network?

    We have an End Device that needs to join to a new Coordinator once the original coordinator is gone.

    So far the only way I have found to do this is with the ZDP_MgmtLeaveReq function as follows:

            {
            zAddrType_t ZAddr;
            ZAddr.addr.shortAddr = NLME_GetShortAddr();
            ZAddr.addrMode = Addr16Bit;
            // Must enable  ZDO_MGMT_LEAVE_REQUEST & ZDO_MGMT_LEAVE_RESPONSE in ZDConfig.h
            ZDP_MgmtLeaveReq( &ZAddr, NLME_GetExtAddr(), 0 );                   // Leave network (Note this will cause a system reset in 5 sec.)
            }

    This works however this causes a device reset.  Is there any way to force a "new" network join without resetting the device?

    I have tried setting the ZCD_STARTOPT_DEFAULT_NETWORK_STATE and ZDOInitDevice as follows:

            zgWriteStartupOptions (ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE);
            ZDOInitDevice( 0 );

    However this does not force a "new" join for an already running system (I think this only forces a "new" join if the system is using NV_RESTORE and is reset or powered up.

    The only way I have been able to "force" a "new" join in a running system without a reboot is by manually changing the variable devStartMode (in ZDApp.c) from MODE_REJOIN to to MODE_JOIN (after the device has been orphaned).  This works and would just require the addition of a function to ZDApp.c to set devStartMode to MODE_JOIN.  I would just like to know if there is a better way to do this and/or if doing it this way would cause any problems (so far it does not appear to).