Sensing & deployment · E55 · Engineering practice

Design a sensor data contract before training a sensor model

The hardware roadmap is a plan, not a completed multimodal experiment. Its concrete starting point is a timestamped observation packet.

ESP-IDF firmwarePacked C packetFuture host parser / dataset layer
Packet framing preserves the observation’s identity, timing and payload length before any learning system can use it.
Figure 1. Start with the observation contract. Packet framing preserves the observation’s identity, timing and payload length before any learning system can use it. Packet layout schematic. Original vector illustration.

Follow the information

From input to outcome

The implemented contribution here is an observation contract and transport path. The final model icon is explicitly prospective; no trained sensing capability is inferred from a functioning packet parser.

The implemented contribution here is an observation contract and transport path. The final model icon is explicitly prospective; no trained sensing capability is inferred from a functioning packet parser.
Figure 2. Information flow. Solid arrows carry observations, tensors or artifacts; other routes are explicitly labelled. Signal shapes, matrices and network icons are schematic, not measured samples or literal neuron counts. Open full-size SVG ↗ On narrow screens, scroll the diagram horizontally.

Read this alongside Figure 1: Packet framing preserves the observation’s identity, timing and payload length before any learning system can use it. The module map and layer-level figures below expand the operations in this route.

Design a sensor data contract before training a sensor model: system and evaluation mapWi-Fi observation: Radio channel response → Embedded packet: Time / RSSI / payload length → Host parser: Validate framing and schema → Aligned dataset: Calibration / gaps / reference → Future model: Not yet established here. A high-level module map; comparison branches and training details are explained in the article.SENSING & DEPLOYMENT / E55 / MODULE MAP01 INPUTWi-Fi observationRadio channel response02 MODULEEmbedded packetTime / RSSI / payload length03 MODULEHost parserValidate framing and schema04 MODULEAligned datasetCalibration / gaps / reference05 OUTPUTFuture modelNot yet established here
Source-grounded module map. Boxes summarize operations, not individual neurons; comparison arms and training paths are detailed below. On a small screen, scroll the diagram horizontally.
Wi-Fi observation — Radio channel response

The architecture in context

The system we are building

The selected project-status document describes a broader sensing direction involving radio measurements and possible additional modalities. The reusable engineering lesson is to establish an observation contract before claiming what can be inferred from the signal. The companion firmware supplies a concrete packet layout that can be audited independently of any ML model.

Who does what in the stack

ESP-IDF firmware
Receives channel-state observations.
Packed C packet
Defines the initial wire-format fields.
Future host parser / dataset layer
Must validate schema, timing and measurement provenance.

The packed header records a magic value, a timestamp, received signal strength and CSI payload length. Those fields make a parser possible, but do not by themselves define calibration, byte order, clock synchronization or the meaning of each payload element. The host and firmware must agree on all of them.

Framework responsibility map. Each row maps a library or custom component to its job; rows are not a sequential inference graph.
Framework responsibility map. Each row maps a library or custom component to its job; rows are not a sequential inference graph. Open full-size SVG ↗

Open up the implementation

A hardware plan needs a packet contract

A concrete operation-level view of this implementation; no unobserved neural architecture is implied.
A concrete operation-level view of this implementation; no unobserved neural architecture is implied. Open full-size SVG ↗

A sensor project becomes reproducible when its digital observations have a stable, checked format. The companion firmware gives a concrete interface: magic marker, timestamp, signal-strength field, length and variable payload. Those bytes establish what reaches a future algorithm, not what physical quantity can be inferred from it.

The mathematical contract

record=header,Vert,payload\mathrm{record}=\mathrm{header},Vert,\mathrm{payload}

Timestamp resolution, rollover and dropped records can dominate downstream temporal modeling. A rich neural model cannot reconstruct missing phase or calibration merely because the packet parser succeeds. Observation semantics must precede model design.

Implementation and resource card

Capacity / budget
Planning/status entry; no trained network or demonstrated molecular-sensing performance.
Execution evidence
This revision inspects and explains the archived implementation. It does not rerun the original workload. No unrecorded convergence time, throughput or accelerator result is supplied.
Current reproduction context
Current workstation, supplied by the author: Apple M4, 128 GB unified RAM, 40 GPU cores and 16 CPU cores. This is context for prospective reproduction, not attribution of every archived run. Python and framework versions are not fully locked for these historical sources; declarations, when available, are identified separately.

From explanation to a reproducible check

Decode a synthetic packet with known fields and reject malformed lengths before allocating or copying payload. Track firmware version and clock interpretation in the capture metadata; do not present a project roadmap as measured sensing capability.

Preserve input identities, configuration and failure records with the result. A successful numerical check only establishes the operation it exercises: it does not certify an entire dataset, model or deployed system. Reproduce the interface on a small deterministic input before optimizing throughput or increasing workload size.

A closer look at the implementation

The code that carries the idea

The excerpt is a C struct with a flexible payload array. Packed layout removes ordinary compiler padding, making serialization more predictable, but explicit protocol versioning and endian conventions are still needed for a durable dataset format.

C · file · lines 19–26
// Binary Packet Structure
typedef struct {
    uint16_t magic;
    uint32_t timestamp;
    int8_t rssi;
    uint16_t csi_len;
    uint8_t payload[];
} __attribute__((packed)) csi_packet_t;

Verbatim archive excerpt from main.c (companion source E56). Context-dependent historical code, not a standalone runnable program. Comments retain their original wording; the article distinguishes implemented behavior from stale or overbroad comments.

The boundary that matters

The roadmap does not establish molecular sensing, validated physiological inference or completed optical/radio fusion. A signal’s sensitivity to movement does not make a target quantity identifiable. This article deliberately labels the future model as a future stage.

Keep building

Other posts of interest