What is TuyaOS?

Last Updated on : 2024-01-08 10:29:25download

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.

Architecture

What is TuyaOS?

Development framework

This section provides an overview of a suite of turnkey tailored SDKs catering to different IoT cloud connectivity solutions.

SDKs Solutions Applicable to Description











Network SDK


Wi-Fi devices
Tuya standard module
Tuya offers the standard module and the adapted SDK for developing embedded applications. The 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 interfaces to write application code without taking care of the logic behind it.
Third-party chips Tuya offers a library that is suited for your development environment and compiler. You can integrate this library into your project and implement API adaptation. After that, you can work on application development.

4G LTE Cat.1 devices
Tuya standard module Tuya offers the standard module and the adapted SDK and underlying firmware. The 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 interfaces to write application code without taking care of the logic behind it.
Third-party chips Tuya offers the Link SDK. You can port this SDK to your platform and implement applications with API calls to connect your device to the cloud.
Screen devices Third-party chips Tuya offers a dynamic-link library (.so) or static library (.a) based on your development environment and compiler toolchain. You can integrate this library 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.


Voice assistant devices
Tuya standard module Tuya offers the standard module and the adapted SDK for developing embedded applications. The 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 interfaces to write application code without taking care of the logic behind it.
Third-party chips Tuya offers a library that is suited for your development environment and compiler. You can integrate this library into your project and implement API adaptation. After that, you can work on application development.







Sub-device SDK


Bluetooth devices
Tuya standard module The Bluetooth SDK encapsulates interface functions that implement Bluetooth protocol stack, callbacks, and applications. You can directly call these interfaces to write application code without taking care of the logic behind it.
Third-party chips Tuya offers a library that is suited for your development environment and compiler. You can integrate this library into your project and implement API adaptation. After that, you can work on application development.


Bluetooth mesh devices
Tuya standard module The Bluetooth mesh SDK encapsulates interface functions that implement Bluetooth mesh protocol stack, callbacks, and applications. You can directly call these interfaces to write application code without taking care of the logic behind it.
Third-party chips Tuya provides the standard Bluetooth mesh protocol to help you connect your devices to the cloud.
Zigbee devices Tuya standard module The Zigbee SDK encapsulates interface functions that implement Zigbee protocol stack, callbacks, and applications. You can directly call these interfaces to write application code without taking care of the logic behind it.




Gateway SDK
Basic gateways
Manage non Powered by Tuya (PBT) devices Tuya offers a Linux-based network SDK that can be integrated into your software to implement the typical gateway features. The SDK encapsulates the generic interfaces of standard gateway features. You need to implement specific services, giving you the freedom to implement the downstream protocol on your terms. The gateway built on top of this SDK can only connect to your proprietary devices.
Extension gateways Manage Powered by Tuya (PBT) devices Tuya offers the standard Zigbee module and Linux-based extension SDK that can be integrated into your device to implement the gateway features. This solution supports the Zigbee module that is flashed with Tuya's gateway firmware. The module acting as a coordinator supports connection to both PBT devices and your proprietary devices that communicate over Zigbee or other protocols.
Hybrid gateways Multifunctional gateways This solution can enable cloud connection and basic gateway features as well as integration with a bunch of functionalities such as infrared, control hub, Zigbee connectivity, Bluetooth Low Energy connectivity, router, repeater, and Pegasus pairing.
Central hub SDK Control hubs Manage Powered by Tuya (PBT) devices Tuya offers the control hub SDK that can be integrated into your device to implement smart hub features. This SDK can enable smart home management including reading data from devices and scenes, device setup, status reporting, sub-device control over LAN, Wi-Fi connectivity, and online/offline detection. It applies to a host of smart devices such as lights, switches, sockets, air conditioners, and curtain motors.
IP camera (IPC) SDK IP cameras Third-party chips The chip-platform-based IPC-specific library contains the code for features including media streaming, P2P, device control, and OTA updates. You can integrate the library into your current devices and call these interfaces to write application code without taking care of the logic behind it.
NVR SDK NVR devices Third-party chips The chip-platform-based NVR-specific library contains the code for features including IPC connection, storage, management, and control. You can integrate the library into your current devices and call these interfaces to write application code without taking care of the logic behind it.









MCU SDK
Wi-Fi devices Tuya standard module Tuya offers the standard Wi-Fi module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
Wi-Fi HomeKit devices Tuya standard module Tuya offers the standard Wi-Fi HomeKit module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
Bluetooth devices Tuya standard module Tuya offers the standard Bluetooth module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
Bluetooth mesh devices Tuya standard module Tuya offers the standard Bluetooth mesh module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
Zigbee devices Tuya standard module Tuya offers the standard Zigbee module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
NB-IoT devices Tuya standard module Tuya offers the standard NB-IoT module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
LTE Cat.1 devices Tuya standard module Tuya offers the standard LTE Cat.1 module and SDK. The SDK encapsulates code for device-to-cloud communication, OTA updates, and data parsing. You can port the SDK to your MCU for interface adaptation and call interfaces to implement the required functionality.
Debugging Assistant Tuya standard module The versatile debugging assistant features module simulation and MCU simulation, helping you debug the service logic and cloud connectivity.

Development processes

What is TuyaOS?

Step 1: Get the SDK

This section briefly describes how to get the SDK. For more information, see Tuya Wind IDE Guide.

  1. Log in to Tuya Wind IDE with your account of the Tuya IoT Development Platform. On the home page, click Create New Framework.

    What is TuyaOS?

    What is TuyaOS?

  2. Choose a development framework as needed.

    What is TuyaOS?
  3. (Optional) To change the default download location, uncheck Use Default Location and select where you want your files to be saved.

    Make sure you have granted the write permission to the specified directory. Otherwise, the download will fail.

    What is TuyaOS?
  4. Click Finish and wait for development framework creation to finish. This might take a while.

    What is TuyaOS?
  5. After the framework is created, you will find all the files in the left pane.

    What is TuyaOS?
  6. Expand TuyaOS > apps directory. Right-click on one of the demo file and click Build Project.

    What is TuyaOS?

  7. Enter the version number in the format x.x.x and press Enter.

    What is TuyaOS?

  8. Wait for the compilation to finish. After that, you can flash the demo firmware to your device and verify the application code.

    What is TuyaOS?

Step 2: Create a 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.

    What is TuyaOS?

  3. See Standard Functions and Custom 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.

    What is TuyaOS?
  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.

Step 3: Application development

After a product is created, you can purchase a sample module and development board to verify your application code.

What is TuyaOS?

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.

What is TuyaOS?

Step 4: Flash firmware and authorize chip

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 the Flash And Authorize catalog.

Step 5: Test functions

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

(Optional) Step 6: 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.