Hands-on Workshop: Using Wireless Connectivity Stacks and Tools to Create Multi-Protocol projects for the Internet of Things (IoT) FTF-SDS-F0042

Similar documents
Quick Start Guide. USB Packet Sniffer/Dongle for Kinetis MKW22D and MKW24D Wireless MCUs USB-KW24D512

ZigBee Technology Overview

Freescale Development Kits IEEE Wireless design made simple. freescale.com/802154

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

Freescale Wireless Connectivity for the Internet of Tomorrow

Wireless Microcontrollers for Environment Management, Asset Tracking and Consumer. October 2009

Microchip Technology. February 2008 Valerio Moretto Slide 1

LoRa FAQs. 1 of 4 Semtech. Semtech Corporation LoRa FAQ

The Internet of Things: Opportunities & Challenges

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

Internet of things (IOT) applications covering industrial domain. Dev Bhattacharya

WISE-4000 Series. WISE IoT Wireless I/O Modules

FLYPORT Wi-Fi G

Silabs Ember Development Tools

WASP User Manual. Revision: 1.6. (c) 2012 North Pole Engineering, Inc.

RN-XV-RD2 Evaluation Board

MeshBee Open Source ZigBee RF Module CookBook

APPLICATION NOTE. AVR2130: Lightweight Mesh Developer Guide. Atmel MCU Wireless. Features. Description

Networking. General networking. Networking overview. Common home network configurations. Wired network example. Wireless network examples

M2M I/O Modules. To view all of Advantech s M2M I/O Modules, please visit

Ethernet Radio Configuration Guide

Maximizing Range and Battery Life in Low-Cost Wireless Networks

Linksys WAP300N. User Guide

An Overview of ZigBee Networks

UG129: ZigBee USB Virtual Gateway Reference Design (RD ) User's Guide

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Honeywell Internet Connection Module

TOSR0X-D. USB/Wireless Timer Relay Module. User Manual. Tinysine 2013 Version 1.0

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

EPI-3601S Wireless LAN PCI adapter Version 1.2 EPI-3601S. Wireless LAN PCI Adapter. (802.11g & b up to 108 Mbps) User Manual. Version: 1.

VisorALARM-Manager Application Quick Guide. (Ver. 1.3) Dm 380-I. V:3.0

Quick Start Guide. TWR-MECH Mechatronics Board TOWER SYSTEM

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Thingsquare Technology

About This Guide SolarEdge Configuration Tool Software Guide. About This Guide

EDK 350 (868 MHz) EDK 350U (902 MHz) EnOcean Developer Kit

Installation Guide Wireless 4-Port USB Sharing Station. GUWIP204 Part No. M1172-a

Building a Basic Communication Network using XBee DigiMesh. Keywords: XBee, Networking, Zigbee, Digimesh, Mesh, Python, Smart Home

Installation Guide. Wireless N Access Point EAP110/EAP120/EAP220

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Troubleshooting Guide

Internet of Things: TI's Wireless Connectivity Solutions

Adding WiFi to Your Embedded System. WPG Americas & Gainspan Titus Wandinger (WPG) & Su Li (Gainspan) April 23, 2013

c. Securely insert the Ethernet cable from your cable or DSL modem into the Internet port (B) on the WGT634U. Broadband modem

ESP 8266: A BREAKTHROUGH IN WIRELESS SENSOR NETWORKS AND INTERNET OF THINGS

Software User Guide UG-461

GlobalSCAPE DMZ Gateway, v1. User Guide

IPv6 Based Sensor Home Networking

Secure, Efficient, and Open Standard Internet of Things

Ultra Thin Client TC-401 TC-402. Users s Guide

Intelligent Street lighting management using ZigBee. Martin SCHULTE-HOBEIN Field Application Engineer, EMEA Digi International

Iridium Extreme TM Satellite Phone. Data Services Manual

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Radiocrafts Embedded Wireless Solutions

Bluetooth to Serial Adapter

Network Enabled Battery Health Monitoring System

HVP-KV31F120M Quick Start Guide

NETGEAR genie Apps. User Manual. 350 East Plumeria Drive San Jose, CA USA. August v1.0

Link Link sys E3000 sys RE1000

The Future of IoT. Zach Shelby VP Marketing, IoT Feb 3 rd, 2015

3.1 RS-232/422/485 Pinout:PORT1-4(RJ-45) RJ-45 RS-232 RS-422 RS-485 PIN1 TXD PIN2 RXD PIN3 GND PIN4 PIN5 T PIN6 T PIN7 R+ PIN8 R-

Setting Up the ZigBee Ethernet Gateway

Application Note: JN-AN-1115 Protocol Analysis with Wireshark

ebus Player Quick Start Guide

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

BLUETOOTH SMART CABLE REPLACEMENT

3G Wireless-N Smart Energy Gateway

USING THE XPERT2 / 9210B ON A TCP/IP NETWORK

Demystifying Wireless for Real-World Measurement Applications

ZIGBEE ECGR-6185 Advanced Embedded Systems. Charlotte. University of North Carolina-Charlotte. Chaitanya Misal Vamsee Krishna

About This Guide SolarEdge Configuration Tool Software Guide. About This Guide

TECHNICAL BULLETIN. Configuring Wireless Settings in an i-stat 1 Wireless Analyzer

USER GUIDE EDBG. Description

Wireless Technologies for Automation

N600 WiFi USB Adapter

Making Sense of Internet of Things Protocols and Implementations

ENHWI-N n Wireless Router

Key requirements for Interoperable IoT systems

Procedure: You can find the problem sheet on Drive D: of the lab PCs. Part 1: Router & Switch

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

HL2170W Windows Network Connection Repair Instructions

2.4GHz / 5GHz Dual CPU 600Mbps 11N AP/Router

Additional Requirements for ARES-G2 / RSA-G2. One Ethernet 10 Base T/100 Base TX network card required for communication with the instrument.

AN1066. MiWi Wireless Networking Protocol Stack CONSIDERATIONS INTRODUCTION TERMINOLOGY FEATURES

Prestige 623R-T. Quick Start Guide. ADSL Dual-link Router. Version 3.40

CT LANforge WiFIRE Chromebook a/b/g/n WiFi Traffic Generator with 128 Virtual STA Interfaces

Bluetooth 4.0 Solutions for Apple ios Devices. Bluegiga Technologies

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM Version 1.32r 10/9/2012 USER MANUAL

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

USER GUIDE AC2600 MU-MIMO GIGABIT ROUTER. Model# EA8500

11 Internet of Things (IoT) Protocols You Need to Know About

Wireless Communication With Arduino

User s Manual TCP/IP TO RS-232/422/485 CONVERTER. 1.1 Introduction. 1.2 Main features. Dynamic DNS

LoRaWAN. What is it? A technical overview of LoRa and LoRaWAN. Technical Marketing Workgroup 1.0

APPLICATION NOTE. AVR2052: BitCloud SDK Quick Start Guide. Atmel MCU Wireless. Introduction. Features

Nokia Siemens Networks. CPEi-lte User Manual

1 Serial RS232 to Ethernet Adapter Installation Guide

BLE113 DEVELOPMENT KIT

Transcription:

Hands-on Workshop: Using Wireless Connectivity Stacks and Tools to Create Multi-Protocol projects for the Internet of Things (IoT) FTF-SDS-F0042 Alan Collins Wireless Applications Engineer Alin Lazar Software Team Manager Angel Corona Connectivity Engineer A P R. 2 0 1 4 TM External Use

Session Introduction This session will: Provide an overview on the wireless connectivity and its challenges for the IoT Show Freescale innovative solutions for wireless connectivity. Introduce the Dual-PAN concept: single radio participating in two complex networks simultaneously. This translates into a cost effective design. Hands-on training using complex software stacks to enable multiple wireless protocols External Use 1

Session Objectives After completing this session you will be able to: Start your IoT design and development understanding the wireless connectivity landscape & challenges. Use complex wireless multi-protocol software stack for embedded systems. Locate the documentation and reference designs to help you on your IoT product. External Use 2

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 3

Dual-PAN Concept Overview What exactly is the Dual-PAN? PAN Personal Area Network Dual-PAN Id feature allows a single 802.15.4 radio participate in different networks simultaneously External Use 4

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-on training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 5

The Internet of Things M2M. Connectivity. Context. External Use 6

IoT Use cases Smart Connectivity Personalized Marketing Statistical behavior New Patterns search triggered by relevant events Remove/Add feature-set to existing/new products Others we can imagine, Others we will discover External Use 7

Slices of the IoT pie: We all want a piece of it ACTUATORS Motors Water Engines Hydraulic Motion control Servomechanisms CONNECTIVITY Wired & Wireless Protocol Standards Ethernet USB Wi-Fi Bluetooth 4.1 ZigBee ANT+ IPv6 + 6LoWPAN SENSORS Compass Magnetometer Accelerometer Touch sensor Gyroscope Altimeter/pressure Temperature Humidity MICROCONTROLLERS 8-, 16-, 32-bit Low Power Frequency of operation Memory Inputs/Outputs Serial Interfaces & Connectivity Built-in Analog and Sensors External Use 8

Slices of the IoT pie: We all want a piece of it BIG DATA & ANALYTICS Collection of data sets Large & complex Database management tools Statistical analysis CLOUD Software, platforms and infrastructure Services Remotely through the internet Share resources to achieve coherence & economies of scale SECURITY Encryption High security across protocols and layers Network access Data access Weakest link in the chain in the most important FRONT-END User Interface Smart Phones, Tablets, TV, Laptop External Use 9

IoT Building blocks CLOUD BIG DATA & ANALYTICS Connectivity Connectivity MCU Sensors Connectivity Connectivity Gateway Actuator Microcontroller Edge Node External Use 10

IoT is all about the services Existing Business model New opportunities for users and service providers Thank you for downloading your new IoT service. It s free of charge, we just need your permission to access to your profile data. Please read the following agreement More things are connecting to the Internet than people over 12.5 billion devices in 2010 alone. We will have 50 billion devices connected by 2020. Cisco s Internet Business Solutions Group External Use 11

Wireless Connectivity for the IoT External Use 12

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 13

Dual-PAN Use Cases Pick two network flavors from the protocols landscape: Smart Energy Home Automation RF4CE ZigBee IP (Smart Energy 2.0) IPv6 through 6LoWPAN adaptation for 802.15.4 Enable CoAP and other RESTful architecture frameworks 802.15.4 Proprietary All others ZigBee IP RF4CE ZigBee 2007/PRO ZigBee SE 2.0 Application Profiles RF4CE Network 802.15.4 MAC Security Application Framework Application Support Sub-Layer Network 802.15.4 MAC ZigBee Device Objects NWK manage r (ND, RPL) TC P IPv6 UDP 6LowPAN adaptation 802.15.4 MAC Security IP stack IPv6, IPv4 6LowPAN adaptation 802.15.4 MAC 802.15.4 PHY 802.15.4 PHY 802.15.4 PHY 802.15.4 PHY External Use 14

Dual-PAN Use Case: Smart Energy & Home Automation Smart Energy Network Security enhanced. Utilities own the network Smart Energy External Use 15

Dual-PAN Use Case : Home Automation Network Smart Energy Network Security enhanced. Utilities own the network Home Automation Network Residential Security. Home owns the network Smart Energy Home Automation External Use 16

Dual-PAN Use Case : Smart Energy and Home Automation Smart Energy Network Security enhanced. Utilities own the network Home Automation Network Residential Security. Home owns the network Dual-PAN Smart Energy & Home Automation Smart Energy Home Automation Dual PAN SE/HA External Use 17

IoT Convergence to IP Funnel Web services / EXI APP CoAP, SE 2.0, HTTPS,...etc Transport TCP, UDP Network IP (v6, v4) Link/PHY Wi-Fi, Ethernet, BT 4.1, PLC, 802.15.4, Etc External Use 18

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 19

Multiple Radios Solution : Example One Two radios Two antennas and all RF components Two crystals (oscillators) Complex RF certification External Use 20

Multiple Radios Solution : Example Two MCU controls two stand alone radios using a communication interface Reduces cost, but increase the engineering complexity Still two antennas are needed with all RF components External Use 21

Dual-PAN Concept Overview - AGAIN What exactly is the Dual-PAN? PAN Personal Area Network Dual-PAN Id feature allows a single 802.15.4 radio participate in different networks simultaneously External Use 22

Where s the Complexity of Dual-PAN? TX is simple Just take control of the Radio and perform TX If ACK is required you wait in RX right after the TX TX: PAN 0 TX: PAN 0 TX: PAN 0 Dual-PAN enabled TX: PAN 1 TX: PAN 1 ACK External Use 23

Where s the Complexity of Dual-PAN? RX RX requires more complexity and synchronization TX: PAN 0 RETRY Dual-PAN enabled TX: PAN 1 External Use 24

Dual-PAN by SW Solution Dual-PAN by software Takes longer time to respond on each network Some automatic filtering features (MAC ACK, NWK address, PAN ID and etc.) cannot be used External Use 25

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-on training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 26

Freescale Dual-PAN Feature Implementation How the Dual-PAN works Maintains two sets of network parameters PAN, MAC address, Network Address, Operation Channel Supports manual and automatic modes for switching between networks Manual controlled by software Auto controlled by hardware Device can function as a coordinator, router or end device on each network. PAN0 MacPANID0 (16-bit register) MacShortAddrs0 (16-bit register) MacLongAddrs0 (64-bit registers) PANCORDNTR0 (1-bit register) Channel0 PAN1 MacPANID1 (16-bit register) MacShortAddrs1 (16-bit register) MacLongAddrs1 (64-bit register) PANCORDNTR1 (1-bit register) Channel1 External Use 27

Dual-PAN in Multiple Channels 2 PANs, 2 Channels Time to dwell on channel can be set from 0.5 ms to 3.2 seconds Dwell prescaler and dwell selector registers If PAN is active when timer expired, sequence will complete before channel switch occurs Channel switch is 68 us Time to switch, poll, receive packet and switch back is <10ms 2 PANs, 1 Channel Address filtering is done simultaneously No channel switch is necessary External Use 28

Dual-PAN : Manual Mode External Use 29

Dual-PAN : Auto Mode External Use 30

Dual-PAN ID Demonstration 3 TWR-MKW2xDxxx boards Software available (http://www.freescale.com/beekit) Demonstrates Dual-PAN ID feature in AUTOMATIC mode @ 802.15.4 MAC layer 1 FFDC (coordinator) 2 RFD (End devices) Coordinator will create 2 networks (2 PAN IDs, 2 Channels) Each End Device will join one network The End Devices will perform Packet Error Test addressing the Coordinator The Coordinator shows how many packets it received from each End Device in different PAN ID External Use 31

Dual-PAN ID Demonstration 802.15.4 MAC Layer End Device Menu Coordinator Menu External Use 32

Freescale Multi-PAN Tool External Use 33

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 34

What is KW Series? Extension of Kinetis line to include Wireless connectivity MKW2x IEEE-802.15.4 Radio for the 2.4 GHz space MKW01x Very flexible Radio for the Sub-GHz space Kinetis W is available today. More information available in the following link: http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=kinetis_ W_SERIES External Use 35

Choosing the Right Wireless Technology 2.4GHz Sub-GHz Range: ~ 30m indoor, ~ 100-300m outdoor Robust NWK protocols (Like ZigBee) enable multi hoping. High effective data rate 802.15.4 (250kbps) PWR consumption Less time on-air Years of battery life Quick TX/RX turnaround time Retries and ACKS mechanism Smaller Antenna Size 2.4 GHz ~ 3.1cm Global standards for the IoT Exhibits significantly longer range ~ 100m indoor, ~ 500-800m outdoor Better building penetration capability. Typically lower data rate 50 100kpbs Reduced power consumption Low interference = easier transmissions + fewer retries Years of battery life Antenna Size 433MHz ~17.3cm 915MHz ~8.2cm Proprietary standards Lower deployment and operating costs External Use 36

Kinetis W Series: KW2x Wireless MCUs CPU Up to 50 MHz Cortex -M4 16-channel-DMA Up to 512 KB Flash, 64 KB RAM, and 4k bytes of enhanced EEPROM/FlexRAM. Up to 64K FlexNVM (MKW21D256 only) Typical current consume: 250 ua/mhz run, 1.7uA RTC standby Radio Transceiver, 2.4GHz Highly integrated 2.4 GHz RF transceiver 802.15.4 Packet processor Supports single ended and diversity antennas Dual PAN support 110 dbm Link budget Programmable output power -30 to +8 dbm Sensitivity -102 dbm Low Power: TX 15mA @ 0dBm (CPU sleep), RX 15mA (CPU sleep) Security Cryptography Acceleration Unit (CAU) AES encryption (FIPS 140) External tamper detect 32-bit CRC System SPI (1), UART (2), I²C (2), USB FS OTG (KW22 and KW24) 8-channel 16-bit SAR ADC, 6-bit DA Real-Time Clock (RTC) Up to 24 GPIO, Multiple KBI Operating temperature of 40 C to 105 C Device Flash RAM Feature Package MKW21D256VHA5 256 KB 32 KB No USB 8x8 56-pin LGA MKW22D512VHA5 512 KB 64 KB USB 8x8 56-pin LGA MKW24D512VHA5 512 KB 64 KB USB and Smart Energy 2.0 8x8 56-pin LGA http://www.freescale.com/kw2x External Use 37

KW20 Development Kit Tower Form Factor Use standalone or in Tower System Boards sold individually Combine as many boards as needed USB-dongle Form Factor Use is as sniffer hardware Host processors USB-KW24D512 Available in Q2-2014 TWR-KW21D256 or TWR-KW24D512 External Use 38

RF Hardware Support External Use 39

Freescale ZigBee Stacks IP stack 802.15.4 ZigBee PRO ZigBee IP SynkroRF HID RF4CE Customer Defined & Developed Customer Developed ZigBee Profiles ZigBee NWK Customer Developed ZigBee Profiles ZigBee IP NWK Customer Defined SynkroRF NWK Customer Developed RF4CE Profiles RF4CE NWK 802.15.4 MAC 802.15.4 MAC 802.15.4-2006 MAC 802.15.4 MAC 802.15.4 MAC 802.15.4 PHY 802.15.4 PHY 802.15.4 PHY 802.15.4 PHY 802.15.4 PHY Hardware Hardware Hardware Hardware Hardware External Use 40

802.15.4 Protocol Stack Comparison Feature SMAC 802.15.4 MAC SynkroRF ZigBee RF4CE ZigBee Pro IP stack ZigBee IP Applications Cable Replacement Remote Control Home Control Home Automation Health Care Building Automation Smart Energy Network Stack No No Yes Yes Yes Yes Yes Application Profiles No No No Yes Yes No Yes Memory Requirement s 4-8K 32K <40K <40K 128-160K 256K 256K Network Topology Typical # of Nodes Typical Data Throughput Point-to- Point Peer-to- Peer Co-existing Star Co-existing Star Star Tree Mesh 32 per 32 per 2-1000 2-100 2-1000 Controlled Target ZigBee Device Device Pro Tree Mesh Mesh 2-32 2-32 50-115K 90-115K 70-100K 70-100K 30-70K <50K <50K External Use 41

ZigBee Test Infrastructure and Tools External Use 42

ZTC BlackBox and Test Serial API 100s of APIs and events available across layers External Use 43

ZigBee Test Client External Use 44

Python Test Automation External Use 45

MKW2x key differentiators Dedicated Hardware: Dual PAN ID Participate in two networks simultaneously Antenna Diversity Reduce multipath fading MCU with powerful core and energy efficiency options Flash / RAM capacity High radio link budget 802.15.4 hardware engine HW and SW enablement / support External Use 46

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 47

Hands-On Objective Work with the Dual PAN feature of Kinetis KW2x in practice Use a single KW2x device with a multi-protocol network hub (gateway) application to implement 2 Dual PAN scenarios: 1. ZigBee Home Automation + ZigBee Smart Energy 2. UDP over IPv6 / 6LoWPAN + ZigBee Home Automation External Use 48

Dual PAN ZigBee Home Automation and Smart Energy Dual PAN Hub ZHA Combined Interface SE Energy Service Interface ZigBee Home Automation Network ZigBee Smart Energy Network ZHA Dimmable Light SE Meter External Use 49

Dual PAN 6LoWPAN and ZigBee Home Automation Dual PAN Hub ZHA Combined Interface IPv6 Data Concentrator ZigBee Home Automation Network UDP over IPv6 and 6LoWPAN ZHA Dimmable Light IPv6 End Node External Use 50

Hands-On Steps 1. Use MSD to program Dual PAN network hub firmware to TWR- KW24 2. Use BeeKit and IAR EWARM to export and deploy ZigBee applications end-nodes. 3. Create ZigBee Home Automation and Smart Energy Dual PAN networks. 4. Control and monitor ZHA and SE end-nodes from the Dual PAN hub. 5. Deploy 6LoWPAN end-node firmware to TWR-KW24. 6. Create Home Automation and 6LoWPAN Dual PAN networks. 7. Control and monitor IPv6 and ZHA end-nodes from the Dual PAN hub. External Use 51

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 52

STEP 1: Program Hub Firmware to TWR-KW2x External Use 53

TWR-KW2x Hub Board Setup Plug in the 1st of the 3 TWR-KW2x board to the PC using the mini-usb port Check that switch SW5 next to the mini-usb port is set to the position towards the exterior of the board this allows the board to be powered via mini-usb If needed, wait for device to be detected by Windows and drivers to be installed. External Use 54

TWR-KW2x Hub Board Setup External Use 55

TWR-KW2x Mass Storage Device Launch Windows Explorer and verify that a USB Mass Storage Device called TWRKW2xDxxx is present. This allows easy binary firmware programming using regular file copy-paste: External Use 56

Program Hub Firmware to TWR-KW2x Using MSD Open the Firmware DualPAN_ZHA_SE subfolder on your desktop Open the TWRKW2xDxxx mass storage drive root folder Drag and drop (or copy-paste) DualPAN_Hub_HA_SE_StnXX.srec file from DualPAN_ZHA_SE subfolder to TWRKW2xDxxx to begin firmware programming Wait while KW2x flash memory is updated with new firmware. Green LED D11 will blink during the process External Use 57

Firmware Update Verification When the firmware update is completed successfully, blue LEDs D5 and D7 will be blinking. External Use 58

Disconnect the Board Disconnect the board before proceeding with deploying the other two end node applications. We will reconnect it once we are ready to start the wireless network formation External Use 59

STEP 2: Use BeeKit to deploy ZHA and Smart Energy end nodes External Use 60

Launch BeeKit Launch the Freescale BeeKit configuration GUI: External Use 61

Select Codebase Choose File Select Codebase External Use 62

Select Codebase Select Kinetis BeeStack 4.0 Codebase and click Set Active 1 2 External Use 63

Create New Project Choose File New Project External Use 64

Create New Project: HA Dimmable Light 1. Select ZigBee Home Automation Applications Project Type 2. Select Ha DimmableLight Template 3. Enter solution name. 4. Enter solution folder location 5. Click OK 1 2 3 4 5 External Use 65

BeeKit Wizard Configuration Overview Review default configuration and click Next External Use 66

BeeKit Wizard Target Board Leave board settings to TWR-KW24D512 and click Next External Use 67

BeeKit Wizard Platform Modules Uncheck NVM module for application to revert to factory defaults on reset. 1 2 External Use 68

BeeKit Wizard ZTC Enable ZTC UART interface to Test Tool. 1 2 External Use 69

BeeKit Wizard Device Type Select Router ZigBee device type. 1 2 External Use 70

BeeKit Wizard Concentrator Leave default concentrator settings. External Use 71

BeeKit Wizard Security Settings Leave default Network Security Parameters. External Use 72

BeeKit Wizard Security Keys Leave default Network Security Key settings. External Use 73

BeeKit Wizard Addresses Update PAN ID to be set to format 00 XX, where XX is your work station ID. E.g.: if your station has ID: 02, set PAN ID to be 00 02. 1 2 External Use 74

BeeKit Wizard RF Channel Update default RF channel to be the one assigned to your work station. E.g.: if the station has ID: 2, set channel to 12. 1 2 External Use 75

BeeKit Wizard OTA Upgrade Leave OTA Upgrade default settings. Click Finish to complete wizard. External Use 76

Adding a Second Project for Smart Energy In the BeeKit Solution Explorer, right-click on top level solution and choose Add Project External Use 77

Create New Project: SE Metering Device 1. Select ZigBee Smart Energy Applications Project Type 2. Select SE Metering Device Template 3. Click OK 1 2 3 External Use 78

BeeKit Wizard Configuration Overview Review default configuration and click Next External Use 79

BeeKit Wizard Target Board Leave board settings to TWR-KW24D512 and click Next External Use 80

BeeKit Wizard Platform Modules Uncheck NVM module for application to revert to factory defaults on reset. 1 2 External Use 81

BeeKit Wizard Device Type Leave default settings for device type. Meter will be an end device. External Use 82

BeeKit Wizard Low Power Mode Leave default settings for Low Power Mode. External Use 83

BeeKit Wizard Concentrator Leave default settings for Concentrator Mode. External Use 84

BeeKit Wizard Security Settings Leave default settings for security settings, including ECC. External Use 85

BeeKit Wizard Security Keys Leave default settings for Network Security Keys. External Use 86

BeeKit Wizard Addresses Update PAN ID to be set to format 50 XX, where XX is your work station ID. E.g.: if your station has ID: 02, set PAN ID to be 50 02. 1 2 External Use 87

BeeKit Wizard RF Channel Update default RF channel to be the one assigned to your work station. E.g.: if the station has ID: 2, set channel to 12. 1 2 External Use 88

BeeKit Wizard OTA Upgrade Leave OTA Upgrade default settings. Click Finish to complete wizard. External Use 89

Export Projects Choose Solution Export and Open Solution in CodeWarrior / IAR Embedded Workbench External Use 90

Export Projects to IAR EWARM Ensure IDE is set to IAR Embedded Workbench, click OK and wait for projects to be exported and launched in IAR EWARM. 1 2 External Use 91

IAR EWARM Workspace IAR EWARM workspace launches with the 2 end node projects. External Use 92

IAR EWARM Workspace Right click on each of the 2 projects (Ha DimmableLight and Se MeteringDevice) in EWARM workspace and choose Make to build the applications firmware. 1 2 External Use 93

TWR-KW2x Dimmable Light Board Setup Plug in the 2nd of the 3 TWR-KW2x board to the PC using the mini-usb port Check that switch SW5 next to the mini-usb port is set to the position towards the exterior of the board this allows the board to be powered via mini-usb If needed, wait for device to be detected by Windows and drivers to be installed. External Use 94

Download Firmware Using IAR EWARM Ensure Ha DimmableLight is highlighted (in bold) in workspace External Use 95

Download Firmware Using IAR EWARM Choose Project Download Download active application 1 4 2 3 External Use 96

Download Firmware Using IAR EWARM 1. Push the SW6 Reset on the TWR-KW2x board 2. LED D5 will blink 2 1 External Use 97

Disconnect the HA Dimmable Light Board Disconnect the board before proceeding with deploying the other application. We will reconnect it once we are ready to start the wireless network formation External Use 98

TWR-KW2x SE Metering Device Board Setup Plug in the 3rd of the 3 TWR-KW2x board to the PC using the mini-usb port Check that switch SW5 next to the mini-usb port is set to the position towards the exterior of the board this allows the board to be powered via mini-usb If needed, wait for device to be detected by Windows and drivers to be installed. External Use 99

Set SE Metering Device to Active Right-click Se MeteringDevice entry and select Set as Active External Use 100

Download Firmware Using IAR EWARM Choose Project Download Download active application 1 4 2 3 External Use 101

Download Firmware Using IAR EWARM 1. Push the SW6 Reset on the TWR-KW2x board 2. LED D5 will blink 2 1 External Use 102

Disconnect the SE Metering Device Board Disconnect the board before proceeding. We will reconnect it once we are ready to start the wireless network formation. External Use 103

STEP 3: Create ZHA and Smart Energy Networks External Use 104

Reconnect TWR-KW2x DualPAN Hub Board Reconnect the first board (programmed with Hub firmware) to the PC. External Use 105

Start Device Manager In Windows, enter Device Manager in Start menu search box, then select the Device Manager entry once found in search results. 2 1 External Use 106

Determine Hub Device COM Port In Device Manger, determine hub device COM Port by determining the Port number assigned to OpenSDA CDC device. External Use 107

Setup Connection in Terminal Application Setup a Connection in Putty or Tera Term to previously determined port on baud rate 115200bps. 2 3 1 External Use 108

Verify Shell Functionality Press SW6 Reset switch on TWR-KW2x hub to show shell banner in terminal application TWR-KW2x DualPAN Hub ZHA + ZSE. Build: Mar 24 2014 Copyright (c) 2014 Freescale Semiconductor $ _ External Use 109

Start ZigBee HA Combined Interface on 1 st PAN (zigbee0) $zigbee0 start ZigBee Pro with ZHA ZCL BeeStack v5.0.0.008 on PAN0 zigbee0 node ZC zigbee0 channel 12 zigbee0 panid 0xE253 zigbee0 nwkaddr 0x0000 zigbee0 extpanid 0x0050C215857039A2 Check initial 2.4 GHz RF channel assigned to station (11-26) Check initial PAN ID assigned to station. HA Coordinator will always have Network Address 0x0000 Extended PAN ID is randomly generated External Use 110

Joining HA Dimmable Light Node On Light Node: press SW3 to join Light is joined to hub when LED D5 becomes solid blue and a transport key security indication is shown in shell interface zigbee0 rx: transport key panid 0x0002 addr 0xE431 Combined interface provisions security key as a trust center to the Light NWK address of Light Device Is random External Use 111

STEP 4: Control and Monitor ZHA and SE End Nodes External Use 112

Discovering End Point and Setting Default Address Info $ zcl0 find levelctrl server zcl0: find levelctrl server... Discover Address and Endpoints for a ZHA device that can be level controlled in the ZigBee Network zcl0 rx: find levelctrl server match: addr 0xE431 endpoint 0x08 $ zcl set addrinfo dstaddr 0xE431 dstep 0x08 zcl0: setaddrinfo...success Discovered Light Information Use info above. Note: destaddr value will be different in practice!! External Use 113

Controlling HA Dimmable Light Application On Light: Press and HOLD SW4 for app mode All blue LEDs will be initially off in app mode $ zcl0 send level move up zcl0 rx: Data confirm status success $ zcl0 send level move down zcl0 rx: Data confirm status success Note how LEDs D6, D7, D8 turn on and back off to emulate a light dimming up and down NWK address of Light Device Is random External Use 114

Starting SE Energy Service Interface Hub on 2 nd PAN (zigbee1) $ zigbee1 start ZigBee Pro with SEP ZCL BeeStack v5.0.0.008 on PAN1 zigbee1 node ZC zigbee1 channel 12 zigbee1 panid 0x5002 zigbee1 nwkaddr 0x0000 zigbee1 extpanid 0x0050C2C5D3A49B73 Check initial 2.4 GHz RF channel assigned to station (11-26) Check initial PAN ID assigned to station. Coordinator will always have Network Address 0x0000 Extended PAN ID is randomly generated External Use 115

Joining SE Metering Device Node On SE Metering Device Node: press SW3 to join The node is joined to hub when LED D5 becomes solid blue and a transport key security indication is shown in shell interface zigbee1 rx: transport key panid 0x5002 addr 0x96C3 External Use 116

Retrieving SE Metering Data After joining, the metering device will periodically transmit meter data The DualPAN hub will display the data in the shell zcl1 rx: srcaddr 0x96C3 srcep 0x08 dstep 0x08 seq 0x07 channel 12 zcl1 rx seq 0x07: report attr metering 0x0000 "Current summation dlvrd" value 0x0000000016BE The current meter reading External Use 117

Changing Operating Frequency for ZigBee HA / SE $ zigbee0 set channel 13 zigbee0 set channel 12 success $ zigbee1 set channel 14 zigbee1 set channel 14 success Pick a value between 11 and 26 different than the pre-assigned channel. Both ZHA and SE networks will shift to use another 2.4GHz RF frequency channel. $ zcl0 send onoff toggle zcl0 rx: Data confirm status success ZHA commands are now sent on different channel. $ zcl0 send onoff toggle zcl0 rx: Data confirm status success External Use 118

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-On training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 119

STEP 5: Program 6LoWPAN Firmware to TWR-KW2x External Use 120

Reset the 3 Boards Push the SW6 Reset on each TWR-KW2x board External Use 121

MSD Firmware Loading Exercise Use the MSD procedure to re-flash boards #1 and #3 (currently DualPAN Hub and SE MeteringDevice) using new firmware: Open Firmware DualPAN_ZHA_IPv6 subfolder on your desktop Open the TWRKW2xDxxx mass storage drive root folder for each board. Drag and drop (or copy-paste) DualPAN_Hub_HA_IPv6_StnXX.srec and IPv6_EndNode_StnXX.srec to boards #1 and #3 respectively External Use 122

STEP 6: Restart the ZigBee Network and Create 6LoWPAN Network External Use 123

Verify Shell Functionality Connect hub with new firmware to PC. Press SW6 Reset switch on TWR-KW2x hub to show shell banner in terminal application: TWR-KW2x DualPAN Hub ZHA + 6LoWPAN. Build: Mar 24 2014 Copyright (c) 2014 Freescale Semiconductor $ _ External Use 124

Restarting ZigBee Combined Interface Hub on 1 st PAN $ zigbee start ZigBee Pro with ZHA ZCL BeeStack v5.0.0.008 on PAN0 zigbee0 node ZC zigbee0 channel 12 zigbee0 panid 0x0002 zigbee0 nwkaddr 0x0000 zigbee0 extpanid 0x0050C22F7513C3D3 Check initial 2.4 GHz RF channel assigned to station (11-26) Check initial PAN ID assigned to station. HA Coordinator will always have Network Address 0x0000 Extended PAN ID is randomly generated External Use 125

Rejoining HA Dimmable Light Node On Light Node: press SW3 to re-join Light is joined to hub when LED D5 becomes solid blue and a transport key security indication is shown in shell interface zigbee0 rx: transport key panid 0x0002 addr 0xE431 Combined interface provisions security key as a trust center to the Light NWK address of Light Device Is random External Use 126

STEP 7: Control and Monitor ZHA and 6LoWPAN Nodes External Use 127

Discovering End Point and Setting Default Address Info $ zcl find levelctrl server zcl0: find levelctrl server... Discover Address and Endpoints for a ZHA device that can be level controlled in the ZigBee Network zcl0 rx: find levelctrl server match: addr 0xE431 endpoint 0x08 $ zcl set addrinfo dstaddr 0xE431 dstep 0x08 zcl0: setaddrinfo...success Discovered Light Information Use info above. Note: dstaddr value will be different in practice!! External Use 128

Controlling HA Dimmable Light Application Level Control On Light: Press and HOLD SW4 for app mode All blue LEDs will be initially OFF in app mode $ zcl send level move up zcl0 rx: Data confirm status success $ zcl send level move down zcl0 rx: Data confirm status success Note how LEDs D6, D7, D8 turn on and back off to emulate a light dimming up and down NWK address of Light Device Is random External Use 129

Sending Light On/Off Cluster Toggle Commands $ zcl send level move up zcl0 rx: Data confirm status success $ zcl send onoff toggle zigbee0 rx: Data confirm status success Repeat toggle several times. Hint: press Up Key to re-load command from shell history $ zcl send onoff toggle zigbee0 rx: Data confirm status success On Light Node: note LEDs toggling on/off External Use 130

Pinging the 6LoWPAN Node via ICMPv6 on 2 nd PAN Use value assigned to the global IPv6 address of the End node for your Work station. Example uses the value for Station 02 $ ping 2003::d0b8:8372:6354:4536:0002 1000 10 Pinging 2003::d0b8:8372:6354:4536:0002 with 32 bytes of data Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=15ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=25ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=26ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=18ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=18ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=23ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=19ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=22ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=24ms Reply from 2003::d0b8:8372:6354:4536:0002: bytes=32 time=21ms... External Use 131

Opening and Sending Data on UDP Socket over 6LoWPAN $ socket open udp 2003::d0b8:8372:6354:4536:0002 1234 Opening Socket on Data Concentrator... OK Socket id is: 0 Port $ socket send 0 led2on Command was sent $ socket send 0 led2flash Command was sent Send LED On/Off commands also over IPv6 Link. Note LED D6 on IP End Node Use value assigned to the global IPv6 address of the IP End node for your station. Example uses the value for Station 02 $ socket send 0 led2off Command was sent External Use 132

Polling UDP Socket for Data $ socket poll 0 2500 Keys:0000 Temp:29.64 Leds:1000 Keys:0000 Temp:29.59 Leds:0000 Keys:0000 Temp:29.56 Leds:1000 Keys:0000 Temp:29.56 Leds:0000 Keys:0010 Temp:29.83 Leds:1000 Keys:0010 Temp:30.19 Leds:0000 Keys:0010 Temp:29.83 Leds:1000 Keys:0010 Temp:29.75 Leds:0000 Keys:0010 Temp:29.75 Leds:0000 Temperature is read from KW2x internal sensor. Keys pressed and LED state is also transmitted when polled periodically. <Ctrl-C> <INTERRUPT> External Use 133

Closing the UDP Socket $ socket close 0 Socket 0 was closed External Use 134

Using Ubiqua and Test Tool for Protocol Analysis External Use 135

Adding a Sniffer Device Launch Ubiqua Plug-in Sniffer device such as MC1322x-USB or KW2x-USB Select Device Add Device External Use 136

Adding a Sniffer Device 1. Select Vendor: Freescale 2. Select COM port number in device list. This example uses MC1322x 3. Select Application: Sniffer 4. Click: Add Device 2 1 3 4 External Use 137

Select RF Channel to Monitor In Ubiqua Device Manager: right click sniffer device, choose Channel then select the channel to use 1 2 3 External Use 138

Select Protocol to Decode In Ubiqua Device Manager: right click sniffer device, choose Protocol Stack then select the protocol to use (e.g.: ZigBee for ZHA and SE, or IETF 6LoWPAN) 1 2 3 3 External Use 139

Starting the Capture In Ubiqua Device Manager: Set the Capture Knob to On Status will change from Idle to Capturing External Use 140

ZHA Capture Example External Use 141

Decoding ZCL Level Control Command: Move Up External Use 142

6LoWPAN Capture Example External Use 143

Test Tool ZigBee Test Client (ZTC) Serial Command Console All ZigBee commands Double click Ha Dimmable Light COM on baudrate 38400 Parameters for Each Command Command and Macro Shortcuts Send Command Serial TX/RX ZTC Message Log External Use 144

Agenda IoT overview Multiple-protocol networks Use cases Solutions Dual-PAN Freescale Kinetis W series MCUs Hands-on training Dual-PAN example 1: ZigBee HA + ZigBee SE Dual-PAN example 2: ZigBee HA + IP stack Summary External Use 145

Summary The IoT challenge of multi-protocols landscape Dual-PAN feature allows a single 802.15.4 radio to participate in two networks simultaneously Dual-PAN is flexible enough to support different application requirements Dual-PAN translates into a cost efficient design while maintaining good performance Kinetis W series Adding Wireless Connectivity to powerful MCUs Low Power oriented Terrific enablement tools and Software support EASE of USE of complex software stacks External Use 146

www.freescale.com 2014 Freescale Semiconductor, Inc. External Use