Using Docklight

From Smartenit Wiki
Jump to: navigation, search

This page will discuss how to use Docklight Scripting to set up a ZigBee network and control devices using the Smartenit ZBPCID API.


There are a few applications and files that need to be downloaded. Be sure to save these in an area you'll be able to locate when you need them.

1) Docklight Scripting -

2a) For ZigBee Interface - Pre-loaded Docklight Scripts -

2b) For INSTEON Interface - Pre-loaded Docklight Commands -

3) Smartenit ZigBee ZBPCID API - ZBPCID API

Using Docklight

Note: The following directions were written specifically for communicating with the ZigBee interface, but some aspects may be applied for using Docklight Scripting for the INSTEON interface.

"Docklight is a testing, analysis and simulation tool for serial communication protocols (RS232, RS485/422 and others). It allows you to monitor the communication between two serial devices or to test the serial communication of a single device. Docklight runs on almost any standard PC using Windows 7, Windows Vista, Windows XP or Windows 2000/NT 4 operating system"

Opening the pre-loaded scripts file in Docklight Scripting will give you the ability to do all of the common functions such as: starting a ZigBee Home Automation (HA) network, adding nodes, controlling nodes, and discovering and reading attributes. Docklight is not meant to be a home automation application for setting up schedules or advanced automation. It is used to test serial communication given the ZBCID API.

Getting Started

1) Connect your ZBCID interface to your PC
a) Ensure that the device shows up in the PC's Device Manager
b) Make a note of which COM port the device is communicating on

2) Open Docklight Scripting

3) Unzip downloaded file and select file to open in Docklight

4) Select Tools>Project Settings

a) Select the Send/Receive Communication Mode
b) Select the COM port on which your ZBCID device is connected
c) Choose 115200 (19200 for EZIComm) for the Baud rate
d) Click "OK"

5) Select the HEX tab in the Communication window

Understanding Scripts

On the left pane of the Docklight Scripting window, all the pre-loaded scripts are now available for use. The ZBCID explains the structure of each script and modifications will need to be made to the scripts to communicate with ZigBee nodes. Double-clicking the script name will open the script for viewing and modification. Scripts can be copied, modified, and saved as something else if necessary.

Script Definitions

JEN_Ping - Pings the ZBCID
JEN_ClearNVM_and_Reset - Restores ZBCID to factory default and clears all settings
JEN_SWReset - Does a soft reset of ZBCID, will not clear non-volatile memory
ZB_SysStartNwk - Starts the HA network with the default HA key
JEN_OpenJoin - Activates Permit Join
JEN_CloseJoin - Deactivates Permit Join
JEN_ReqIEEEAdd - Requests IEEE address of node
JEN_ReqNetAdd - Requests short network address of node
JEN_NodeDescRequest - Requests Node Descriptor of node
JEN_PowerDescRequest - Requests Power Descriptor of node
JEN_ActiveEPRequest - Requests Active End Points of node
JEN_SimpleDescRequest - Requests Simple Descriptor of node end point
ZB_ONOFF_On - Sends an On command to a device with the On/Off Cluster
ZB_ONOFF_OFF - Sends an Off command to a device with the On/Off Cluster
ZB_ONOFF_Toggle - Sends a ON/OFF toggle command to a device with the On/Off Cluster
ZB_DiscoverAttributes - Sends a command to discover all enabled attributes in a given cluster
ZB_ReadAttributes - Sends a command to read the values of specified attributes

Using Scripts

To activate the script, click on the small gray box to the left of the script label.

In the communication window, the transmitted [TX] message will show in blue and the received [RX] message with show in red.

The majority of the pre-loaded scripts need to have one or more bytes modified to communicate effectively. Once the network has started, devices that have joined the network will be assigned a short network address. Most of the scripts will need to have either the full 64bit MAC address or the short network address entered to communicate with the device.

Refer to the ZBCID API document for the correct structure of each script.

Starting Network and Adding Devices

Step 1) Reset to Factory Defaults
- Run script JEN_ClearNVM_and_Reset

Step 2) Start ZigBee HA Network>

- Run script ZB_SysStartNwk

Step 3) Set Coordinator to Open Join (for up to 4 minutes)

- Run script JEN_OpenJoin (modify duration byte if needed)

Step 4) Add devices to network while ZBCID is open for join

- Take note of the short network address from the device announcements, as they will be needed to send commands to the devices.

Step 5) Once devices have joined, run scripts to send ZCL or ZDP commands to devices.

- Modify scripts to include the correct network address of destination device

If there are any questions, feel free to give us a call at 949-429-3303

Personal tools