Development Environment

Last Updated on : 2022-11-24 09:20:04

The required development environment varies depending on your selection of Beacon chips. The following table lists the chips that are specially adapted to Tuya-defined protocols as well as the environment setup guide. If you do not use Tuya standard chips to connect to the Tuya IoT Development Platform, you need to set up the development environment based on your chipset platform.

Development environments

Chipset platform Development environment Reference specification
AK801AE-H1 CDK Set up development environment for AK801
AK801AE-M3 CDK Set up development environment for AK801
AC6329C2 Code::Blocks Set up development environment for AC6329C2

Set up development environment

Step 1: Create a product

In this section, we use AC6329C2 as an example to describe how to create a product on the Tuya IoT Development Platform to get the SDK and the required information for development. For more information about product creation, see Create Products.

  1. Log in to the Tuya IoT Development Platform.

  2. On the left product category menu, choose the desired product. Choose TuyaOS and then the Custom Solution tab. Choose Tuya Beacon as the protocol and complete the required information to create a product.

    Development Environment
  3. On the page that appears, click the Hardware Development tab, select TuyaOS as the connection mode, and select a chip. Click Get 2 Free Licenses to request the free licenses used to authenticate with the Tuya IoT Development Platform for cloud connection.

    Development Environment Development Environment
  4. The request result will be sent to your phone associated with your account of Tuya IoT Development Platform via SMS.

  5. After you are notified of a successful request, open the platform and click Purchase > Debugging & Sample Order to download the license. A license comprises UUID, AuthKey, and MAC address, which will be used later in the code editing process.

    Development Environment

Step 2: Get the SDK

For more information, see Get the SDK.

Step 3: Set up development environment

Download the IDE. For more information, see Set up development environment for AC6329C2.

After you have the IDE installed on your computer, import your project.

Step 4: Edit the project

  1. Import the downloaded SDK.

  2. Find the app_main.c and app_multi_conn.c.

  3. Open the app_main.c file and replace the mac, authkey, and pid with your own values.

    Development Environment
  4. Open the app_multi_conn.c file. Replace u8 ty_ble_addr[6] with the MAC address in the license you obtained and shield syscfg_read(NV_USER_MAC_ADDR, ty_ble_addr, 6). For more information, see Port SDK.

    Development Environment
  5. After you complete the code editing, you can connect the hardware to your computer for compilation and flashing.

    Development Environment Development Environment