# ============================================================================= # config_local.example.py - Operational/secret value template (Pi 4 leak detection module) # # Usage: cp config_local.example.py config_local.py # → Fill in with real values, then save. Never commit config_local.py # (excluded via .gitignore). # # ⚠️ Server compatibility # This module (Module 1) reports to the "same" cafe24 server php/ as Module 2 (SHT30 temp/humidity) — integrated. # For leak events (leak_alert / leak_recovery) and photo uploads, the server requires a raw-body signature: # X-Signature = lowercase_hex(HMAC-SHA256(key=API_KEY, msg=request body bytes)) # photo upload canonical = device_id|sensor_id|log_id|timestamp (no spaces) # → API_KEY must be "exactly identical" to the API_KEY in the server's config.local.php. # The server DB is installed from the single sql/schema_sht30.sql (includes leak components), # and leak status, photos, and temp/humidity are shown together on one dashboard (dashboard.php). # (The legacy sha256(API_KEY + sorted JSON) body-field signature is deprecated — the server rejects it.) # ============================================================================= # ───────────────────────────────────────────── # Server API endpoints (integrated server = cafe24 php/, same server as Module 2) # Web root per INSTALL_PI_SERVER.md: public_html/raspi_leck_detecter/ # ───────────────────────────────────────────── API_URL = "https://YOUR_SERVER/raspi_leck_detecter/api/sensor_data.php" PHOTO_UPLOAD_URL = "https://YOUR_SERVER/raspi_leck_detecter/api/photo_upload.php" # ───────────────────────────────────────────── # Shared secret key — must be exactly identical to the server-side API_KEY. Never commit. # ───────────────────────────────────────────── API_KEY = "CHANGE_ME" # ───────────────────────────────────────────── # Device identification (distinguishes multiple units) # ───────────────────────────────────────────── DEVICE_ID = "rpi4-leak-01" DEVICE_LOCATION = "Server Room" # ───────────────────────────────────────────── # (Optional) Sensor list override — for new site nodes # If undefined, uses the config.py default (SENSORS = [{"id": 1, ...}]). # When deploying a new site (e.g. Pi-C, sensor_id 3), define it only in this file; # the tracked file (config.py) does not need to be modified. For server dashboard card # display, also update 'LEAK_SENSOR_IDS' => [1, 3] in the server's config.local.php. # ⚠️ sensor_id must be unique per site — reusing 1/2 will silently overwrite the # existing site's status (leak_sensor_status is keyed on sensor_id alone). # ───────────────────────────────────────────── # SENSORS = [ # {"id": 3, "gpio": 17, "name": "Sensor 3 (New Site)"}, # ] # (When enabling the above, DEVICE_ID e.g. "rpi4-leak-02", and change DEVICE_LOCATION to the site name too)