Document sender efficiency and reliability improvements

This commit is contained in:
2026-02-17 01:17:35 +01:00
parent e0f3ffc21c
commit d327f9b68a
2 changed files with 28 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ Function names below are C++ references. Rust naming/layout may differ, but the
- sender sample cadence 1 Hz.
- sender batch cadence 30 s.
- sync-request cadence 15 s while unsynced.
- sender retransmits reuse cached encoded payload bytes for same inflight batch.
- sender ACK receive window is adaptive from airtime + observed ACK RTT, with expanded second window on miss.
- Receiver behavior:
- decode/reconstruct sparse timestamps.
- ACK accepted batches promptly.
@@ -44,6 +46,9 @@ Function names below are C++ references. Rust naming/layout may differ, but the
- `WEB_AUTH_REQUIRE_AP=true`
- Web and display time rendering:
- local timezone from `TIMEZONE_TZ`.
- Sender diagnostics:
- structured sender diagnostics are emitted to serial debug output only.
- diagnostics do not change LoRa payload schema or remap payload fields.
- SD logging:
- CSV columns include both `ts_utc` and `ts_hms_local`.
- history parser supports both current (`ts_utc,ts_hms_local,p_w,...`) and legacy (`ts_utc,p_w,...`) layouts.
@@ -56,6 +61,7 @@ Function names below are C++ references. Rust naming/layout may differ, but the
- `AckDown` payload fixed length `7` bytes:
- `[flags:1][batch_id_be:2][epoch_utc_be:4]`
- `flags bit0 = time_valid`
- sender acceptance window is implementation-adaptive; payload format stays unchanged.
- `BatchInput`:
- fixed arrays length `30` (`energy_wh`, `p1_w`, `p2_w`, `p3_w`)
- `present_mask` must satisfy: only low 30 bits used and `bit_count == n`
@@ -107,11 +113,15 @@ Function names below are C++ references. Rust naming/layout may differ, but the
- parse OBIS values and set meter data fields.
- `bool meter_read(MeterData&)`
- compatibility wrapper around poll+parse.
- `void meter_get_stats(MeterDriverStats&)`
- expose parser/UART counters for sender-local diagnostics.
- Internal parse helpers to preserve numeric behavior:
- `parse_obis_ascii_value`
- `detect_obis_field`
- `parse_decimal_fixed`
- `parse_obis_ascii_payload_value`
- `parse_obis_ascii_unit_scale`
- `hex_nibble`
- `parse_obis_hex_u32`
- `parse_obis_hex_payload_u32`
- `meter_debug_log`
## `src/power_manager.cpp`
@@ -345,6 +355,7 @@ These functions define end-to-end firmware behavior and must have equivalents:
- Queue and sample batching:
- `batch_queue_drop_oldest`
- `sender_note_rx_reject`
- `sender_log_diagnostics`
- `batch_queue_peek`
- `batch_queue_enqueue`
- `reset_build_counters`
@@ -384,6 +395,7 @@ These functions define end-to-end firmware behavior and must have equivalents:
- LoRa TX pipeline:
- `send_batch_payload`
- `send_batch_ack`
- `invalidate_inflight_encode_cache`
- `prepare_inflight_from_queue`
- `send_inflight_batch`
- `send_meter_batch`
@@ -405,6 +417,7 @@ These functions define end-to-end firmware behavior and must have equivalents:
- Preserve wire compatibility first:
- LoRa frame byte layout, CRC16, ACK format, payload schema v3.
- sender optimization changes must not alter payload field meanings.
- Preserve persistent storage keys:
- Preferences keys (`ssid`, `pass`, `mqhost`, `mqport`, `mquser`, `mqpass`, `ntp1`, `ntp2`, `webuser`, `webpass`, `valid`).
- Preserve timing constants and acceptance thresholds: