All Products
Search
Document Center

Marketplace:CreateOTAFirmware

Last Updated:Mar 25, 2025

Important

DISCLAIMER

Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited. 

Create an OTA upgrade package for the device.

Request Parameters

Name

Type

Required

Sample Values

Description

Action

String

Yes

CreateOTAFirmware

System defined parameters. Value: CreateOTAFirmware.

DestVersion

String

Yes

2.0.0

The version of the OTA upgrade package. Only letters, digits, periods (.), dashes (-), and underscores (_) are supported. The length is limited to 1 to 64 characters.

FirmwareName

String

Yes

Firmware2

The name of the OTA upgrade package, which cannot be modified after creation. Chinese, English, Japanese, numbers, dashes (-), underscores (_), and half-angle parentheses () are supported. They must start with Chinese, English, Japanese, or a number. The length is limited to 1 to 40 characters.

FirmwareUrl

String

No

Https://oss-612ba0f1-2e08-4adb-9606-78390169****.oss-cn-hangzhou.aliyuncs.com/ota/firmware/bd65da39-cf24-4d9c-b306-6ac14ff5****.bin

The URL of the OTA upgrade package file, that is, the storage address of the upgrade package file on the object storage (OSS). You can call GenerateOTAUploadURL to generate the URL of the upgrade package file.

FirmwareSign

String

No

93230 * * * *

The signature value of the OTA upgrade package file. Use SignMethod value ( SHA256 or MD5 ) The value calculated by signing the contents of the upgrade package file.

SignMethod

String

No

Md5

OTA upgrade package signature method. Value: ●Md5 (Default):MD5 signature. ●Sha256 : SHA256 signature.

FirmwareSize

Integer

No

900

The size of the OTA upgrade package file. Unit: bytes.

ProductKey

String

No

A1uctKe * * * *

Of the product to which the OTA upgrade package belongs ProductKey .

FirmwareDesc

String

No

Ota function updated

OTA upgrade package description. The length cannot exceed 100 characters. A Chinese character counts as one character.

Type

Integer

No

0

OTA upgrade package type. ●0 : The whole package upgrade package. The upgrade package file you uploaded contains the complete upgrade package. The whole package upgrade package will be pushed to the device for upgrade. Differential package upgrade will be supported in the future

SrcVersion

String

No

1.0.0

The version number of the to-be-upgraded OTA module is the version number of the current OTA module of the to-be-upgraded device.

ModuleName

String

No

WifiConfigModify

The OTA module name. OTA modules are different upgradeable modules for devices under the same product.

NeedToVerify

Boolean

No

True

Whether you need to pass the upgrade package verification before creating a batch upgrade task. ●True (Default): Required ●False : No need

Udi

String

No

{"Ota_notice":"Upgrade the underlying camera driver to solve the problem of blurred video images. "}

Custom information pushed to the device. The text content format is unlimited, and the length cannot exceed 4096 characters. After the upgrade package is added and an upgrade task is created, IoT Platform sends the custom information to the device when it pushes an upgrade notification to the device.

Note: When calling an API, in addition to the API-specific request parameters described in this topic, you must also pass in the common request parameters. For more information about common request parameters, see Common parameters.

Return Data

Name

Type

Sample Values

Description

Code

String

Iot.system.SystemException

The error code returned when the call fails. For more information, see Error codes.

Data

Struct

The upgrade package information returned when the call is successful. For more information, see Data parameter description.

FirmwareID

String

Next * * * *

Ota upgrade package ID, the unique identifier issued by IoT platform for the upgrade package.

UtcCreate

String

2024-11-11 T11:21:54.607Z

The creation time of the OTA upgrade package, in UTC format.

ErrorMessage

String

System Exception

Error information returned when the call fails.

RequestID

String

Kan

The unique identifier that IoT Platform generates for the request.

Success

Boolean

True

Whether the call was successful. ●True : The call is successful, indicating that the OTA upgrade package is successfully created. ●False : The call fails, indicating that the OTA upgrade package failed to be created.

Example

Request Example

curl 'https://si-d6e8d812acb848958054.tuyacloud.com:8686/?Action=CreateOTAFirmware&SignatureNonce=9e6189124f5a4716ad2de849467b****&AccessKeyId=xMr9wgwXQLhv5AUa65o0****&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T09%3A47%3A43Z&ProductKey=a1uctKe****&FirmwareName=Firmware2&DestVersion=1.9.9&FirmwareUrl=https%3A%2F%2Foss-612ba0f1-2e08-4adb-9606-78390169%2A%2A%2A%2A.oss-cn-hangzhou.aliyuncs.com%2Fota%2Ffirmware%2Fbd65da39-cf24-4d9c-b306-6ac14ff5%2A%2A%2A%2A.bin&SignMethod=MD5&FirmwareSign=93230c3bde425a9d7984a594ac55****&FirmwareSize=900&FirmwareDesc=createfirmware&Type=0&ModuleName=ble&Signature=WJN0Ee8%2BX6pogcD3loLHIqQNEN0%3D'

Normal Return Example

{
    "code": "",
    "data": {
        "firmwareId": "143",
        "utcCreate": "2024-11-20T08:50:00.239Z"
    },
    "requestId": "d2fce065-8238-4ee2-a793-0226f69b0542",
    "success": true
}