Sourced from
docs/self-hosted-ota.mdin the firmware repo.
Self-hosted OTA - running your own update channel
A fork that ships firmware to its own devices needs its own update channel: its own signing keypair, its own public releases repository, a few constants changed in the firmware source, and the repository names in the release workflow. Without these, your devices poll the upstream project's releases, which are signed with a key your fork does not hold, and your CI has nowhere to publish.
Read how OTA works first; this page is only the delta a fork must apply.
The chain is the upstream one with your names substituted at every hop - the numbers in the diagram are the rows of the table below:
What a fork must change
| # | Thing | Where | Why |
|---|---|---|---|
| 1 | Signing keypair | include/ota_pubkey.h (public key, compiled into firmware) + the private key as a CI secret | Devices install only what verifies against the keys baked into the running firmware. Your devices must trust your key. |
| 2 | Manifest URL | OTA_MANIFEST_URL in src/agent/agent_config.h | Where devices poll for updates. Point it at your own releases repository. |
| 3 | Sound-pack source | SFX_SYNC_HOST and SFX_SYNC_BASE in src/agent/agent_config.h | Where devices sync the optional voice-pack WAV files from. Point them at your own asset repository, or leave the upstream values (the assets are public). |
| 4 | A public releases repository | e.g. you/your-fork-releases | Devices download unauthenticated - release assets must be on a public repository (a private repository's assets 404 without auth). Keep it assets-only. |
| 5 | Workflow secrets | OTA_SIGNING_KEY + RELEASE_PAT on your source repository | CI signs with your private key and publishes to your releases repository. |
| 6 | Releases repository name in CI | .github/workflows/release.yml | The workflow names the releases repository directly: the publish target, the manifest --url-base, and the web-flash branch URLs. Replace each occurrence with your own. |
Step by step
1. Generate a keypair
openssl ecparam -name prime256v1 -genkey -noout -out ota_priv.pem
openssl ec -in ota_priv.pem -pubout -out ota_pub.pem
Replace the upstream key #1 entry in kOtaPubKeys[] in include/ota_pubkey.h
with your public key PEM, and leave the #ifdef NIMBUS_TEST entry as it is. The
firmware trusts a list, which is what makes later rotation possible. Back up the
private key offline: if it is lost, no future release can be signed and every
fielded device is left with USB-only updates.
2. Create the releases repository
Create a public, assets-only repository (the upstream pattern:
nimbus-fw-releases). Devices fetch
releases/latest/download/manifest.json from it and follow the redirect to
the binaries. The release workflow also force-pushes a webflash branch to
this repository with the browser-flasher images.
3. Point the firmware at it
In src/agent/agent_config.h, set:
#define OTA_MANIFEST_URL "https://github.com/<you>/<your-releases-repo>/releases/latest/download/manifest.json"
and, if you host your own sound pack, SFX_SYNC_HOST and SFX_SYNC_BASE
likewise.
4. Configure CI
The release workflow (.github/workflows/release.yml) needs two secrets on
your source repository:
OTA_SIGNING_KEY- the private key PEM from step 1.RELEASE_PAT- a fine-grained personal access token withContents: read/writeon your releases repository only. The defaultGITHUB_TOKENis scoped to the source repository and cannot write to a second one. The board-support checkout (solide-drivers) is public and needs no token.
gh secret set OTA_SIGNING_KEY -R <you>/<fork> < ota_priv.pem
gh secret set RELEASE_PAT -R <you>/<fork>
In the same workflow, replace the upstream releases repository name wherever it
appears: the publish step's repository:, the manifest --url-base, and the
web-flash branch URLs. The Virtual Nimbus image job in that workflow skips
itself with a notice on firmware tags when the GCP_WIF_PROVIDER and
GCP_DEPLOY_SA secrets are not set (a vn-v* tag without them fails instead), so
a fork that does not run Virtual Nimbus can leave it alone and never push vn-
tags.
5. Cut a release
# bump include/version.h NIMBUS_FW_VERSION to vX.Y.Z, commit, then:
git tag vX.Y.Z && git push origin main vX.Y.Z
CI gates tag == version, builds the four board variants (esp32s3,
esp32s3-cyd, esp32s3-cyd-35, esp32s3-cyd-40), signs the manifest, and
publishes. Devices already running your firmware see it on their next daily
check.
A release candidate is tagged vX.Y.Z-rcN. It passes the same tag gate, is
published as a prerelease (so devices polling releases/latest do not see it),
and does not update the web flasher. To rotate the signing key, add the new
public key to kOtaPubKeys[], ship one release signed with the old key so
fielded devices learn the new one, then replace OTA_SIGNING_KEY with the new
private key and remove the old entry a release later. Renew RELEASE_PAT before
it expires.
What you inherit for free
The device side needs no changes: A/B slots, SHA-256 + ECDSA verification before the boot-flag flip, the three-boot rollback guard, the daily check, the web/Telegram/console install surfaces, and the version-forward auto-install policy all key off the constants and the key list above.
Signed-message discipline
tools/make_manifest.py and the device's nimbus::ota::buildSigMessage()
must produce byte-identical canonical messages
(nimbus-ota-v2\n<version>\n<type>\n<sha256-hex>\n). The format is pinned
by tools/test_make_manifest.py; change both sides together.
How it works → OTA firmware updates