Basic Module Startup

To start the module, several commands are required. The startup process is wrapped for you in startModule in module_utilities.c but here is the basic startup routine.

Several methods (setStartupOptions, setZigbeeDeviceType etc.) are just convenience wrapper methods for ZB WRITE CONFIGURATION.


 * 1) moduleReset - use the hardware reset line; be sure that you hold it down long enough according to the module specification. Our examples use 1mSec for convenience.
 * 2)  setStartupOptions - when the module starts, it can either use its last known network, or go out and look for a new network. This command can be used to clear out any existing network settings on the module. You can also omit this if you just want to use the same network as before, but be warned that if you do this then you should detect if the module startup fails. This can happen if the Coordinator starts with a different PAN ID or the Coordinator is replaced.
 * 3) If we will be using the DIP switches on the Boosterpack to set our operating region, then configure the module GPIOs here, and read them.
 * 4) moduleReset - do this again to apply the startup option changes above
 * 5) Read module configuration byte (in reset message) to determine what model of module we're using. Then, use this to set the RF output power correctly.
 * 6)  setZigbeeDeviceType - configures the module to be a Coordinator, Router, or End Device.
 * 7) Optional configuration options - here is where you would add additional configuration options such as setPanId, or setChannelMask, or setPollRate etc. Note that increasing the number of channels in the channelMask will make startup take longer, as the module has to scan each channel.
 * 8)  setCallbacks - needed so that we can receive messages from the API.
 * 9) Configure the Zigbee network for which Profile and Endpoint we're using, whether to use Binding, etc. If using AF/ZDO then use the AF_REGISTER command.
 * 10) Start the application - this tells the module that all the configuration options are loaded and now it is time to join the network. If using AF/ZDO then use the ZDO_STARTUP_FROM_APP command.

It will take a few seconds to start the network. You will receive several ZDO_STATE_CHANGE_IND messages which indicate the module is trying to start the network. You will know that the network is up and running once you receive a status of DEV_END_DEVICE, DEV_ROUTER, or DEV_ZB_COORD; depending on whether you configured the module to be an End Device, Router, or Coordinator, respectively.

Again, this process is all in startModule in module_utilities.c. Refer to that file for more information.

For more information, see Module Startup Logic Analyzer Trace - Coordinator.

