Skip to content
Back to skills

Esp32 Batch Provisioning

ASecurity

Use when more than a handful of ESP32s need Wi-Fi credentials - each unit is typed in by hand, provisioning fails on Android but works on iOS, the QR payload is rejected, or a batch needs the same settings. Covers SoftAP, BLE and QR provisioning plus batch flashing.

  • 16 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsgoapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add Esmail-sarhadi/esp32-agent-skills --skill esp32-batch-provisioning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Esp32 Batch Provisioning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Esp32 Batch Provisioning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/esmail-sarhadi-esp32-batch-provisioning/badge)](https://www.skillsdirectory.com/skills/esmail-sarhadi-esp32-batch-provisioning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: esp32-batch-provisioning
description: Use when more than a handful of ESP32s need Wi-Fi credentials - each unit is typed in by hand, provisioning fails on Android but works on iOS, the QR payload is rejected, or a batch needs the same settings. Covers SoftAP, BLE and QR provisioning plus batch flashing.
license: MIT
---

# Provisioning a batch

One device is a settings screen. A hundred devices is a process, and the process
has to work for someone who did not write the firmware.

## Three mechanisms, three trade-offs

| Method | Good for | Fails when |
|---|---|---|
| SoftAP + captive portal | phones, no app needed | Android drops a network with no internet - the portal never opens |
| BLE provisioning (`wifi_prov_mgr`) | reliable on both platforms | needs an app, and the phone must stay in range |
| QR code with the payload | fastest for a batch | the payload format is not what the app expects |

The IDF's `wifi_prov_mgr` supports both transports behind one API and handles the
proof-of-possession. Use it rather than writing the portal yourself; the edge
cases (Android's network validation, iOS captive sheet) are the whole difficulty.

## The QR payload

The common format is a small JSON or a `WIFI:` string. Whichever you choose:

- Keep it under 100 characters or the code gets dense and phones struggle.
- Include a per-device proof-of-possession or a shared secret, not just the SSID.
- Test with the actual scanner app on both platforms. A payload that only your
  own app can read is not a QR code, it is a private format.

## Batch flashing

`esptool.py write_flash` one unit at a time does not scale past twenty. Options
that work:

- **Multi-port**: `esptool` can run against several ports in parallel from a
  script; a 8-port hub with a scripted loop does 8 units per cycle.
- **Same image, unique identity**: flash one image, then write the serial into
  NVS with a second command (`nvs_partition_gen.py` produces a per-unit binary).
- **Provisioning at first boot**: leave credentials empty and let the installer
  provision. This is the only approach that scales to a technician in the field.

Never bake the site's Wi-Fi password into the image: one leaked binary is the
whole fleet's password.

## After provisioning

The device should report what it got, and the installer should see it:

- Confirm the connection on the device (LED, or a short beep).
- Publish a "provisioned" message to the backend with the serial.
- Keep the AP/portal reachable for a few minutes in case the credentials were
  wrong, then close it.

## Symptom table

| Symptom | Usually |
|---|---|
| portal never opens on Android | no internet on the AP, and the phone refuses the network |
| works on iOS only | captive portal detection differences; use BLE |
| provisioning succeeds, no connection | 5 GHz SSID, or WPA3-only |
| credentials lost after power cut | written to RAM or to a file without commit |
| a batch has the same serial | identity flashed into the image, not per unit |

Files in this skill

  • LICENSE.txt857 B
  • SKILL.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.