This blog is Part 3 in our series about the Thread mesh protocol. In our first blog: Thread: A Low-Power Mesh Network Protocol for IoT we explained how the Thread protocol works and examined the role that each of the key device types play in the network architecture to support the Internet of Things (IoT). In Thread 2: Before You Get Started we looked at why we need Thread, where we can use it, and where it may be the best choice for developers. In this blog we’ll focus on the steps needed for developers to get started on developing their first Thread application, look at some of the tools and resources that can make the whole process easier, and touch on what might be driving the market for this protocol towards growth.
Step 1: Ordering a Product Development Kit
The first step in getting to Hello World with a Thread application is to order your Product Development Kit. Both the Qualcomm® QCA4020 and Qualcomm® QCA4024 Developer Kits are designed for developing low-power IoT applications for solutions such as smart cities, home control and automation, appliances, networking, toys, and home entertainment.
Both kits are designed to help address the IoT ecosystem fragmentation and interoperability challenges that we have spoken of in the previous blogs, by allowing various devices from different manufacturers to talk to each other across different wireless standards, protocols, and communication frameworks. Both kits support the Thread protocol and have advanced hardware-based security features to help improve device protection.
The primary difference between the two models is that the QCA4020 is a tri-mode System-on-Chip (SoC) integrating Bluetooth 5, dual-band Wi-Fi and 802.15.4-based technologies, while the QCA4024 is a dual-mode SoC integrating Bluetooth 5 and 802.15.4-based technologies.
Step 2: Initializing Your Dev Kit and Installing Thread
Once you have your kit, we suggest you watch our Hello World video which will take you step by step through the kit and how to initialize the board. The Thread stack is included with both the QCA4020 and QCA4024 dev kits, so the libraries will already be installed and ready to connect to your Thread network. Check out the QCLI demo sample app that is included with the SDK. The sample app shows you how to initialize, start, stop, set parameters for a Thread network and do much more using command line interface. There are also tutorial videos on how to onboard radios, how to access the sensor values, and a walk through of the command line interface (CLI) features and technologies supported by QCA402x platform.
Step 3: Simulating a Thread Network
OpenThread is an open-source implementation of Thread released by Google. Google released OpenThread to make this networking technology more broadly available to developers to accelerate the development of products for the connected home and commercial buildings. Despite its small code size, OpenThread supports all features defined in the Thread 1.1.1 Specification and implements all Thread networking layers including IPv6, 6LoWPAN, IEEE 802.15.4 with MAC security, Mesh Link Establishment, and Mesh Routing. OpenThread has become the preferred variant for the Thread community due to a narrow platform abstraction layer, a small memory footprint, and being highly portable.
To create your Thread network, go to the Getting Started section on the OpenThread site where you will find all of the step-by-step tutorials (called codelabs). We recommend you go through Simulating a Thread network using OpenThread in Docker. This will walk you through creating a virtual Thread network and creating the framework necessary for developing your first application. Next, with your Qualcomm® QCA402x dev kit ready, try the hardware codelab. In this codelab you'll connect your hardware to your Thread network, manage your Thread network, and pass messages between nodes. Getting Started is also where you will find the OpenThread GitHub site that contains a number of projects related to OpenThread.
Step 4: Choosing an Application Layer Development Tool
Thread is application layer-agnostic, which offers flexibility in choosing which application protocols to run and even allowing multiple applications to run concurrently.
Below, we’ll describe a few of the application layer development tools that were either developed with Thread in mind, or specifically for Thread:
- Dotdot is an open standards application layer that defines a common language for IoT devices to communicate with each other. It is based on the ZigBee Cluster Library, the application layer of the ZigBee networking standard, but it is generalized to work on multiple types of IoT device networks. Dotdot, combined with Thread, is likely to be widely implemented in IoT devices and in development of applications for both home and commercial use. The ThreadGroup has provided a very useful Webinar that explains how Dotdot is aiming to be “The universal language of the Internet of Things”.
- Project Connected Home over IP (CHIP) is an open source, universal application layer, intended to allow devices to communicate with each other and run over the Thread mesh network layer. CHIP offers the flexibility to choose one (or multiple) app layers for your specific use case. For more information on how you as a developer can get started today, check out this ThreadGroup Webinar which explains IoT Convergence with Thread and Project CHIP.
- Constrained Application Protocol (CoAP) is a machine-to-machine lightweight web application layer networking protocol that allows devices to communicate interactively over the Internet. CoAP is suited to very small sensor deployments with tiny form factors and heightened security. The format has similarities to HTTP but offers lower energy and processing consumption combined with smaller packet sizes to better fit very small IoT devices. CoAP runs over UDP (User Datagram Protocol) instead of TCP for further simplification with Datagram Transport Layer Security (DTLS) for datagram-based applications that helps prevent eavesdropping, tampering, or message forgery.
These are only some of the application layer development tool options available. Other options can be found on the Thread Group site.
Step 5: Troubleshooting Tools
So now let’s look at some of the tools for troubleshooting an application running on Thread:
- Wireshark is a free, broadly-used packet analyzer which allows you to dynamically monitor the IEEE 802.15.4 wireless traffic. During development, you may need to know where or why packets are being dropped or identify what is causing your latency issues. Wireshark lets you analyze network traffic in real time, and helps troubleshoot issues on your network. Details for how to start using Wireshark with your OpenThread network, including how to configure the extcap plugin, are in this guide. Wireshark is also utilized by the Thread Test Environment.
- OpenThread Border Router (OTBR) serves as a gateway between the Internet and the Thread network. OpenThread provides an implementation of a Border Router which can be run inside of a Docker container. The OTBR lets developers connect their devices to a virtual border router for testing.
Many developing collaborations between organizations such as KNX, OpenWeave, OCF, and Thread Group are furthering the promise of interoperability by providing compatibility between their own solutions at the application layer with OpenThread. It may be these types of partnerships that are behind the expected smart home growth from USD 76.6 billion in 2018 to USD 151.4 billion by 2024. Clearly the future of the smart home market looks like a promising area for IoT developers.
We hope this blog series has helped you understand how Thread has been designed to help solve the interoperability issues surrounding the connected home and IoT. Thread is specifically designed for low power consumption and IP-based communication, providing a secure, robust, mesh network for IP-enabled smart home and commercial devices. Thread-certified devices are designed to interconnect, which means homeowners, or network administrators, can easily add devices to the network, and application developers understand how these devices work together. If you still need some inspiration, have a look at some of our QCA402x projects, and if you have your own development, please share your project with the rest of the community.
Qualcomm QCA4020, Qualcomm QCA402x and Qualcomm QCA4024 are products of Qualcomm Technologies, Inc. and/or its subsidiaries.