Backend
mat’s backend is a native, from-scratch Rust Matter controller (crate
mat-controller, driven through the shared mat-native engine) — TLV, CASE,
IM, groupcast, mDNS, and commissioning (on-network + BLE+Thread) are all
in-process. There is no chip-tool (or any external controller) subprocess.
- Route selection is per-op: matd auto-discovery (if a
matdanswers the probed socket) →mat’s own native direct path. See Routing throughmatdand Native backend internals for interface autodetect (MAT_IFACE/MAT_MATD_IFACEoverride), fabric index, warm vs one-shot sessions, the shared groupcast counter, epoch adoption, and the generic write/invoke value-encoding rule (scalars as literals, lists/structs as JSON from the generated type table). - First-fabric bootstrap is
mat fabric init(random-epoch IPK); see that section.
Environment variables:
| variable | purpose |
|---|---|
MAT_STORE | credential store path (see the resolution order in Configuration) |
MAT_IFACE | override interface autodetect for mat’s direct path |
MAT_MATD_IFACE | override interface autodetect for matd |
MAT_THREAD_IFACE | override Thread TUN interface autodetect for mat’s groupcast egress; unset = auto-select if exactly one multicast-capable wpan* iface is up, else LAN-only — see Groupcast egress |
MAT_MATD_THREAD_IFACE | same, for matd |
MAT_GROUP_EGRESS | all (default) / thread: with thread, skip the LAN copy of a groupcast while a Thread TUN egress is up (the border router would relay it into Thread a second time) — see Groupcast egress |
MAT_MATD_GROUP_EGRESS | same, for matd |
MAT_FABRIC_INDEX / MAT_ISSUER_INDEX | mat KVS fabric-table / CA-issuer index (default 1 / 0) |
MAT_MATD_FABRIC_INDEX / MAT_MATD_ISSUER_INDEX | same for matd |
MAT_MATD / MAT_MATD_SOCKET | force / opt out of the matd path; pin its socket |
MAT_OP_TIMEOUT_MS | budget (ms) for a single-node op; default 60000, 0 = unlimited — see Op timeout budget |
MAT_PAA_TRUST_STORE | directory of PAA root certs for attestation |
MAT_CD_SIGNER_STORE | CD signer trust store (warn-only if absent) |
MAT_SETUP_CODE | commission setup code (QR MT:... or manual code) when --setup-code is absent; prefer it on shared hosts — the flag is visible in the process list (see Passing the setup code and Thread dataset safely) |
MAT_THREAD_DATASET | Thread active operational dataset (hex) for BLE+Thread commission; like MAT_SETUP_CODE, prefer it over --thread-dataset on shared hosts |
MAT_TRANSPORT | commission route: auto (default) / on-network / ble |
MAT_PING6_BIN | override the ping6 binary used by diag node --deep |
MAT_LOG | tracing filter for stderr logs (e.g. info); empty counts as unset — see Logs |
Matter uses mDNS / IPv6 multicast, so running in Docker requires host networking (
docker run --network host). A bridge network cannot receive the responses.