Set Up Environment

Last Updated on : 2023-01-29 07:32:07download

This topic describes how to set up the development environment for the Zigbee SDK.

Install the build tool

  • Keil: Visit Keil website and download Keil uVision5 (5.26.2). Choose this tool if you use the Phyplus platform.

  • IAR: Visit IAR website and download IAR Embedded Workbench for Arm. Choose this tool if you use the Silicon Labs platform.

    Make sure to use the genuine IAR Embedded Workbench for ARM 8.40.1 or later versions. Version 8.40.1 is strongly recommended.

  • Python: Building a Zigbee application project depends on Python scripts, so you need to install Python 3.8.x.

    The development environment for Zigbee SDK is set up on Windows, so Python should be installed on Windows.

    Go to Python website and download Python 3.6, 3.7, or 3.8. When you install the software, select Add Python 3.8 to PATH.

    Set Up Environment

    If you choose Customize installation, make sure to install pip 20.x or later versions.

    After installation, restart your computer. Then, press the Window + R key to open the Run dialog. Enter cmd and press Enter for the command prompt. Enter python -V. If the Python version is returned, it means the environment variable is configured.

    Set Up Environment

Install Tuya Wind IDE

Tuya Wind IDE is an all-in-one integrated development environment for TuyaOS development. This self-serve IDE allows you to get SDKs, debug and build code, flash firmware and authorize chips in one place. You just download Visual Studio Code and install the Tuya Wind IDE extension to get started with TuyaOS SDK development on Linux, Windows, or macOS.

  1. Go to Visual Studio Code website, and download and install the latest version. Search for Tuya Wind IDE in the extension marketplace and install it.

    A Python environment is required to install Tuya Wind IDE, so make sure you have Python installed on your system.

    Set Up Environment
  2. Click the Tuya Wind IDE icon in the left sidebar to open the IDE. Choose Tuya Home and log in with the account of the Tuya IoT Development Platform. If you do not have an account yet, register with the Tuya IoT Development Platform.

    Set Up Environment
  3. If you have a blank screen when you open Tuya Wind IDE, set the port to 8320.

Get development framework and product development kit

The development framework, built atop the vendor SDK, is the framework code for the business layer. The product development kit contains demos for product development such as electrical products, sensors, and lighting products.

Create development framework

  1. Open Tuya Wind IDE and choose Create Framework.

    Set Up Environment
  2. Choose the desired development kit by chip and click Done to start downloading the file.

Description of development framework

TuyaOS Zigbee sub-device development kit works for developing Zigbee 3.0 compatible products. It abstracts away much of the complexity required to adopt Zigbee technologies and is integrated with TuyaOS technologies to help you quickly get started with Zigbee development. The development framework contains the vendor SDK, feature libraries, hardware interfaces, networking interfaces, components, and tools. Various sample applications are also available to walk you through the use of APIs and Zigbee development specification.

Development framework directory

.
├─ hardware
│  ├─ chip_manual
│  └─ module_manual
├─ pc
│  └─ tools
├─ TuyaOS
│  ├─apps
│  │  └─tuyaos_demo_zg_light2
│  ├─components
│  ├─docs
│  ├─include
│  │  ├─adapter
│  │  ├─base
│  │  └─components
│  ├─libs
│  ├─scripts
│  ├─tools
│  └─vendor
└─ tuya.json
Directory name Description
hardware Includes hardware datasheets.
pc Includes tools for PC provided by semiconductor vendors.
apps Includes demo apps, allowing you to quickly develop applications by editing the sample code.
components Includes open-source components. You can create a folder to store your components.
doc Includes development documentation.
include Includes APIs for TuyaOS sub-device development.
lib Includes the libraries on which TuyaOS sub-device development depends.
scripts Includes script files.
tools Includes tools and scripts for compilation.
vendor Includes the optimized Zigbee vendor SDK.

Description of product development kit

You can get the product development kit with the following method. The downloaded demo will be stored in the apps directory.

The directory of the demo file.

Set Up Environment
Directory name Description
components Includes open source components developed by Tuya, such as battery and LED blink.
include Includes header files, such as the configuration file xx_app_config.h.
src Includes the c file for application callbacks.