User Guide for SILICON LABS models including: SILICON LABS, Lab 4, Understand, FLiRS, Devices, Z-Wave, Embedded, SDK
In this section we will be compiling the Doorlock Sample Application. The steps required are the same, as for Switch On/Off, which we.
silabs.com | Building a more connected world.Rev. 0.1 Lab 4: Understand FLiRS Devices This hands-on exercise will demonstrate what a Z-Wave FLiRS device is. The exercise will use the Doorlock sample application that ships as
File Info : application/pdf, 10 Pages, 497.84KB
DocumentDocumentLab 4: Understand FLiRS Devices This hands-on exercise will demonstrate what a Z-Wave FLiRS device is. The exercise will use the Doorlock sample application that ships as part of the Z-Wave Embedded SDK This exercise is part of the series "Z-Wave 1-Day Course". 1: Include using SmartStart 2: Decrypt Z-Wave RF Frames using the Zniffer 3A: Compile Switch On/Off and Enable Debug 3B: Modify Switch On/Off 4: Understand FLiRS devices KEY FEATURES · Understand key features of a FLiRS device. · Use the Energy Profiler to capture the power consumption. silabs.com | Building a more connected world. Rev. 0.1 Lab 4: Understand FLiRS Devices Introduction 1 Introduction In this exercise we will explore a Z-Wave FLiRS device, and learn the benefits of a "listening sleeping device"; a battery powered device that must be communicated with at any time with short latency. 1.1 Hardware Requirements · 1 WSTK Main Development Board · 1 Z-Wave Radio Development Board: ZGM130S SiP Module · 1 UZB Controller · 1 USB Zniffer 1.2 Software Requirements · Simplicity Studio v4 · Z-Wave 7 SDK · Z-Wave PC Controller · Z-Wave Zniffer Figure 1: Main development board with Z-Wave SiP module 1.3 Prerequisites Previous Hands-On exercises has covered how to use the PC Controller and Zniffer application to build a Z-Wave network and capturing the RF communication for development purpose. This exercise assumes you are familiar with these tools. Previous Hands-On exercises has also covered how to use the sample applications that ships with the Z-Wave SDK. This exercise assumes you are familiar with using and compiling one of the sample applications. silabs.com | Building a more connected world. Rev. 0.1 | 1 Lab 4: Understand FLiRS Devices Compile the Doorlock Sample Application 2 Compile the Doorlock Sample Application In this section we will be compiling the Doorlock Sample Application. The steps required are the same, as for Switch On/Off, which we covered in exercise "3A: Compile Switch OnOff and enable debug". In the following, the steps are summarized, but you should refer to exercise 3A if you want instructions in how to enable and use the serial debugger. 2.1 Open Sample Project 1. Connect your Z-Wave hardware to the USB port of the computer and it should show up in the "Debug Adapters" section in Simplicity Studio. 2. Click once on the "J-Link Silicon Labs" which instructs to studio the show relevant information about Z-Wave 700. 3. Under "Software Example" click on the DoorLock sample application. Figure 2: Open a Z-Wave sample application: DoorLock 2.2 Set the frequency The sample app will not compile just yet. You need to set the frequency that matches the region you intend to use the Z-Wave Product in. · In the main source file "DoorLockKeyPad.c", locate the variable APP_FREQ: silabs.com | Building a more connected world. Rev. 0.1 | 2 Lab 4: Understand FLiRS Devices Compile the Doorlock Sample Application Figure 3: APP_FREQ needs to be set to your RF region Refer to Table 1 for a complete list of supported frequencies by the SDK. Hint Navigate to Silicon Labs website, to see which countries has been approved for the Z-Wave RF. Table 1: Overview of a possible frequencies Frequency Region Europe United States of America Australia/New Zealand Hong Kong Malaysia India Israel Russia China Japan Korea Variable to use REGION_EU REGION_US REGION_ANZ REGION_HK REGION_MY REGION_IN REGION_IL REGION_RU REGION_CN REGION_JP REGION_KR In this guide we will be using the European frequency, thus we enter "REGION_EU". Figure 4: APP_FREQ is set to REGION_EU silabs.com | Building a more connected world. Rev. 0.1 | 3 Lab 4: Understand FLiRS Devices Compile the Doorlock Sample Application 2.3 Compile the DoorLock Application You have now configured the Z-Wave sample application, and you are ready to compile. 1. Click on the "Build" button to start building the project. 2. When the build finishes after a short while, a new folder named "Binaries" are showed in the Project Explore. Expand the folder and right click on the *.hex file to select "Flash to Device..". 3. Select the connected hardware in the pop-up window. The "Flash Programmer" is now prefilled with all needed data, and you are ready to click on "Program". 4. Click "Program". After a short while the programming finishes, and your end device is now flashed with a Z-Wave sample application. silabs.com | Building a more connected world. Rev. 0.1 | 4 Lab 4: Understand FLiRS Devices Include and run the Doorlock Sample Application 3 Include and run the Doorlock Sample Application In this section we will be including the Doorlock Sample Application into the Z-Wave Network. In previous exercise "2A Decrypt Z-Wave RF Frames using the Zniffer", we already added the DSK into the provisioning list of the PC Controller. Hint: The internal file system is not erased between reprogramming. This allows a node to stay in a network and keep the same network keys when you reprogram it. If you need to change (e.g., the frequency at which the module operates or the DSK) you need to "Erase" the chip before the new frequency will be written to the internal NVM. This means, the DSK will still be valid despite we just programmed our device with a completely different sample application. If you are using a new device or if you haven't previously added the DSK to the PC Controller, refer to exercise "2A Decrypt Z-Wave RF Frames using the Zniffer" for instructions in how to readout the DSK from a device and add it to the PC Controller. 3.1 Remove/Include the Old Device from/to the PC Controller Since the DSK is the same, the PC Controller thinks that device is already included, though as a Switch On/Off. We need to remove the association to the Switch On/Off sample application to this DSK. 1. In the PC Controller, click on "Remove" 2. On the device, click on "BTN1" to set the device in learn mode. 3. The device should now be removed from the PC Controller. When the old association is removed, the PC Controller will automatically include the DoorLock sample application thanks to SmartStart. When successfully, the PC Controller should look like Figure 5. Figure 5: DoorLock added into Z-Wave network silabs.com | Building a more connected world. Rev. 0.1 | 5 Lab 4: Understand FLiRS Devices Include and run the Doorlock Sample Application 3.2 Test the functionality In this section, we will briefly test the functionality of the DoorLock Sample application. Hint The functionalities of all sample applications are described in document "INS14278 How to Use Certified Apps" found in the documentation section of Simplicity Studio. Test the Lock and Unlock functionality. In the following steps we will be unlocking the door: 1. In the PC Controller, double click on "62 DOOR_LOCK" under secure Command Classes in the lower left corner. 2. This opens the "Command Classes" view in the PC Controller and selects the Door Lock Command class. 3. Set the Command to "0x01 DOOR_LOCK_OPERATION_SET" 4. Set the "Target Value" to "00-DOOR_UNSECURED" 5. Click "Send". Verify that LED3 is now ON. Next, we will lock the door, and LED3 should turn OFF: 1. Set the "Target Value" to "FF-DOOR_SECURED" 2. Click "Send". Figure 6: Command Class View in PC Controller silabs.com | Building a more connected world. Rev. 0.1 | 6 Lab 4: Understand FLiRS Devices Include and run the Doorlock Sample Application 3.3 The Wake-Up Beam for a FLiRS Device If a Z-Wave controller or other node in the network needs to communicate with a battery-powered device such as a door lock, the controller sends a special beam signal. The purpose of this beam is to wake up the FLiRS device. The FLiRS device alternates between sleep mode and a partially awake mode in which it is listening for this beam signal at the rate ranging from once per second to four times per second (this is the designer's choice). When the FLiRS device receives this beam, it immediately fully wakes up and then communicates with the controller or other Z-Wave device utilizing standard Z-Wave protocol commands. If the device does not hear a Beam it goes back to full sleep for another period until it partially awakes again and listens for a Beam. It is this partially awake mode combined with the special Beam that provides for battery lives on par with fully sleeping devices while providing communications latencies of around one second. Hint For a more in-depth describtion of Z-Wave FLiRS devices, refer to white paper "Z-Wave FLiRS: Enabling Wireless Smart Door Locks and Thermostat" The WakeUp Beam can be seen in the Z-Wave Zniffer. This section will not cover how to capture a Zniffer trace refer to exercise "2A Decrypt Z-Wave RF Frames using the Zniffer" for instructions in how to use the Zniffer. The beam cannot be seen in the Zniffer, if the trace is filtered on HomeID. · Click on Drop Filter in the Zniffer to make sure the trace is not filtered on HomeID. In Figure 7 a trace is shown for a wake-up sequence: · The controller sends 3 requests to the FLiRS device, to ensure the device cannot be reached without beaming, which is a heavy load in the Z-Wave network. · Since the device did not respond to the direct response, a WakeUp beam is initiated. · When the Beam ends, the controller sends the command again, · and the device acknowledges the message. Figure 7: Zniffer trace of a WakeUp Beam Hint: A WakeUp Beam cannot be seen, if the trace is filtered on HomeId. silabs.com | Building a more connected world. Rev. 0.1 | 7 4 Power Consumption of DoorLock Lab 4: Understand FLiRS Devices Power Consumption of DoorLock In this section, we will be using the Energy Profiler in Simplicity Studio to monitor the energy consumption of the DoorLock FLiRS device. 1. In Simplicity Studio, open the "Energy Profiler" by clicking on "Open Perspective" button 2. In the "Energy Monitor" click on "Quick Access" and click on "Start Energy Capture". 3. Select your device in the pop-up window and click OK. in the upper right corner. The Energy Profiler now starts to capture and display the energy consumption, see Figure 8. Notice how the energy consumption raises every section, when the device must wake-up to listen for a Beam. Also notice, the fast wake-up and fall-to-sleep times, resulting in a very low average power consumption. Figure 8: Energy Consumption of a FLiRS device Let's try to wake-up the device. 1. In the PC Controller, send a command to the device (refer to section "3.2 Test the functionality" for instructions) 2. Notice the current consumption when the device wakes up to communicate with the controller. Refer to Figure 9. silabs.com | Building a more connected world. Rev. 0.1 | 8 Lab 4: Understand FLiRS Devices Power Consumption of DoorLock Figure 9: Energy Consumption when Waking Up This concludes the tutorial in how to use a FLiRS device. silabs.com | Building a more connected world. Rev. 0.1 | 9Jim C. Cherry Adobe PDF Library 11.0