Skip to content

Firmware updates

Look up and start OTA updates.

Every call needs the project’s API key in x-header-apikey. See Authentication. Errors use the codes in Error codes.

Upload a firmware image for one of your models

Section titled “Upload a firmware image for one of your models”
POST https://openapi.rogo.com.vn/api/v2.0/iot-core/ota/firmware/{modelId}

Stored where machines download it. A version is written once: uploading an image to a version that already has one is refused, so publish a fix under a new version. The response gives the size and SHA-256 of what was stored and the URL machines will download from.

Parameter In Type Required Description
modelId path string Yes
Terminal window
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/ota/firmware/<modelId>" \
-H "x-header-apikey: $API_KEY"
Status Meaning
201 The image is stored.
400 The image is missing, or a field is invalid.
404 No such model under your partner.
409 That version already has an image.

Tell one machine to install a firmware image

Section titled “Tell one machine to install a firmware image”
POST https://openapi.rogo.com.vn/api/v2.0/iot-core/ota/device/{userId}/{mac}

Addressed by the machine’s user and MAC, like the JSON control route. The machine must be of the image’s model. It downloads the image itself and reports progress and the outcome in its state, attribute 45057 (INFO_SOFTWARE): status, progress or error code, and the version it runs. A 201 means the command was published, not that the update happened.

Parameter In Type Required Description
userId path string Yes
mac path string Yes

Body

Field Type Required Description
revision number Yes The hardware revision the image is built for: the store folder rev&lt;revision>.
type release \ development No
version string Yes Three or four dot-separated numbers, each 0 to 255. A four-part version is also sent to the machine as the version it must check the image against.
modelId string Yes The model the image is for. It must be the machine’s model.
skipVersionCheck boolean No Install without the machine checking the image’s version against the running one. The only way to install an older version; leave it out otherwise.
Terminal window
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/ota/device/<userId>/<mac>" \
-H "x-header-apikey: $API_KEY" \
-H "content-type: application/json" \
-d '{"revision":1,"type":"release","version":"2.0.4","modelId":"string","skipVersionCheck":false}'
Status Meaning
201 The command was published.
400 A field is invalid.
404 No such machine for this caller, or no image for that version.
409 The machine is of another model.