English
English
简体中文
Contact Us
Register
Log In
layoutIndex

TuyaOS Development

Last Updated on : 2022-03-18 03:19:20download

Built on top of the RTOS, Linux, and Non-OS, TuyaOS is a distributed and platform-agnostic IoT operating system.

Overview

With a standard kernel at the core, TuyaOS is designed to tackle the heterogeneity of platforms, systems, and protocols in order to enable quick and reliable integration, interconnection, and interoperability.

The tiered and plug-and-play architecture design allows you to quickly tailor a solution based on your hardware resources hence reducing the cost of development with high cost performance. The efficient remote procedure call (RPC) mechanism and proprietary data point (DP) protocols make communication across protocols possible and easy.

Development method

On top of the hardware product development, TuyaOS based solutions can be broken down into the following types:

Development method Applicable to Description
No-code Products whose features can be standardized, such as electrical and lighting products, and sensors. Tuya provides an easy-to-use graphic interface that lets you develop fully functional firmware for your smart products without writing a line of code.
MCU SDK Products using MCUs. The MCU SDK encapsulates code for two-way communication between devices and cloud, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and implement the required functionality with API calls.
Wi-Fi SDK Space-constrained products that can be implemented through custom development on the Wi-Fi module. The Wi-Fi SDK encapsulates interface functions that are implemented in the hardware abstraction layer (HAL), system layer, network layer, and OTA updates. You can directly call these APIs to write application code without taking care of the logic behind it.
Bluetooth SDK Space-constrained products that can be implemented through custom development on the Bluetooth module. The Bluetooth SDK encapsulates interface functions that implement Bluetooth protocol stack, callbacks, and applications. You can directly call these APIs to write application code without taking care of the logic behind it.
Bluetooth mesh SDK Space-constrained products that can be implemented through custom development on the Bluetooth mesh module. The Bluetooth mesh SDK encapsulates interface functions that implement Bluetooth mesh protocol stack, callbacks, and applications. You can directly call these APIs to write application code without taking care of the logic behind it.
Bluetooth Beacon SDK Space-constrained products that can be implemented through custom development on the Bluetooth beacon module. The Bluetooth beacon SDK encapsulates interface functions that implement Bluetooth beacon protocol stack, callbacks, and applications. You can directly call these APIs to write application code without taking care of the logic behind it.
Zigbee SDK Space-constrained products that can be implemented through custom development on the Zigbee module. The Zigbee SDK encapsulates interface functions that implement Zigbee protocol stack, callbacks, and applications. You can directly call these APIs to write application code without taking care of the logic behind it.
Gateway SDK Gateway devices that can connect sub-devices to the cloud, supporting protocols including Sub-G, Modbus, CAN bus, RS-485, Bluetooth Low Energy, and Zigbee. Tuya provides MCU SDK, gateway networking SDK, and gateway extension SDK to address your different needs for developing smart gateways.
IPC SDK IP camera products. The chip-platform-based IPC-specific SDK contains the code for features including media streaming, P2P, device control, and OTA updates. You can integrate the SDK into your current devices and call these APIs to write application code without taking care of the logic behind it.
Linux SDK Devices that run Linux. Tuya offers an SDK with a dynamic-link library (.so) or static library (.a) based on your chipset platform and compiler toolchain. You can integrate the SDK into your current devices and implement applications with API calls. This way, your devices can be paired with a mobile app and connected to the cloud.
Android SDK Devices that run Android. Tuya offers an SDK with a dynamic-link library (.so) or static library (.a) based on your chipset platform and compiler toolchain. You can integrate the SDK into your current devices and implement applications with API calls. This way, your devices can be paired with a mobile app and connected to the cloud.
Link SDK Any devices that support the TCP/IP protocol stack. Link SDK provides core capabilities such as device connection, two-way communication between devices and cloud, and OTA updates, which are independent of platforms and operating systems. You can connect devices to the cloud by setting up interfaces.

Development process

TuyaOS Development

Step 1: Create product

This section describes the required steps to create a smart product. For more information, see Create Products.

  1. Log in to the Tuya IoT Development Platform.

  2. Select a solution and protocol. In the following example, we select Wi-Fi and Bluetooth as the protocol.

    • Solution: Select No-Code Development for the no-code development method and Custom Solution for other development methods.
    • Protocol: It determines the communication protocol and network module options.
    TuyaOS Development
  3. See Product Functions and select functions for your product.

    A data point (DP) is an abstract representation of a product function. Tuya provides all products with standard DPs. You can select DPs based on your requirement.

    TuyaOS Development
  4. See Design App UI and configure a control panel.

    The interface on the mobile app used for users to interact with a smart device is called a panel. Tuya provides up to 100 free all-in-one panels that also support personalized editing. Tuya also provides customization services to help you build a custom panel as per your requests.

  5. Download development documents.

    The Tuya IoT Development Platform recommends modules to you based on your product and protocol. You can place an order for the modules online. You can also change the selected modules online as needed. For more information about the module specification, see Network Modules.

    TuyaOS Development

Step 2: Write code

After a product is created, you can purchase a sample module and development board, download the SDK, and start embedded programming and debugging.

TuyaOS Development

The SDK includes several demos for your reference. The documentation of each development method and IoT projects in the Project Hub will help in your development.

TuyaOS Development

Step 3: Flash firmware and license

Flash the device with the firmware and Tuya’s license to connect the device to the cloud.

Tuya provides two options for flashing to meet different requirements of development methods.

  • Flashing by Tuya

    For the no-code and MCU SDK development methods, you will get modules that are flashed with firmware and license by Tuya. This way, you can use the module directly.

  • Flashing on your side

    For other development methods, you need to flash the firmware and license and verify the code by yourself. The flashing methods vary depending on the chip platform. For more information, see the documentation in Flash And Authorize.

Step 4: Test functions

You can check the device logs on the Tuya IoT Development Platform for troubleshooting. For more information, see Log query.

Step 5: OTA updates

The Tuya IoT Development Platform provides multiple update methods. You can upload the required firmware updates and complete the deployment settings. Then, an OTA update will be deployed to your users. For more information, see Update Firmware.

This section contains the following topics to help you quickly understand related concepts and how-to guides: