Factory Flash & Provisioning
The manufacturing glue for createq BRIQX devices. One Python GUI turns a blank ESP32-S3 into a cloud-known unit: firmware, secrets, MQTT identity, and a QR label that actually matches the board.
The problem
Retail / industrial fleets die quietly when a box leaves the factory with the wrong story: MAC and serial disagree, MQTT password never made it into NVS, or the sticker QR points at a different device. That used to mean hopping between dashboard, esptool, NVS scripts, Mosquitto ACL, and a label printer — easy to get half-right.
I built one operator tool so those steps cannot drift apart. Plug USB → tool owns the rest.
The story the tool enforces
Every finished device is one bound identity:
Cloud validation runs before any write. NEW boards get a fresh serial; EXISTS / REPLACED paths are explicit (including field board swaps that re-bind an old serial to a new MAC). Batch mode pre-allocates serials atomically so two stations cannot claim the same number.
What I built
CustomTkinter app for non-technical operators: USB auto-detect (pyudev), MAC read via esptool, product preset (ultrasonic / audio-aio / cove-aio / multicast), console progress, dark/light themes. PyInstaller builds for Linux / macOS / Windows — no Python install on the line.
REST client talks to BRIQX for serial allocation and credential minting; local side runs ESP-IDF nvs_partition_gen and esptool (bootloader, partitions, OTA data, NVS, app). After flash, Mosquitto ACL is updated so the unit can join MQTT immediately.
Pillow QR + PDF label sheets tied to the same MAC/serial pair. Replacement workflow: failed board out → new board in → serial follows the product identity, old MAC revoked.
Who it serves
Factory line
Batch flash + label wizard — same tool across product lines
Lab / R&D
Quick single-device provision without hand-editing NVS
Support
Board swaps without orphaning the cloud serial