Getting Started with Flux
DrainCheck enclosure with cover lifted
3D Model
Waiting for input
Last modified 22d ago
5837d1432b2afbf8e6a1b0376a2f66c32575a71330a9002f391ae8aa1bcb9896. No custom PCB/netlist exists; this software targets purchased modules listed in @prototype-materials-and-wiring.uno, ATmega328P, standard factory bootloader,16MHz Arduino board clock. No fuse/bootloader changes or custom flash offset. USB115200 baud. Board digital reference is5V. Use only two current DFRobot SEN0208 V2.0 in Mode0 as wired in the materials document. No UNO R4, ESP32, generic SR04T or3.3V substitution.pulseIn(HIGH,45000us); zero pulse result means timeout and distance NA. Pre-existing echo HIGH is stuck_high. Raw durations outside1725–28735us are out_of_range, including manufacturer's ~40ms no-echo behavior. Distance convention is0.174mm/us from the manufacturer's Mode0 timing, not a measured calibration. Working-range boundary rounding is conservative; validate actual probe behavior.millis() subtraction is uint32 wrap-safe for the configured intervals; session values wrap after about49.7days and reset at boot. No catch-up burst after delay. Echo reading can block at most configured45ms per attempted acquisition; actual hardware timing still needs scope checks. Serial transport can stall or lose data if host unavailable: this is not autonomous recording.cd draincheck-bench-v1. Install PlatformIO Core6.1.17 (or reproduce using that version) and Python helpers. Commands below ran successfully in the project firmware computer; upload cannot be executed without physical hardware:Bash
pio run -e uno pio test -e native clang++ -Iinclude -g -O1 -fsanitize=address,undefined -fno-omit-frame-pointer test/test_native/test_main.cpp -o /tmp/core-test /tmp/core-test python3 -m pip install pyserial pandas matplotlib python3 -m py_compile tools/*.py python3 tools/logger.py --help python3 tools/plot.py --help python3 tools/check_helpers.py
platformio.ini pins atmelavr5.1.0, boarduno and Arduino framework; resolved Arduino AVR framework5.2.0 and AVR GCC7.3.0. Build type is PlatformIO's standard optimized Arduino release. Flash4928/32256bytes (15.3% application capacity); static RAM293/2048bytes (14.3%), excluding runtime stack/heap. Bootloader occupies remaining512bytes of32KiB flash. These are build outputs, not stack-usage or runtime guarantees.draincheck-bench-v1.json into an empty working directory. Run this Python block there; generated files go under draincheck-bench-v1:Python
import json, base64, hashlib from pathlib import Path bundle=json.loads(Path('draincheck-bench-v1.json').read_text()) root=Path('draincheck-bench-v1') for name,item in bundle['files'].items(): relative=Path(name) assert not relative.is_absolute() and '..' not in relative.parts data=base64.b64decode(item['base64']) assert hashlib.sha256(data).hexdigest()==item['sha256'] dest=root/relative dest.parent.mkdir(parents=True,exist_ok=True) dest.write_bytes(data) print('restored',len(bundle['files']),'files')
binaries/; build outputs regenerate under .pio/build/uno/. Logs in logs/ include build.log, native.log, sanitizer.log, helpers.log and verification.md. logs/synthetic.csv/png are explicitly generated fake helper fixtures, not bench observations.pio device list). Replace example /dev/ttyACM0 with actual Linux/macOS device or Windows COM port.Bash
pio run -e uno -t upload --upload-port /dev/ttyACM0 pio device monitor -b 115200 --port /dev/ttyACM0 # Close monitor before logger or another upload. python3 tools/logger.py --port /dev/ttyACM0 --out trial-001.csv # Ctrl-C closes/flushed file. Output path must NOT already exist. python3 tools/plot.py trial-001.csv --out trial-001-raw.png
cycle,up_ms,down_ms,utc_valid,up_us,down_us,up_mm,down_mm,up_quality,down_quality,datum_valid,cal_version,up_elevation_mm,down_elevation_mm,delta_mm,difference_resolved,diagnosis,firmware.receipt_utc from laptop clock. Device utc_valid is always0; no UTC sync protocol exists. Receipt UTC is not sensor acquisition UTC. A raw_us0 is a timeout code; raw_mm is NA, not zero. Qualities: raw_ok (range gate only), timeout, out_of_range, stuck_high. Plausible in-range multipath can still be wrong. A changed CSV header/reset is not an unbroken session: split files manually. Cycles missing from capture remain gaps; logger does not reconstruct them.DATUM_VALID=false, Z_UP_MM=NAN, Z_DOWN_MM=NAN, COMBINED_UNCERTAINTY_MM=NAN, CAL_VERSION=UNSURVEYED-v0 in include/calibration.h. Thus derived values are NA by default. After actual survey/reference trials only: enter both independently surveyed acoustic-face elevations, measured conservative combined uncertainty bound and new version, enable validity and rebuild/upload. datum_valid output means all required calibration/arithmetic inputs and both samples valid; it is NOT proof of a valid hydraulic model. Equation: elevation=surveyed_face_height−distance; delta=U−D. Difference_resolved=1 only when |delta| exceeds the supplied combined bound; not a diagnosis threshold.tail -n 15 logs/*.log succeeded. Clean UNO rebuild, native15 assertions, ASan/UBSan, Python syntax/CLI and synthetic helpers independently reproduced successfully with identical4928 flash/293 static RAM and no compiler/linker warning lines. No source changes required; NAN calibration and literal unknown diagnosis retained. Reproduced evidence and binaries. See @first-assembly-and-commissioning for exact commands/results and the new conditional USB voltage-tolerance gate. Nominal5V rails and the manufacturer UNO tutorial suggest direct-interface compatibility but do not establish guaranteed VIH/VIL/VOH/VOL margins or USB supply upper-bound compatibility; the supply/interface sourcing gate remains open.PASS: 15 assertions; invalid, datum, uncertainty, arithmetic, wraparound. No ASan/UBSan diagnostics emitted; no file/line defect to quote.PASS: pseudo-terminal logger preserves missing sample + invalid UTC; synthetic plot generated. Logger/plot imports, syntax and --help succeeded. Pseudoterminal is not physical USB or sensor data.native→test_native for discovery; custom runner corrected from unavailable platformio_build_dir attribute to actual .pio/build/native/program. Final rebuilt tests passed. These were host harness problems, not proven hardware defects.Downloads — source of truth
Active-build safety status — 2026-11-10
Hardware and firmware contract
Obtain source / tested build commands
Durable JSON restoration (no expiring ZIP required)
Upload and capture — user hardware step, NOT yet performed
CSV semantics and honest unknowns
Independent continuation verification — 2026-11-10
Fault handling and test results