English
English
简体中文
Contact Us
Register
Log In

Device Development

Last Updated on : 2022-11-03 03:47:36download

This topic describes how to enable a TuyaLink-based product to connect to the Tuya IoT Development Platform.

Concepts

Connection methods

Multiple connection methods are offered to help you connect to the Tuya IoT Development Platform with ease.

  • Open protocol
    A suite of MQTT-based open protocols, including Tuya MQTT standard protocol and Tuya IoT Core SDK. You can choose the one that best works for your development requirements.

    • Tuya MQTT standard protocol
      This protocol built on top of the standard MQTT provides the essential IoT capabilities including device status monitoring, properties and actions messaging. It gives you extensive flexibility to build SDKs that encapsulate IoT functionality and cloud services as needed. In particular, this protocol applies to resource-constrained devices.

    • Tuya IoT Core SDK
      Tuya IoT Core SDK is written in C on top of the Tuya MQTT standard protocol. It supports the Tuya-defined things data model, aiming to help developers to connect their proprietary hardware to the Tuya IoT Development Platform. It is independent of platforms and operating systems (OS), and it can run on a single-tasking operating system. If your devices support the TCP/IP protocol stack, you can develop with this SDK to connect your devices to the platform.

  • Cloud-to-cloud integration
    This method is used to connect a full-fledged ecosystem to the Tuya IoT Development Platform. The OpenAPI services and standardized frameworks help you implement system integration and interconnectivity and interoperability across various industries with cost efficiency.

Besides the above methods, the edge gateway can be used to connect devices without the capability of accessing the internet to the cloud.

Device certificate

The device certificate serves as the credential that permits your device to connect to the Tuya IoT Development Platform and access the cloud services.

The device certificate is issued by the Tuya IoT Development Platform and consists of ProductId, DeviceId, and DeviceSecret. You need to purchase the license for device registration to get the device certificate. Then, write the certificate information to your device to connect to the cloud.

Procedure

The development materials vary depending on connection methods. You can connect devices to the Tuya IoT Development Platform using Open Protocol, Cloud-to-Cloud Integration, or Edge Gateway.

This topic uses Open-Protocol as an example to describe the process.

Device Development

Step 1: Device development

Make sure you have completed the function definition before choosing the connection method. You need to determine the resources you want to develop with, either the Tuya MQTT Standard Protocol or the Tuya IoT Core SDK.

Currently, Tuya IoT Core SDK in C is available. For more information about the demo, see Tuya IoT Core SDK. More programming languages will be supported soon.

Device Development

Step 2: Activation & verification

Assign the license to your product. If you have not gotten a license, purchase it or request the free license.

Register your device with the license to get the device certificate and flash the certificate to your device. Then, verify the cloud connectivity. If the status is online, it indicates your device is successfully connected to the cloud.

Device Development

Step 3: Product release

After all the product functions are verified, your product should be production-ready and can be released.

Then, you can proceed with device management, online debugging, and application developed as needed.

Device Development

Step 4: Firmware management

You can upload firmware to the platform in order to manage firmware versions and deploy OTA updates.

Device Development

Next step

Manage your connected devices or build and integrate applications into a SaaS system. For more information, see Cloud Development.