tiny_measurement.h Overview¶
tiny_measurement.h is the unified include for:
tiny_measurement_config.honline_sensing.hoffline_sensing.hsensing_command.htiny_measurement_app.hreal-time-process-arch.hftsp.h— WSN time synchronization (FTSP over ESP-NOW)
It is intended as the single middleware-facing include for measurement features.
WSN Module¶
The WSN time-sync module is included via ftsp.h, which aggregates:
| Header | Purpose |
|---|---|
ftsp_config.h | Compile-time tuning (beacon interval, table size, min pairs) |
ftsp_types.h | Beacon packet layout (16 B basic / 26 B extended with NTP world time) |
ftsp_gateway.h | Gateway: periodic beacon broadcast via ESP-NOW |
ftsp_leafnode.h | Leaf: beacon sniffer + linear regression clock correction |
ftsp_ntp.h | NTP sync recording and world-time anchor (µs precision) |
ftsp_precision.h | Clock drift estimation and compensation (ppm) |
ftsp_sync_viz.h | RGB LED sync status visualization (marquee color cycling) |
Quick Start¶
Gateway node (requires NTP via Enterprise WiFi):
node_espnow_config_t espnow_cfg;
node_espnow_default_config(&espnow_cfg);
espnow_cfg.create_sta_netif = true; // DHCP for NTP
node_espnow_init(&espnow_cfg, NULL);
// NTP sync (blocking, ~30s timeout)
sync_time_with_timezone(NTP_TIMEZONE);
// Start FTSP beacon broadcast
ftsp_gateway_start();
// Sync visualization (WHITE → GREEN → MARQUEE)
ftsp_sync_viz_init();
Leaf node (no WiFi needed):