Skip to content

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.

  1. 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
  2. Make and flash the unit’s identity.

    Terminal window
    python tools/dc_factory.py --product airmon-2 --partitions partitions.csv --port /dev/ttyUSB0
    Serial 7K3M9Q2X
    Setup code 4TQ8N-HV2KB
    Label QR https://deviceconfigs.com/p/airmon-2/7K3M9Q2X#4TQ8N-HV2KB
  3. Print the labels. Load factory/units.csv into 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.

  4. Flash your application as usual. Flashing the app leaves the identity partition alone.

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.

  • --partitions <file> reads where dc_factory is from your partition table.
  • --serial and --code fix them instead of drawing random ones (for development units).
  • Without --port, the tool writes the partition image to factory/<serial>.bin for your own production flashing.