Repository navigation
feat(zephyr): one call starts provisioning with the port's hooks - #9
Merged
Merged
Conversation
tedge_provisioning_zephyr_init() starts the provisioning library with
the hooks that are the same in every Zephyr application:
- Wi-Fi: join the network, store it in Zephyr's Wi-Fi credentials
store only once the device has an address, and otherwise rejoin the
previously stored network, so a mistyped password cannot strand a
device;
- the scan;
- identify, blinking the devicetree's led0 or the first pixel of its
led-strip;
- CONFIG_SOC as the chip.
Each hook the application passes replaces the port's, for applications
that manage their network themselves. The minimal sample drops its own
Wi-Fi hook and uses the defaults.
On an ESP32-S3-DevKitC, the sample answers info, the scan, and a
network that does not exist ("could not connect").
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Zephyr port's README describes the provisioning library, the port's default hooks, and how an application replaces them. The spec gains the default hooks as a requirement. Co-Authored-By: Claude Opus 5.5 <[email protected]>
reubenmiller
added a commit
to thin-edge/microcontroller-devices
that referenced
this pull request
Nov 10, 2026
* feat: set devices up over USB with tedge-onboard 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]> * feat: set up over USB by default, BLE on the button pattern 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]> * refactor: use tiny-edge's provisioning defaults, one start-up helper 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]> * chore(deps): move tiny-edge to v0.3.0 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]> * chore(release): record sizes with the provisioning library 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]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #8. It moves the provisioning hooks that are the same in every Zephyr application into the port, so an application doesn't write them again.
The port's hooks
led0, or the first pixel of itsled-stripCONFIG_SOCEach hook the application passes replaces the port's. That's for applications that manage the network themselves, such as microcontroller-devices, whose
net.cowns reconnecting, or that have a better status light.The minimal sample drops its own Wi-Fi hook and uses the defaults. The Zephyr port's README gets a section on setting a device up over USB, and the
serial-onboardingspec gets the default hooks as a requirement.Testing
The sample with the onboarding overlay builds for the ESP32-S3 and ESP32-C6, without warnings.
On an ESP32-S3-DevKitC with the sample:
Not tested on hardware, because it needs real Wi-Fi credentials:
The microcontroller-devices follow-up uses its own Wi-Fi hook, so these paths are exercised when someone sets up a device running the sample.
Please merge before release PR #7, so v0.3.0 includes it.
🤖 Generated with Claude Code