Label each unit
Each unit needs its own identity: a serial, and a setup code that only the label carries. The factory tool makes both, writes the unit’s identity partition, and prints the link for its label.
-
Open the ESP-IDF environment. The tool uses ESP-IDF’s own SRP code and NVS generator, so it runs there even for Arduino products:
Terminal window . $IDF_PATH/export.sh -
Make and flash the unit’s identity.
Terminal window python tools/dc_factory.py --product airmon-2 --partitions partitions.csv --port /dev/ttyUSB0Serial 7K3M9Q2XSetup code 4TQ8N-HV2KBLabel QR https://deviceconfigs.com/p/airmon-2/7K3M9Q2X#4TQ8N-HV2KB -
Print the labels. Load
factory/units.csvinto the label printer and print on Avery sheets or a label roll. Each label has the link in a QR code, with the serial and setup code in plain text beside it, so a code can be typed if the QR is damaged. The label printer runs in your browser and can’t upload anything. -
Flash your application as usual. Flashing the app leaves the identity partition alone.
What’s in a label
Section titled “What’s in a label”| Part | Example | What it is |
|---|---|---|
| Product | airmon-2 |
Your product record: the name, picture and colour the app shows. |
| Serial | 7K3M9Q2X |
This unit. It advertises as <prefix>-7K3M9Q2X. |
| Setup code | 4TQ8N-HV2KB |
This unit’s secret: 50 bits, after # so a browser never sends it to a server. |
Serials and codes use Crockford base32, which has no I, L, O or U, so a code read aloud or typed from a scuffed label still works.
Options
Section titled “Options”--partitions <file>reads wheredc_factoryis from your partition table.--serialand--codefix them instead of drawing random ones (for development units).- Without
--port, the tool writes the partition image tofactory/<serial>.binfor your own production flashing.