Skip to content

feat: set devices up over USB with tedge-onboard - #19

Merged
reubenmiller merged 5 commits into
mainfrom
feat/serial-onboarding
Nov 10, 2026
Merged

reubenmiller merged 5 commits into
mainfrom
feat/serial-onboarding

Conversation

@reubenmiller

@reubenmiller reubenmiller commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

The apps that run the thin-edge.io client can now be set up over USB with tedge-onboard, the guided tool released in tiny-edge v0.3.0. The tool reuses the computer's Wi-Fi, registers the device in Cumulocity through go-c8y-cli, and sends the Wi-Fi network, tenant, and one-time password to the device over Improv Serial.

Changes

  • tiny-edge v0.3.0: west.yml moves from v0.2.0 to v0.3.0, which adds the optional provisioning library and the Zephyr hooks.
  • APP_TEDGE_PROVISIONING (default on when the app has the tedge client and the Wi-Fi credential store, and no BLE provisioner): lib/common/prov_tedge.c starts tiny-edge's provisioning with the app's own hooks:
    • Wi-Fi goes through app_net_switch_network(), which tries the new network, keeps it only once it has an address, and otherwise returns to the previous one.
    • Identify flashes the status LED for 10 seconds.
    • The firmware name and version come from the app's identity.
  • Without Wi-Fi credentials, a device no longer hands off to the BLE provisioner image. It waits for USB setup, shows the provisioning LED pattern, and logs how to switch: 3 button presses within 2 seconds start the BLE provisioner, as before.
  • One start-up helper: app_prov_tedge_start_unprovisioned() replaces the per-app logic in modbus-server, opcua-server, snmp-agent, and tedge-agent.
  • README: "Setting a device up over USB with tedge-onboard".

Testing

  • ESP32-S3 with the modbus-server app: the tool found the device, identified it (LED), scanned networks, set Wi-Fi, and onboarded it to Cumulocity.

Size

release/size-baseline.json is updated for all 36 builds, from a CI run of every build (run 42801580748, made with a temporary branch that raised the growth tolerance and has since been deleted). All 36 builds pass their flash budgets.

Builds Flash Static RAM
tedge builds on the ESP32-S3 and C6 about +1.2 KB about +6.5 KB (worker stack and buffers)
tedge builds on the classic ESP32 about +6 KB about +6.4 KB
standalone builds no change no change

Two images move by a 64 KB alignment step: modbus-server tedge-full on the C6 (content +8.5 KB), and snmp-agent tedge-full on the QT Py S3, which dropped by the same step in #18.

🤖 Generated with Claude Code

reubenmiller and others added 5 commits November 10, 2026 16:11
Builds with the thin-edge.io client now include tiny-edge's
provisioning library (APP_TEDGE_PROVISIONING), so tedge-onboard, run on
a computer the device is plugged into, can give it a Wi-Fi network and
register it in Cumulocity:
- net.c gains app_net_switch_network(). It tries a network through the
  normal reconnect path, and stores it only once the device has an
  address. Otherwise it goes back to the stored network, so a mistyped
  password cannot strand a device.
- lib/common/prov_tedge.c provides the library's hooks: Wi-Fi through
  that switch, identify by flashing the status LED, the tiny-edge
  Zephyr port's scan, and the application's firmware name and version.
- A device with no Wi-Fi network starts the client first and waits for
  the tool, instead of rebooting into the Wi-Fi provisioner (the button
  pattern still starts it). It then waits for a network for as long as
  it takes, and the reconnect loop no longer retries without
  credentials.

tiny-edge is pinned to its serial-onboarding branch for now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A tedge-* device with no Wi-Fi network waits for tedge-onboard, and
shows the provisioning pattern on its status LED until it is set up.
Pressing the button 3 times within 2 seconds still starts the Wi-Fi
provisioner (Improv over BLE, or lab-ztp-provisioner). The README
describes both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lib/common/prov_tedge.c starts provisioning with
tedge_provisioning_zephyr_init(). It passes only what these
applications do their own way: Wi-Fi through net.c, which owns
connecting; identify on the status LED; and the firmware name. The
scan and the chip come from the tiny-edge Zephyr port.

The start-up block that each of the four apps repeated, "no Wi-Fi yet:
start the client first, wait for the network", is now one call,
app_prov_tedge_start_unprovisioned(). In builds without the client it
is a macro that names no client symbol.

tiny-edge is pinned to the branch of thin-edge/tiny-edge#9 for now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release with the provisioning library, its Zephyr defaults
(tedge_provisioning_zephyr_init()), tedge-onboard, and the
code-scanning fixes. It replaces the pin to the pull request branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every build that runs the thin-edge.io client now carries tiny-edge's
provisioning library. On the ESP32-S3 and C6, that adds about 1.2 KB
of flash and 6.5 KB of static RAM, for the worker's stack and buffers.
On the classic ESP32, it adds about 6 KB of flash and 6.4 KB of RAM.
The standalone builds don't change.

Two images move by a 64 KB alignment step:
- modbus-server tedge-full on the C6 (content +8.5 KB).
- snmp-agent tedge-full on the QT Py S3, which dropped by the same step
  in #18.

Both are within their flash budgets.

The sizes come from a CI run of every build (release workflow, run
42801580748), using the same size.py report that --write-baseline
records.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reubenmiller
reubenmiller merged commit 6253088 into main Nov 10, 2026
21 checks passed
@reubenmiller
reubenmiller deleted the feat/serial-onboarding branch November 10, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant