Cloud Logic

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

To connect a device to the Tuya IoT Cloud and mobile apps, your development must follow a set of end-to-end principles. This topic describes these required principles and provides examples for better understanding.

The following core concepts guide you through the understanding of the principles.

Term Description
Product ID (PID) The unique identifier of a product created on the Tuya IoT Development Platform, which is associated with the mobile app and cloud configuration.
Data point (DP) The data model of a product, which denotes product functions.
Firmware key The identifier of firmware associated with a PID.
License The license is also called production certificate, which serves as the authentication information for device connection to the Tuya IoT Development Platform.

Product ID (PID)

The unique identifier of a product created on the Tuya IoT Development Platform. The Tuya IoT Cloud identifies products by PID and then sends data to a specified mobile app for display. The PID is the vital information of a product, which is typically written to the firmware code.

Cloud Logic

Data point (DP)

The data model of a product, which denotes product functions and serves for the communication between a device and the cloud. Tuya provides two types of product functions.

  • Standard Functions: The most common functions of a product category, which can be selected as needed.

  • Custom Functions: If the standard functions cannot address your needs, you can add and edit a custom function to implement a required function.

    Cloud Logic

Firmware key

The identification information of firmware, which is generated after you Add Custom Firmware on the Tuya IoT Development Platform. The firmware key is associated with the PID and contains information including firmware identifier, firmware version, chipset platform, firmware type, update channel, and more. For more information, see Select and Manage the Firmware Version.

Cloud Logic Cloud Logic Cloud Logic

Description of fields

Information of firmware key Description
Firmware identifier The written firmware name when you use the script to compile code.
Firmware type It depends on the product type. Select Bluetooth Firmware if you use the Beacon protocol.
Chipset platform It is automatically generated based on your selected module.
Firmware version The firmware version is written when you use the script to compile code. This information is required when you upload firmware for production on the Tuya IoT Development Platform.

You must use the information of the firmware key specified on the Tuya IoT Development Platform for code compilation, including firmware identifier, firmware type, chipset platform, and firmware version. Otherwise, the flashing and authorization using Tuya’s host will fail.

License

The license serves as the authentication information for device connection to the Tuya IoT Platform, which must be written to the chip in production.

In the pairing process, when a device attempts to connect to the cloud over Bluetooth for registration, it sends the license to the cloud for authentication.

Tuya provides three options for license delivery based on flashing requirements.

Cloud Logic

Description of license types

License name Description
Production certificate
  • Encrypted license information.
  • This option generally works for the combined firmware flashing and authorization solution. Tuya flashes the encrypted license to the chip using its proprietary host. The information of the firmware key will be verified to avoid writing any incorrect firmware information. This option is recommended.
  • Apply to: Authorize Tuya standard chips.
Production certificate - authorization only
  • Encrypted license information.
  • This option generally works for the independent firmware flashing and authorization solution. Tuya flashes the encrypted license to the chip using its proprietary host. The information of the firmware key will not be verified.
  • Apply to: Authorize non-Tuya standard chips.
License list
  • License information in plaintext.
  • Apply to: You develop a host on your own to flash the license to your chip. This option is not recommended.