Skip to content

OTA firmware updates ​

Ship a new firmware or software binary to devices that implement the Autoconnecto OTA contract (shared attributes + HTTPS chunk download).

Who this is for ​

  • Operators: upload and push packages from OTA in the app.
  • Firmware authors: implement the download loop — ESP32 helpers live in the Autoconnecto Arduino SDK (OtaUpdate.h, see sdk/OTA.md).

Basic (default) ​

Most fleets only need this path. Open OTA and leave the control on Basic.

  1. Upload package — title, version, optional compatible device profile, and a file (up to about 100 MB through the app edge).
  2. Push to one device — try the package on a single board. Watch Device status until it shows UPDATED (or Failed).
  3. If that device looks good, Push to all — every device on a profile or device type. For a profile you can also turn on Also use for new devices on this profile. Push to all stays disabled until at least one device for that package shows UPDATED.

A title made only of spaces is refused. A device that is not online shows 0 and Not online until it is online. In-flight rows refresh every few seconds. While a board downloads firmware over HTTPS it may stay silent on MQTT for several minutes — that is normal; wait for UPDATED or Failed before treating it as stuck.

KindShared attributesDevice progressTypical device action
Firmwarefw_*fw_stateFlash ESP32 OTA partition and reboot
Softwaresw_*sw_stateSave file on LittleFS; apply in sketch (no reboot)

Advanced ​

Switch OTA to Advanced when you need staged fleets. Waves, percent, soak, halt, and rollback stay available here — they are not required for a normal plant push.

  • Assign — push immediately to a device, profile, or device type (same engine as Basic push).
  • Rollout — percent of a profile or type, optional waves with soak, halt on failure rate, Pause / Continue / Halt / Cancel / Rollback on the rollout page.
  • The Rollouts tab lists staged jobs. Basic mode hides that tab.

When you assign or push to a profile and leave the profile default on, new devices created on that profile automatically queue the same package. A rollout does not change that profile default.

Rollout details ​

Open OTA → Advanced, choose a package, and click Rollout.

  • Single device queues that device only.
  • Percent of a profile or device type is an integer from 1 to 100. The platform shuffles the devices, stores that list on the rollout, and uses the same list if you open the rollout again. 1% of a small fleet is at least one device. On a wave rollout you can name devices that must stay in the last wave. The rest of the fleet is still shuffled.
  • Waves are optional cumulative stages, for example 5% then 25% then 100%. Every wave, including the last wave and a one-device rollout, has a soak (default 30 minutes). The rollout stays RUNNING until that soak ends and the post-update watch has elapsed.
  • Auto-continue starts the next wave when the current wave is healthy, the soak has elapsed, and each updated device has passed the post-update watch. Turn it off and the next wave waits for Continue.
  • Halt if more than 10% of the current wave has failed, or at least 3 devices have failed, whichever comes first. Both numbers are configurable. A device that is still unfinished after 30 minutes counts as failed. A device that stays INITIATED fails with “download never started”. A device that reports updated and then sends no telemetry for 10 minutes counts as post-update silent, which is also a failure.
  • Halt on the button asks you to confirm. An automatic halt raises a clearable MAJOR alarm and uses the tenant’s existing mail channels. Devices already UPDATED are left as they are unless you roll back.
  • Cancel rollout stops pending and in-progress devices. Devices already UPDATED stay updated. Cancel removes the shared fw_* or sw_* target from those devices.
  • Roll back failed or Roll back updated assigns each device the package it was on before this rollout.
  • A device that is already in a running or paused rollout is not updated by a second rollout or by Assign/Push.
  • A 100% profile or type rollout asks you to type the package version before it starts.
  • Optional target hardware / model on the package (Advanced upload). Devices that report a different hardware or model are left out, and the preview says how many.

API ​

Preview, then create. confirmVersion is required only when the rollout reaches 100% of a profile or device type, and it must equal the package version.

POST /api/ota/rollouts/preview and POST /api/ota/rollouts take the same body:

json
{
  "packageId": "2f0a0c3e-1b2c-4d5e-8f90-aabbccddeeff",
  "targetType": "PROFILE",
  "targetId": "profile-1710000000",
  "waves": [
    { "percent": 5, "soakMin": 30 },
    { "percent": 25, "soakMin": 30 },
    { "percent": 100, "soakMin": 30 }
  ],
  "failureThresholdPct": 10,
  "failureMinDevices": 3,
  "deviceTimeoutMin": 30,
  "silentMin": 10,
  "autoContinue": true,
  "autoRollback": false,
  "confirmVersion": "1.4.0"
}
text
GET  /api/ota/rollouts
GET  /api/ota/rollouts/{id}
POST /api/ota/rollouts/{id}/pause
POST /api/ota/rollouts/{id}/resume
POST /api/ota/rollouts/{id}/continue
POST /api/ota/rollouts/{id}/halt
POST /api/ota/rollouts/{id}/cancel
POST /api/ota/rollouts/{id}/rollback
DELETE /api/ota/rollouts/{id}

Assign / push still use POST /api/ota/packages/{id}/assign.

Device contract ​

Devices must implement the Autoconnecto OTA contract. See sdk/OTA.md and the ESP32 examples under sdk/examples/Ota*.

support@autoconnecto.in · founder@autoconnecto.in · +91 92121 00555 · app.autoconnecto.in