Skip to content

Pausing deployments

To stop a bad ESP32 rollout, pause the deployment. From then on no device is offered it, and devices that have not installed it stay on the firmware they run. A device that is already downloading it finishes that download. To get devices that already installed the bad build back to the previous firmware, upload the previous binary again. SimpleOTA gives it a new, higher build number, and you deploy it to the same audience. Devices only move to a higher build number, so there is no button that rewinds them.

# 1. Stop offering the bad build.
curl --fail-with-body \
  -X POST "https://simpleota.com/api/v1/projects/$PROJECT_ID/deployments/$DEPLOYMENT_ID/transition/" \
  -H "Authorization: Bearer $SIMPLEOTA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "pause"}'

# 2. Republish the last good binary as a new build and start it on the same channel.
curl --fail-with-body \
  -X POST "https://simpleota.com/api/v1/projects/$PROJECT_ID/release/" \
  -H "Authorization: Bearer $SIMPLEOTA_TOKEN" \
  -F 'manifest={"framework": "arduino", "version_label": "1.3.2-republish", "chip_family": "esp32"}' \
  -F "binary=@firmware-1.3.2.bin" \
  -F "channel_name=stable"

The Pause button on the deployment page does the same as step 1, and the GitHub Actions promote action takes action: pause.

Limits worth knowing:

  • Keep a copy of every binary you release. Neither the dashboard nor the developer API returns a stored binary.
  • /release/ deploys to one release channel, at 100% unless you pass rollout_percentage. If the bad deployment targeted device groups, upload to /artifacts/ and create a deployment with the same targets instead, as in Promoting deployments.
  • Devices still on the good build are offered the republished one too, because its build number is higher. They install the same firmware again.
  • Devices in signed mode are offered only signed builds, so sign the republished binary like any other release.
  • If the bad build changed the data it stores on the device, the older firmware may not read it. Roll forward with a fix instead (section 2).

Devices often do not need you at all. With the 1.0.0 Arduino and ESP-IDF clients, a new build that crashes, hangs or never confirms boots the previous firmware by itself (with the exceptions under Limits), and the first rolled_back report pauses the deployment by default. The rest of this page covers both layers: the automatic on-device trial rollback, and the server-side levers you pull for the whole fleet.

0. On-device trial rollback

After simpleota_apply(), the client runs the new image as a trial and reverts to the previous partition if the trial isn't confirmed within the timeout, or if the device crashes or resets before then. Confirmation comes from simpleota_confirm(), or managed-mode auto-confirm on the first successful check-in. The rolled_back event is then reported to the server, which auto-pauses the deployment (default: on, threshold 1) so no further devices are offered the bad update. Rollbacks count toward that threshold from the last resume, so after you resume, the deployment pauses again once that many new rollbacks come in. While it stays paused, the line just below the state at the top of the deployment page shows that the rollback threshold was reached, and the device list further down shows which devices rolled back and the reason their firmware reported.

For the full lifecycle, the timer-arming caveats, and the managed-mode auto-confirm behaviour, see the dedicated Trial install and rollback guide.

This is your first line of defence: a bad build is caught on the first device that receives it. The manual Pause button in section 1 below covers the cases where auto-pause does not apply: deployments with the auto-pause toggle off, failure modes that do not surface as a rolled_back event, or devices using firmware without trial-install support.

1. Pause

Go to the deployment and click Pause. From that moment:

  • New /check/ requests behave as if the deployment didn't exist.
  • Devices already mid-download are not interrupted (the URL is short-lived but already issued).
  • Cohort decisions are preserved; resuming later picks up exactly where you left off, same buckets, same seed.
  • After you resume, devices in its cohort are offered this deployment again, including a device that rolled back on it as long as it has retries left. Any device can still get a different deployment whose build number is higher than the build it reports, and the auto-pause count starts over.

Pause is always safe and always reversible. Use it as the first reflex when something looks off.

2. Roll forward with a fix

Pausing stops the bleed; it does not heal devices that already flashed the bad build. Those devices are now reporting their new current_build_number and need a higher build number to update again.

The fix path:

  1. Build a corrected firmware. Bump nothing manually: the upload itself allocates a higher build number than anything previously uploaded in the project.
  2. Upload it.
  3. Create a deployment targeting the same audience as the broken one, at a high percentage (often 100 immediately, since the canary has already happened, badly).
  4. Pause or cancel the broken deployment.

3. Reverting via republish

If the latest build is broken and the previous one was fine, you can republish the previous binary as a new artifact (yes, with a new, higher build number; there's no rewinding). Upload it again, deploy it. The bytes on the device end up identical to the previous good release.

This is intentional: the engine offers a deployment when its build number is higher than the build the device reports, unless that device has rolled it back with no retries left. Republishing is how you tell the fleet "actually, go back to that".

4. What about devices that won't update?

If the bad build has bricked the OTA path itself (device can't reach /check/ anymore), you're past what FOTA can fix.

With the 1.0.0 Arduino and ESP-IDF clients, the trial in section 0 covers the most common bricking scenario, as long as trials are on, which they always are on Arduino and are on ESP-IDF unless both bootloader rollback and CONFIG_SIMPLEOTA_SOFTWARE_ROLLBACK are off. Without a trial, or if the bad build fails in a way the trial cannot catch (see Limits), a physical re-flash is the only remaining option.

1.0.0 clients also refuse any offer whose build number is not strictly above what the device reports, so you can't roll a deployment back to an older build number. Instead, republish the known-good binary so SimpleOTA assigns a new, higher build, and deploy that artifact (Build numbers).