Starting Routers and End Devices

A Router or End Device is pre-configured using the ZPS Configuration Editor. The functions that must be called in a Router or End Device application to initialize the node are listed at the beginning of this section (Section 6.1, Forming and joining a network).

Note: The start-up and join process described in this section is for a first-time join (cold start) only and not for a rejoin (which is described in Section 6.6.2).

Once the stack has been started using zps_eAplZdoStartStack(), a Router or End Device works through the following process to join a network:

  1. Searches for a network to join

  2. Selects a network to join

  3. Submits a join request to network

  4. Records the network’s EPID for application use

  5. Router accepts join requests from other devices (if enabled)

These processes are described in detail in the following sections.

Searches for a network to join

As part of the zps_eAplZdoStartStack() function call, the device searches for networks by listening for beacons from Routers and Coordinators of ZigBee PRO networks in the neighborhood. The radio channel for this search is pre-configured via the ZPS Configuration Editor (see Section 13.4.3). The configuration is done in the same way as for the Coordinator as either a fixed channel (in the range 11-26) or a set of channels to scan. Thus, the device listens for beacons in the relevant channel(s).

A beacon filter can be optionally introduced using the function zps_bAppAddBeaconFilter() to allow only beacons from networks of interest to be considered - beacons can be filtered on the basis of PAN ID, Extended PAN ID, LQI value, and device joining status/capacity (see Appendix B.4, Beacon filtering guidelines).

On completion of this search, the subsequent actions depend on the pre-set value of the 64-bit Extended PAN ID (EPID), which is set via the advanced device parameter APS Use Extended PAN IDin the ZPS Configuration Editor (see Section 13.4.4):

  • If the pre-set EPID value is non-zero, this value identifies a specific network to join (assuming the Coordinator has been pre-set with the same EPID - see Section 6.1.1). Provided that a network with this EPID has been discovered in the search, the device attempts to join this network as described in Submits a join request to network (therefore bypassing the steps listed in Selects a network to join).

  • If the pre-set EPID value is zero, the results of the search are reported in a zps_EVENT_NWK_DISCOVERY_COMPLETE stack event, which contains details of the networks discovered (see Section 6.2.1). The device must then select a network to join, as described in the following section.

Parent topic:Starting Routers and End Devices

Selects a network to join

On the basis of the results in zps_EVENT_NWK_DISCOVERY_COMPLETE, the application must select a network which the device will attempt to join. The search results contain a recommended network, selected as the first ZigBee PRO network detected that allows nodes to join. The application is, however, free to choose another network, where this choice may be based on LQI value (detected signal strength).

Parent topic:Starting Routers and End Devices

Submits a join request to network

Once the device identifies a network to join, a request to join the network must be submitted. If a non-zero pre-configured EPID has been set (see above), this join request is submitted automatically, otherwise the function zps_eAplZdoJoinNetwork() must be called to submit the request. The outcome of this request is reported in one of the following stack events on the requesting device:

  • zps_EVENT_NWK_JOINED_AS_ROUTER (if joined as Router)

  • zps_EVENT_NWK_JOINED_AS_ENDDEVICE (if joined as End Device)

  • zps_EVENT_NWK_FAILED_TO_JOIN (if failed to join)

In the case of success, the above stack event contains the 16-bit network address that the network has allocated to the local device. In addition, the event zps_EVENT_NWK_NEW_NODE_HAS_JOINED is generated on the parent.

If the case of failure, the device can attempt another join by calling zps_eAplZdoJoinNetwork() with a different result reported in the zps_EVENT_NWK_DISCOVERY_COMPLETE event.

Parent topic:Starting Routers and End Devices

Records the network’s EPID for application use

The function zps_eAplAibSetApsUseExtendedPanId() may now be used to create a persistent record of the EPID of the network that the node has joined (it is necessary to first obtain the EPID value using the functions zps_pvAplZdoGetNwkHandle() and zps_u64NwkGetEpid()). If this EPID record is created, the node automatically continues in the network following a reset without explicitly rejoining.

Parent topic:Starting Routers and End Devices

Router accepts join requests from other devices (if enabled)

A Router may now allow other devices (Routers and End Devices) to join it as its children. The number of (direct) children of the Router is limited by the maximum number of neighbors for the node, which is pre-set via the advanced network parameter Active Neighbor Table Sizeand Child Table Sizein the ZPS Configuration Editor (see Section 13.4.4).

Note: The initial ‘permit joining’ status is pre-set via the Router parameter Permit Joining Time in the ZPS Configuration Editor. If this is initially disabled, the Router may not accept children until joining has been enabled using zps_eAplZdoPermitJoining(). However, the ‘permit joining’ status is ignored during a join in which the pre-set EPID on the joining device is non-zero and during any rejoin (see Section 6.6.2). The above function can be used at any time to allow joinings for a limited time-period or indefinitely, and can also be used to disable joinings.

Once a node has joined the network, each endpoint application on the node is next likely to search for compatible endpoints on remote nodes with which it can communicate, as described in Section 6.2.2.

Note: A network can be set up such that an End Device or Router joins a particular parent node. The required configuration and function calls to employ predetermined parents are described in Section 6.1.3.

Parent topic:Starting Routers and End Devices

Parent topic:Forming and joining a network