|
| 1 | +# ESP32-C6 Matter Light Pipeline |
| 2 | + |
| 3 | +Build, provision, label, and flash a Thread-only Matter light on ESP32-C6 with one CLI. |
| 4 | + |
| 5 | +Main script: [`tools/light_pipeline.py`](./tools/light_pipeline.py) |
| 6 | + |
| 7 | +Docs index: [`docs/README.md`](./docs/README.md) |
| 8 | + |
| 9 | +## What This Repo Does |
| 10 | + |
| 11 | +This repo adds reproducible automation around upstream [`esp-matter`](./esp-matter) for one target flow: |
| 12 | + |
| 13 | +- firmware source: `esp-matter/examples/light` |
| 14 | +- chip target: `esp32c6` |
| 15 | +- network mode: Thread enabled, Wi-Fi disabled |
| 16 | +- flash layout: 8 MB via [`tools/light_partitions_8mb.csv`](./tools/light_partitions_8mb.csv) |
| 17 | +- provisioning model: one manifest row per device with unique pairing data |
| 18 | + |
| 19 | +Result: |
| 20 | + |
| 21 | +1. build firmware |
| 22 | +2. generate factory partition |
| 23 | +3. generate onboarding codes |
| 24 | +4. generate printable labels |
| 25 | +5. flash device |
| 26 | + |
| 27 | +## Tested Hardware |
| 28 | + |
| 29 | +Tested on: |
| 30 | + |
| 31 | +- Waveshare [ESP32-C6-Zero](https://www.waveshare.com/esp32-c6-zero.htm) |
| 32 | +- Waveshare product page lists it as based on `ESP32-C6FH8` |
| 33 | +- 8 MB flash layout used by this repo |
| 34 | + |
| 35 | +## Quick Start |
| 36 | + |
| 37 | +### 1. Install host tools |
| 38 | + |
| 39 | +Install these first: |
| 40 | + |
| 41 | +- Python 3: <https://www.python.org/downloads/> |
| 42 | +- Git: <https://git-scm.com/downloads> |
| 43 | +- ESP-IDF / EIM: <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/> and <https://docs.espressif.com/projects/idf-im-cli/en/latest/> |
| 44 | + |
| 45 | +### 2. Clone and init submodules |
| 46 | + |
| 47 | +```bash |
| 48 | +git clone <your-repo-url> |
| 49 | +cd esp32-c6-matter |
| 50 | +git submodule update --init --recursive |
| 51 | +``` |
| 52 | + |
| 53 | +### 3. Install upstream ESP-Matter dependencies |
| 54 | + |
| 55 | +```bash |
| 56 | +cd esp-matter |
| 57 | +./install.sh |
| 58 | +cd .. |
| 59 | +``` |
| 60 | + |
| 61 | +### 4. Generate `eim_config.toml` |
| 62 | + |
| 63 | +Recommended: install ESP-IDF with Espressif Installation Manager (`eim`), then save or export its config as `eim_config.toml` in repo root. |
| 64 | + |
| 65 | +If you do not want full exported config, minimal file also works: |
| 66 | + |
| 67 | +```toml |
| 68 | +idf_path = "/Users/<you>/.espressif/v5.5.2/esp-idf" |
| 69 | +``` |
| 70 | + |
| 71 | +Repo tools read `eim_config.toml` before `IDF_PATH`. |
| 72 | + |
| 73 | +Check detection with: |
| 74 | + |
| 75 | +```bash |
| 76 | +python3 tools/detect_env_paths.py |
| 77 | +``` |
| 78 | + |
| 79 | +### 5. Verify environment |
| 80 | + |
| 81 | +```bash |
| 82 | +python3 tools/light_pipeline.py doctor |
| 83 | +``` |
| 84 | + |
| 85 | +### 6. Build and provision one device |
| 86 | + |
| 87 | +```bash |
| 88 | +python3 tools/light_pipeline.py run \ |
| 89 | + --count 1 \ |
| 90 | + --vendor-id 0xFFF1 \ |
| 91 | + --product-id 0x8000 \ |
| 92 | + --vendor-name "My Vendor" \ |
| 93 | + --product-name "My Thread Light" |
| 94 | +``` |
| 95 | + |
| 96 | +### 7. Flash it |
| 97 | + |
| 98 | +```bash |
| 99 | +python3 tools/light_pipeline.py flash \ |
| 100 | + --port /dev/ttyUSB0 \ |
| 101 | + --serial-index 1 |
| 102 | +``` |
| 103 | + |
| 104 | +Use `--dry-run` first if you want command preview without changing anything. |
| 105 | + |
| 106 | +## Common Commands |
| 107 | + |
| 108 | +Check environment: |
| 109 | + |
| 110 | +```bash |
| 111 | +python3 tools/light_pipeline.py doctor |
| 112 | +``` |
| 113 | + |
| 114 | +Build 8 devices: |
| 115 | + |
| 116 | +```bash |
| 117 | +python3 tools/light_pipeline.py run \ |
| 118 | + --count 8 \ |
| 119 | + --vendor-id 0xFFF1 \ |
| 120 | + --product-id 0x8000 \ |
| 121 | + --vendor-name "My Vendor" \ |
| 122 | + --product-name "My Thread Light" |
| 123 | +``` |
| 124 | + |
| 125 | +Build and flash in one go: |
| 126 | + |
| 127 | +```bash |
| 128 | +python3 tools/light_pipeline.py run \ |
| 129 | + --count 1 \ |
| 130 | + --vendor-id 0xFFF1 \ |
| 131 | + --product-id 0x8000 \ |
| 132 | + --vendor-name "My Vendor" \ |
| 133 | + --product-name "My Thread Light" \ |
| 134 | + --port /dev/ttyUSB0 \ |
| 135 | + --serial-index 1 |
| 136 | +``` |
| 137 | + |
| 138 | +List generated devices and detected serial ports: |
| 139 | + |
| 140 | +```bash |
| 141 | +python3 tools/light_pipeline.py list |
| 142 | +``` |
| 143 | + |
| 144 | +## Read Next |
| 145 | + |
| 146 | +- setup and first run: [`docs/getting-started.md`](./docs/getting-started.md) |
| 147 | +- pipeline behavior: [`docs/pipeline.md`](./docs/pipeline.md) |
| 148 | +- vendor ID, product ID, DAC, PAI, PAA, CD: [`docs/identity-and-attestation.md`](./docs/identity-and-attestation.md) |
| 149 | +- commissioning after flash: [`docs/commissioning.md`](./docs/commissioning.md) |
| 150 | +- manifest schema: [`docs/manifest.md`](./docs/manifest.md) |
| 151 | +- CLI options: [`docs/cli.md`](./docs/cli.md) |
| 152 | +- generated outputs: [`docs/outputs.md`](./docs/outputs.md) |
| 153 | +- helper scripts: [`docs/internal-scripts.md`](./docs/internal-scripts.md) |
| 154 | +- version assumptions: [`docs/version-compatibility.md`](./docs/version-compatibility.md) |
| 155 | +- security and generated secrets: [`docs/security-and-generated-secrets.md`](./docs/security-and-generated-secrets.md) |
| 156 | +- maintenance and clean rebuilds: [`docs/maintenance.md`](./docs/maintenance.md) |
| 157 | +- upstream submodule and patches: [`docs/upstream-and-patches.md`](./docs/upstream-and-patches.md) |
| 158 | +- examples: [`docs/examples.md`](./docs/examples.md) |
| 159 | +- troubleshooting: [`docs/troubleshooting.md`](./docs/troubleshooting.md) |
| 160 | + |
| 161 | +## Notes |
| 162 | + |
| 163 | +- `tools/device_manifest.csv` is reused if it already exists |
| 164 | +- `--count` does not overwrite existing manifest automatically |
| 165 | +- `--port` on `run` triggers flashing automatically |
| 166 | +- `--flash` is deprecated compatibility flag |
| 167 | +- repo is configured around 8 MB flash target |
0 commit comments