URL: http://ota.heclouds.com/ota/south/check
When the device is in “to be upgraded”, “downloading” or “upgrading” state, this API can be used to return task information.
I only want to see examples!!!
Name | Format | Required or not | Description |
---|---|---|---|
Content-Type | string | Yes | Must be application/json. |
Authorization | string | Yes | Security authentication information |
Name | Format | Required or not | Description |
---|---|---|---|
dev_id | long | Yes | Device id |
manuf | string | Yes | Manufacturer name, please refer to the schedule |
model | string | Yes | Module model, please refer to the schedule. |
type | int | Yes | Task type, “1” represents FOTA task, “2” represents SOTA task. |
version | string | Yes | Version information |
cdn | boolean | Yes | If the device supports domain name resolution, please select “true”; if the device does not support domain name resolution, please select “false”. |
Name | Format | Description |
---|---|---|
errno | int | Call error code, please refer to the description of error code. |
error | string | Error description, where “succ” means success. |
data | json | Device-related information returned after interface is successfully called. See the Data Description Table. |
Name | Format | Description |
---|---|---|
target | string | Target version of upgrade task |
token | string | File address: ip:port/ota/download/{token} |
size | int | File size |
signal | int | The task is performed under the signal greater than this. |
power | int | The task is performed with the power larger than the value. |
retry | int | Times of retry |
interval | int | Retry interval |
md5 | string | Md5 code of upgrade file |
ipPort | string | Ip address pulling the upgrade package |
type | int | 1: complete package; 2: differential package |
Chip platform | Chip model | Manufacturer Number | 芯片编号 |
---|---|---|---|
FANLUN | ESP32 | 101 | 10101 |
nordic | nrf52832 | 102 | 10201 |
GigaDevice | GD32 | 103 | 10301 |
Miscellaneous | Miscellaneous | 100 | 10001 |
Manufacturer name | Module model | Manufacturer Number | Module number |
---|---|---|---|
China Mobile | M5330-A | 001 | 00101 |
China Mobile | M5330 | 001 | 00102 |
China Mobile | M5312 | 001 | 00103 |
China Mobile | M5313 | 001 | 00104 |
China Mobile | S5601 | 001 | 00105 |
China Mobile | M5310-A | 001 | 00106 |
China Mobile | M5310 | 001 | 00107 |
China Mobile | M5311 | 001 | 00108 |
China Mobile | M5330-GNSS | 001 | 00109 |
China Mobile | M5330-STD | 001 | 00110 |
RINLINK | N256 | 002 | 00201 |
Lierda | NB86-G | 003 | 00301 |
Lierda | NB08-01 | 003 | 00302 |
u-blox | SARA-N200 | 004 | 00401 |
Ruijie Networks | RG-NB6118 | 005 | 00501 |
Ruijie Networks | RG-NB6210 | 005 | 00502 |
Shanghai Wenheng | WH-NB71 | 006 | 00601 |
Shanghai Wenheng | WH-NB73 | 006 | 00602 |
Simware | SN12_B8 | 007 | 00701 |
ZTE | ZM8300 | 008 | 00801 |
ZTE | ZM8301 | 008 | 00802 |
NEOWAY | N20 | 009 | 00901 |
PCTX | T1 | 010 | 01001 |
PCTX | T101 | 010 | 01002 |
PCTX | T106 | 010 | 01003 |
SUNRAY | NH01A | 011 | 01101 |
SUNSEA AIOT | SIM7000C | 012 | 01201 |
SUNSEA AIOT | SIM7000C-N | 012 | 01202 |
SUNSEA AIOT | SIM7020C | 012 | 01203 |
SUNSEA AIOT | SIM7030 | 012 | 01204 |
MobileTek | L620 | 013 | 01301 |
Quectel Wireless Solutions Co., Ltd. | BC28 | 014 | 01401 |
Quectel Wireless Solutions Co., Ltd. | BC68 | 014 | 01402 |
Quectel Wireless Solutions Co., Ltd. | BC35-G | 014 | 01403 |
Quectel Wireless Solutions Co., Ltd. | BC95-G | 014 | 01404 |
Quectel Wireless Solutions Co., Ltd. | BC26 | 014 | 01405 |
Quectel Wireless Solutions Co., Ltd. | BC95-B8 | 014 | 01406 |
ccfrom | CFB-608-B8 | 015 | 01501 |
ccfrom | CFB-609 | 015 | 01502 |
CHEERZING | ML5530 | 016 | 01601 |
Fibocom Wireless Inc. | N700-CN | 017 | 01701 |
EASTCOMPEACE | NBM20 | 018 | 01801 |
Wutong Group | WT208 | 019 | 01901 |
GOSUNCN | ME3616 | 020 | 02001 |
H3C | IM2209 | 021 | 02101 |
CT-UNITE | CT-M201 | 022 | 02201 |
CT-UNITE | CT-M202 | 022 | 02202 |
AI-Link | AI-NB15 | 023 | 02301 |
UNIONMAN | UNB100-G | 024 | 02401 |
Sunniwell | S-ModNB00A | 025 | 02501 |
RF-LINK | N100 | 026 | 02601 |
DWnet | TPB23 | 027 | 02701 |
DWnet | TPB40-8 | 027 | 02702 |
DWnet | TPB41 | 027 | 02703 |
LITEON | WNB301H | 028 | 02801 |
FN-LINK | 3115F-R | 029 | 02901 |
Longsung | A9600-R2 | 030 | 03001 |
Linkwise | LT150 | 031 | 03101 |
Miscellaneous | Miscellaneous | 000 | 00001 |
Error Codes | Description |
---|---|
0 | There is an upgrade task for the device. Token value is file mapping path (The period of validity is set. Please refer to the design documents for details). The period of validity of token is 2 days. |
1 | Authentication failed (in case the device doesn’t present). |
2 | Request parameter error. |
7 | OneNET internal error. |
8 | Detection failed! There is an upgrade task for the device, but the task is in failed status due to the inconsistency of manuf or model. |
9 | Detection failed! There is an upgrade task for the device, but the task is in failed status due to the inconsistency of versions (only applicable for the upgrade of differential package). |
11 | No upgrade task is detected! There is no upgrade task corresponding to the type (fota/sota) of the device. |
27 | Version number format error (version number only includes [a-zA-Z0-9_\\-.]), the length is [1, 20]). |
32 | There is an upgrade task, but no corresponding differential package is found (no reported version number for the device; initial version is used when creating a task on the page: The condition may occur in case of “no version number”). |
When checking the task, if it is the task that can detect device status (to be upgraded, upgrading), return token and other response parameters.
When there is no upgrade task in the device, it will determine if there is automatically added strategy. If the conditions of automatically added strategy are met, a new task will be added for the device and it will return task information.
The request parameter version is current version number of the device. No matter whether the upgrade task is detected, the version value will be updated to corresponding version number of the device on OneNET platform (fota/sota).
{
"dev_id": 6523, //must be filled, device ID
"manuf": "China Mobile",//must be filled, the code corresponding to manufacturer name
"model": "M5310", //must be filled, code corresponding to module name
"type": 1, //1: fota task, 2: sota task
"version":"1.2" , //must be filled, device current version number
"signals": 10, //optional, signal strength
"powers":30, //optional, percentage of remaining power value
"cdn": true //whether to return to pull the upgrade package ip.
}
{
"errno": 0,
"error": "succ",
"data": {
"target":"1.2", // target version of upgrade task.
"token":"ota_5hc95SFeo5xJEnaNrste",//file address ip:ip:port/ota/download/{token}
"size":123, //file size
"signal":12,//the task is performed under the signal larger than this on
"power":90, //the task is performed under the power higher than the value
"retry":10, //times of retry
"interval":90, //retry interval
"md5":"dfkdajkfd", //md5 of upgrade file.
"ipPort":"172.19.3.3",//ip address
"type":1 // 1: complete package, 2: differential package.
}
}