{
  "$schema": "https://eheuristics.com/api/node.json",
  "name": "PHOA Water Meter Node",
  "codename": "WaterMeterNode_CT62",
  "role": "receiver",
  "firmware_version": "2.11.40",
  "manufacturer": "Competition Software",
  "copyright": "© 2026 Competition Software. Firmware is proprietary.",
  "summary": "ESP32-based wireless receiver for Badger ORION water meters. Autodetects SX1276 or SX1262 FSK radio, decodes ORION protocols 223, 282, and 290. Deployable two ways: standalone on local WiFi for small clusters, or as a mesh client feeding a Gateway over 433 MHz CC1101.",
  "deployment_modes": [
    { "mode": "standalone", "uses_gateway": false, "good_for": "small clusters (single building, park, or property)", "data_path": "meters → Node → local WiFi dashboard + email" },
    { "mode": "mesh",       "uses_gateway": true,  "good_for": "distributed or large installations",                "data_path": "meters → Node → 433 MHz mesh → Gateway → HTTP ingest → database" }
  ],
  "power": {
    "recommended": "24 V AC → 5 V DC inline converter, output adjustable to compensate for long-cable IR-drop",
    "rationale": "Powers the Node directly from the 24 V AC supply of an existing irrigation controller — no extra wall-wart, no new outlet, reuses wiring that already reaches the valve manifold",
    "node_draw": { "idle_ma": 120, "peak_tx_ma": 250 },
    "converter_target_output": "5.0–6.0 V DC at ~500 mA continuous"
  },
  "hardware": {
    "mcu": "ESP32 dual-core (Heltec CT62 / WiFi LoRa 32 footprint)",
    "fsk_radio": "SX1276 or SX1262 (autodetected at boot)",
    "mesh_radio": "CC1101 @ 433.92 MHz, 2-FSK, multi-hop with ACKs",
    "network": "WiFi 802.11 b/g/n STA + fallback AP at 192.168.4.1",
    "power": {
      "supply": "USB micro 5V or direct 3.3V",
      "current_idle_ma": 120,
      "current_peak_tx_ma": 250
    }
  },
  "protocols": [
    { "id": "P223", "meter_family": "Badger ORION 1006B", "freq_mhz": 916.45,           "rate_kbps": 100, "modulation": "2-FSK NRZ" },
    { "id": "P282", "meter_family": "Badger ORION 2014W-OSE", "freq_plan": "FHSS 904.9-924.5 MHz (50 ch x 400 kHz)", "rate_kbps": 100, "modulation": "2-FSK + IBM whitening" },
    { "id": "P290", "meter_family": "Badger ORION 2020 OCECNA", "rate_kbps": 200, "modulation": "2-FSK + Gaussian BT=0.5, BW 500 kHz" }
  ],
  "features": [
    "Two FSK radios from one firmware: SX1276 or SX1262 autodetected at boot",
    "Three Badger ORION protocols (P223 / P282 / P290), one selectable at runtime",
    "CC1101 mesh client: every decoded reading is forwarded to the Gateway over 433 MHz with multi-hop and ACKs",
    "Embedded live dashboard with per-meter volume, RSSI, packet count, last-seen, and P282 hopping state",
    "Last CRC-fail dump (raw FIFO + decoded bytes) for field forensics",
    "Email reports via Zoho SMTP — configurable daily / weekly / monthly with per-meter baselines",
    "OTA updates via HTTP POST /update, including iPhone Safari",
    "Always-on AP at 192.168.4.1 so the Node is never permanently bricked by a WiFi typo",
    "JSON mirrors of every dashboard view at /api/*"
  ],
  "endpoints": [
    { "method": "GET",  "path": "/",                       "purpose": "HTML dashboard" },
    { "method": "GET",  "path": "/setup",                  "purpose": "Configuration page" },
    { "method": "POST", "path": "/update",                 "purpose": "Firmware upload (multipart)" },
    { "method": "GET",  "path": "/api/diag",               "purpose": "JSON: uptime, heap, radio chip, per-protocol counters" },
    { "method": "GET",  "path": "/api/meters",             "purpose": "JSON: list of decoded meters (id, volume, RSSI, count, last seen)" },
    { "method": "GET",  "path": "/api/config",             "purpose": "JSON: current configuration" },
    { "method": "POST", "path": "/api/config",             "purpose": "Save configuration" },
    { "method": "GET",  "path": "/api/email",              "purpose": "JSON: scheduled report configuration" },
    { "method": "POST", "path": "/api/email",              "purpose": "Update schedule / recipients" },
    { "method": "POST", "path": "/api/email/send_now",     "purpose": "Trigger immediate report send" }
  ],
  "live_examples": [
    { "ip": "192.168.0.103", "radio": "SX1276", "protocol": "P223", "meters_decoded": 32, "screenshot": "/assets/dashboard-node-sx1276.png" },
    { "ip": "192.168.0.119", "radio": "SX1262", "protocol": "P282", "meters_decoded": 2,  "screenshot": "/assets/dashboard-node-sx1262.png" }
  ]
}
