Exercise: AppBuilder – Basic ZigBee HA Light and Switch Example (EM357) I. Launch Ember Desktop [ED] and Add Stack 1. Make sure at least two nodes are present with EM357s in Adapters pane. 2. Go to File > Preferences and select "App Builder" from left list. 3. The right pane is a list of installed stacks and applications. Click on "Add" button to install our newest stack. 4. Browse to C:\Users\Training\Ember\EmberZNet5.4.0 GA\em35x folder (or wherever your EmberZNet 5.4 stack is installed) and click on "OK". (If this stack configuration already exists, disregard the warning that comes up.) 5. Click OK to exit Preferences. II. Create new Application Framework Configuration for Switch 1. Go to File > New > Application Framework Configuration. 2. Select "ZCL Application Framework V2" and then click Next. 3. Select your EmberZNet “EM35X” stack (not “EM35XEZSP” if you have it) and then click Next. 4. Select "Start with a blank application" and click Finish. III. New Configuration for Switch 1. Under the "General" tab, in the "Device name" field, input a name for your On/Off Switch application, such as "MySwitch". Invalid text field entries will be highlighted in red. (Note: whitespace is not permitted.) 2. Under the "ZCL clusters" tab, ensure "ZCL device type" is set to "HA On/Off Switch". 3. Under the "Znet stack" tab: a. In "Network configuration" change ZigBee Device Type to "Router". 4. Under the “Printing and CLI” tab: a. In the “Debug printing” section, check “Enable debug printing.” b. In the same section, under "Cluster debugging", check both columns for On/Off. c. In the same section, under "General purpose debug printing areas", check both columns for Core, Application, Attributes, and ZDO (ZigBee Device Object). 5. Under the "HAL configuration" tab, configure console output. a. Ensure Debug Level is "Normal". b. In “Bootloader” picklist, select “Standalone”. c. Under "IO configuration" section, change Command Line Interface to “Full”. d. Change “Application serial port” to "Virtual UART (port 0)". e. Check box for "Virtual UART (port 0)". 6. Under the "Plugins" tab, add features. a. Under “Network Form and Join”, enable “Network Find”. b. In Network Find plugin's options, enter a unique Extended PAN ID (16 hex characters), such as the digits of your birthday (repeated as necessary to fill space). Remember the value you chose, as you may need it later! c. Under "Utility", enable “Button Form/Join Code”, “General response commands". 7. Save settings (via File > Save) to an ISC file. 8. Click Generate button in the top right corner. Note the generated EWW file for future reference. IV. Build project in IAR Embedded Workbench 1. In IAR, open workspace by going to File > Open > Workspace and open generated EWW file from within the "app\builder\{ConfigurationName}" subdirectory of EmberZNet. 2. Compile your project by going to Project > Make. 3. Ensure that the IAR build completes with 0 errors. (Note: If you can't see the post build output, right click the output window and choose Options; then set Show Build Messages to "All". (Turn page over) V. Load Application to ZigBee Development Board 1. In ED, in the Adapters view, right click on a node for your Switch application and select "Connect". (Ensure icon turns green.) 2. Right click on the same node and choose "Upload Application..." a. Browse to the EBL or S37 file created by the build (found in EmberZNet directory tree under "app\builder\{ConfigurationName}\build\exe" folder.) b. Check the Bootloader option and browse to "tool\bootloader em357\serial uart bootloader\serial uart bootloader.s37” c. Check Erase Chip option; then click OK to proceed with the upload. (A warning dialog will appear; this is expected, so click OK to clear it.) VI. Create a new Application Framework Configuration for Light 1. In ED go to File > Save as... and save ISC file as "MyLight". 2. Change device name to "MyLight". 3. Under the "ZCL clusters" tab, change "ZCL device type" to "HA On/Off Light". 4. Under the "Znet stack" tab, in "Network configurations" section, change ZigBee Device Type to "Coordinator or Router". 5. Under the "Callback configuration" tab, under General: On/Off Cluster, check Server Attribute Changed. 6. Click Generate button. 7. Save. VII. Load application to second node 1. Repeat steps in Section IV and V for MyLight. VIII. Serial communication check 1. After successful upload for Light and Switch right click on node in Adapters pane and select "Launch console" for both. 2. Select "Serial 0" tab and press Enter to make sure you get a prompt indicating you are talking to the Light or Switch node. (Prompt should show configuration name.) 3. Right click on one of your nodes and choose "Start Capture". IX. Forming the network 1. On the Light node, press BUTTON0 (located on EM35x Breakout Board) to form a network. (Ignore any warnings printed by ED about decryption.) 2. For the Light node, after console prints out "EMBER_NETWORK_UP" on Serial 0, press BUTTON0 to permit joining across the PAN for the next 60 seconds. 3. On the Switch node, within 1 minute, press BUTTON0 to attempt joining. If joining is successful, console for Switch will print "EMBER_NETWORK_UP" on Serial 0, proceed to next section. If not, repeat steps 2 and 3. X. On/Off toggle 1. On Serial 0 of Switch node, enter the following: zcl on-off toggle send 0 1 1 2. Confirm sending of "ZCL: Toggle" and "ZCL: Default Response" between Switch and Light. 3. Under the Live capture tab, highlight “ZCL: DefaultResponse” and check in Event Detail panel for “Status: SUCCESS (0x00)” under the “Zigbee Cluster Library” section. 4. Confirm "Toggle" message is printed on Serial 0 of Light. Type print attr to print attribute table and verify that attribute 00 for On/Off cluster (0x0006) changes when toggle is received.
© Copyright 2024