upgrade.lua
[INDEX]

ABSTRACT

Firmware upgrading

ARGUMENTS

HTTP Arguments submit: POST

Test this API over HTTP - (URL):

Put your firmware (binary file) to device over HTTP POST method by 'multipart/form-data' format.

The detail about HTTP POST "multipart/form-data", please refer to HTTP/1.1 (rfc 2616).

RETURNS

Return a JSON style result. The JSON format is:

{
/*OBJECT*/

"Result":
NUMBER

200 means OK, other error code meanings are similar to HTTP Response.

"Status":
"STRING"

Status message. Responsing result status of API executive, if there errors, it will describe reasons.

"Data": {
/*OBJECT*/

Upgrading details:

"ErrorTag":
"STRING"

Indicate the upgrading result:

upload.save-fail

Save the firmware file fail

extract.fail

Extract the firmware package fail

precheck.exec-fail

Could not do the upgrading pre-checking action

precheck.type-mismatch

Firmware type mismatched, incorrect firmware

precheck.insuf-mem

Insufficient memory

precheck.insuf-space

Insufficient storage space

precheck.version-mismatch

The upgrading based version is wrong

preupgrade.exec-fail

Could not do the pre-upgrading action

preupgrade.error

Pre-upgrading fail

done

Success

"Requirement":
"STRING"

This indicates the next actions you should do after upgrading done:

reboot

Need to reboot the device (So you can call reboot.lua to reboot it)

reset

Quickly reset the device (So you can call reset.lua to reset it)

none

No action required

}
}

NOTES

NOTE: Depends on the firmware file size and network speed, the upgrading will take about several seconds or 1-2 minutes. Not like otherAPIs, you must wait a long time to get the response, we suggest this timeout value must be >=30 seconds.

OTHER NOTES

KILOVIEW Device HTTP API, v1.0