Firmware management

Query device firmware based on device model

  • API intent: query.ota.firmware
  • Description: This interface is used to query all firmware version information of the specified device model.
  • Request parameters
Name Type Is required? Description
model String Yes Device model
  • Request Demo
{
  "intent": "query.ota.firmware",
  "data": {
    "model": "lumi.gateway.acn01"
  }
}
  • Response parameters
Name Type Description
fileSize Int Firmware file size, unit is bytes.
firmwareVersion String Firmware version
releaseTime String Release time (timestamp, unit is ms)
necessary Int 0:No , 1:Yes
updateLog String Firmware update log
state int Firmware status. 2-release version
  • Response demo
{
  "code": 0,
  "message": "Success",
  "msgDetails": "",
  "requestId": "",
  "result": [
    {
      "releaseTime": "1601266277000",
      "necessary": 0,
      "fileSize": 12636264,
      "updateLog": "1. Optimize system stability;",
      "state": 2,
      "firmwareVersion": "3.0.6_0015.0515"
    }
  ]
}

Upgrade firmware (Batch upgrade)

  • API intent: write.ota.upgrade
  • Description: This interface is used to upgrade the firmware of the device, supports batch upgrades.
  • Request parameters
Name Type Is required? Description
dids Array(String) Yes Device id list(the maximum is 100)
  • Request Demo
{
  "intent": "write.ota.upgrade",
  "data": {
    "dids": [
      "virtual2.11774113824794",
      "lumi.158d0001ab4030"
    ]
  }
}
  • Response parameters
Name Type Description
did String Device id that cannot be upgraded
code Int Error code
message String Message description of failed upgrade
deviceName String The name of the device that cannot be upgraded
  • Response demo
{
  "code": 0,
  "message": "Success",
  "msgDetails": "",
  "requestId": "",
  "result": [
    {
      "code": 602,
      "message": "Device is offline",
      "deviceName": "door sensor",
      "did": "lumi.158d0001ab4030"
    }
  ]
}

Query the upgrade status

  • API intent: query.ota.upgrade
  • Description: This interface is used to query the upgrade status of the device and is used with the "write.ota.upgrade" interface.
  • Request parameters
Name Type Is required? Description
dids Array Yes Device id list
  • Request Demo
{
  "intent": "query.ota.upgrade",
  "data": {
    "dids": [
      "virtual2.11774113824794"
    ]
  }
}
  • Response parameters
Name Type Description
did String Upgraded device id
status Int Firmware upgrade status. 0: successful; 1: in progress; 2: failed; 3: Unknown; 4: Waiting for the upgrade. Corresponds to the "result".
result String The current firmware upgrade status of the device: succ: upgrade successful; upgrade: upgrade in progress, fail: upgrade failed; unknow: unknown; waiting: waiting for upgrade
progress Int The current upgrade progress, the value range is 0~100
  • Response demo
{
  "code": 0,
  "message": "Success",
  "msgDetails": "",
  "requestId": "",
  "result": [
    {
      "result": "unknow",
      "did": "virtual2.11774113824794",
      "status": 3
    }
  ]
}
Copyright © 2023 Lumi United Technology Co., Ltd. all right reserved,powered by GitbookFile Modify: 2024-09-27 21:51:47

results matching ""

    No results matching ""