Commit Graph

43 Commits

Author SHA1 Message Date
user
c76c1ee61b feat: OTA TLS cert verification + CI release pipeline
Some checks failed
Lint & Build / Security Flaw Analysis (push) Successful in 15s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Failing after 34s
Lint & Build / Build Firmware (push) Has been skipped
Wire ESP-IDF's built-in 150-CA root bundle to the OTA HTTP client
so HTTPS OTA verifies server certificates. Pin bundle config in
sdkconfig.defaults. Replace dead artifact-copy step with Gitea
release creation on tag push. Bump CI container to IDF v5.5.
2026-02-14 22:38:41 +01:00
user
0bcb5ddf0c fix: Enable stack canaries, heap poisoning, WDT panic; remove dead code
- CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y (buffer overflow detection)
- CONFIG_HEAP_POISONING_LIGHT=y (use-after-free/corruption detection)
- CONFIG_ESP_TASK_WDT_PANIC=y (auto-reboot on hung task)
- Remove unused #include "esp_now.h" (CVE-2025-52471 mitigation)
- Replace hardcoded default IP 192.168.129.11 with 0.0.0.0 in Kconfig
2026-02-14 22:16:13 +01:00
user
a81e7e3990 feat: Serial console AUTH + NVS provisioning tool
- Add serial_task: UART console for AUTH management with physical access
  AUTH shows full secret, AUTH <secret> sets, AUTH OFF clears
- Add esp-provision tool: provision auth secret via serial or NVS flash
  Supports auto-generate, custom secrets, --serial and --generate-only
- Fix esp-ota uptime cache: avoid firmware rate limiter on consecutive
  udp_cmd calls by caching uptime_s for 3s
2026-02-14 20:48:40 +01:00
user
57927c7c22 fix: Address P2 security audit findings
- VULN-012: Split STATUS into minimal (unauthed: hostname, uptime,
  rssi, version, motion, presence) and full (authed: all internals,
  build info, target IP, heap, NVS stats)
- VULN-011: Remove mDNS service advertisement and hardcoded "ESP32 CSI
  Sensor" instance name; use hostname only
- VULN-021: Increase HMAC tag from 64 bits (16 hex) to 128 bits
  (32 hex) — BREAKING: client scripts must update HMAC computation
- VULN-023: Enable PMF (802.11w) in sdkconfig.defaults to prevent
  deauth attacks at protocol level
2026-02-14 20:10:14 +01:00
user
ed8669c0af fix: Address P1 security audit findings
- VULN-010: Prevent CSI UDP buffer overflow with bounds-checked
  serialization loops and clamped pos before sendto
- VULN-019: Validate probe frame sig_len before body access
- VULN-017: Add NVS write throttle to config_erase_key()
- VULN-009: Tighten HMAC replay window from ±30s to ±5s, add nonce
  dedup cache (8 entries) to reject exact replays within window
- VULN-004/018: Add 50ms rate limit on command socket (20 cmd/s max)
- VULN-014: Stage baseline calibration in local buffer, gate with
  atomic nsub write to prevent partial reads from CSI callback
2026-02-14 20:05:06 +01:00
user
bbe0e3fb21 fix: Harden command auth and prevent remote auth disable
- Flip cmd_requires_auth() from blacklist to whitelist: only read-only
  query commands are unauthenticated, all state-modifying commands now
  require HMAC (VULN-007)
- Block AUTH OFF command to prevent remote auth disable; secret rotation
  still allowed, full reset via FACTORY (VULN-005)
- Redact auth secret in boot log to first 4 chars only (VULN-003)
- Update HELP text to reflect AUTH change
2026-02-14 20:01:19 +01:00
user
476a9beb3b fix: Harden HMAC auth, sanitize inputs, throttle NVS writes
- Constant-time HMAC comparison (prevents timing side-channel)
- Add timestamp to HMAC scheme for replay protection (30s window)
  New format: HMAC:<16hex>:<uptime_s>:<cmd>
- Validate HOSTNAME against [a-z0-9-] to prevent UDP stream injection
- Sanitize probe request SSIDs (strip non-printable chars and commas)
- Redact HMAC token from serial log output
- NVS write throttle: max 20 writes per 10s to prevent flash wear
2026-02-14 18:41:21 +01:00
user
ebc8a00b46 feat: Auto-generate auth secret and enforce HMAC on privileged commands
- Generate 128-bit random auth secret on first boot via hardware RNG,
  persist to NVS, log to serial for retrieval
- Gate destructive commands (OTA, FACTORY, REBOOT, TARGET, AUTH,
  HOSTNAME set) behind HMAC authentication
- Read-only and operational commands remain open for monitoring
- Require WPA2/WPA3 for WiFi AP association (reject open/WEP)
2026-02-14 18:36:31 +01:00
user
ce5205eb29 feat: Add ALERT command for temp/heap threshold monitoring
ALERT TEMP <celsius> and ALERT HEAP <bytes> emit EVENT packets
when thresholds are crossed (60s holdoff). NVS-persisted, shown
in STATUS and CONFIG. Temp alerts require SOC_TEMP_SENSOR_SUPPORTED.
2026-02-14 17:40:12 +01:00
user
35049df04e feat: Add PING, LOG, RSSI RESET commands
PING returns OK PONG for connectivity testing. LOG sets global
esp_log_level at runtime (NONE/ERROR/WARN/INFO/DEBUG/VERBOSE).
RSSI RESET clears min/max RSSI tracking counters. Compact HELP
text to fit 1400-byte reply buffer.
2026-02-14 14:30:11 +01:00
user
468a97713c feat: Add HELP, CONFIG, FACTORY commands; sync project docs
Firmware: HELP lists all 27 commands with syntax, CONFIG dumps
running config as key=value, FACTORY erases NVS and reboots.

Docs: update PROJECT, ROADMAP, TASKS, TODO to reflect v1.10
completion, v1.11 unreleased work, and esp32-web v0.1.5 state.
Remove stale v2.0 Flask phase-by-phase plan (now tracked in
~/git/esp32-web/). Clean deferred items from completed milestones.
2026-02-14 14:26:01 +01:00
user
aea0a06a5f feat: Add CSI ON/OFF command to toggle CSI collection
When CSI is OFF, probe request capture remains active.
Persisted via NVS key 'csi_enabled'.
2026-02-06 16:21:52 +01:00
user
12fa03a2d5 feat: Default LED to quiet mode (off, solid on motion)
All checks were successful
Lint & Build / Security Flaw Analysis (push) Successful in 16s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / C/C++ Static Analysis (push) Successful in 27s
Lint & Build / Build Firmware (push) Successful in 1m53s
Lint & Build / Deploy to ESP Fleet (push) Has been skipped
2026-02-05 23:27:13 +01:00
user
b65256fa45 feat: Add LED quiet mode (off normally, solid on motion)
LED command: LED [QUIET|AUTO]
- QUIET: LED off, turns solid on motion/presence detection, blinks on OTA
- AUTO: Original behavior (constant blink)

Persisted via NVS key 'led_quiet'.
2026-02-05 23:13:32 +01:00
user
eb4c3d1657 feat: Add build metadata to STATUS, enable size optimization
STATUS now includes built=, idf=, chip= fields for diagnostics.
Switch to -Os compiler optimization (saves ~75 KB).
2026-02-05 22:42:45 +01:00
user
551225d308 fix: Remove unused app_size variable (cppcheck)
All checks were successful
Lint & Build / C/C++ Static Analysis (push) Successful in 29s
Lint & Build / Security Flaw Analysis (push) Successful in 22s
Lint & Build / Secret Scanning (push) Successful in 8s
Lint & Build / Shell Script Analysis (push) Successful in 10s
Lint & Build / Build Firmware (push) Successful in 2m21s
Lint & Build / Deploy to ESP Fleet (push) Successful in 3m20s
2026-02-05 22:08:30 +01:00
user
4b3697c8e6 feat: Add NVS and partition info to STATUS response
Some checks failed
Lint & Build / C/C++ Static Analysis (push) Failing after 38s
Lint & Build / Security Flaw Analysis (push) Successful in 20s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m12s
Lint & Build / Deploy to ESP Fleet (push) Successful in 3m31s
- nvs_used: NVS entries in use
- nvs_free: free NVS entries
- nvs_total: total NVS entries
- part_size: running partition size in bytes
2026-02-05 21:33:20 +01:00
user
d58b6dd814 feat: v1.9 — multi-channel scanning, BLE fingerprinting
Multi-channel scanning (CHANSCAN command):
- Periodic channel hopping (1-13) with 100ms dwell for broader probe capture
- CHANSCAN ON/OFF/NOW/INTERVAL subcommands
- New NVS keys: chanscan (i8), chanscan_int (i32)
- Emits EVENT,hostname,chanscan=done channels=13 on completion
- PROBE_DATA now includes channel number

BLE fingerprinting:
- Extended BLE_DATA format with company_id, tx_power, flags
- Extracts manufacturer data from BLE advertisements
- Common IDs: 0x004C (Apple), 0x00E0 (Google), 0x0075 (Samsung)

STATUS output now includes chanscan=on/off field.
2026-02-05 17:38:08 +01:00
user
9234ff00de feat: Support HTTPS URLs for OTA updates
All checks were successful
Lint & Build / C/C++ Static Analysis (push) Successful in 35s
Lint & Build / Security Flaw Analysis (push) Successful in 19s
Lint & Build / Secret Scanning (push) Successful in 5s
Lint & Build / Shell Script Analysis (push) Successful in 7s
Lint & Build / Build Firmware (push) Successful in 2m18s
Lint & Build / Deploy to ESP Fleet (push) Successful in 3m32s
2026-02-05 13:57:08 +01:00
user
528e34cb25 feat: Add baseline calibration & presence detection (v1.7)
CALIBRATE command captures per-subcarrier CSI amplitudes over a timed
window and stores the averaged baseline in NVS. PRESENCE command enables
real-time scoring via normalized Euclidean distance against the baseline,
with rolling window averaging and 10s holdoff on state transitions.

New commands: CALIBRATE [3-60|STATUS|CLEAR], PRESENCE [ON|OFF|THRESHOLD]
New NVS keys: bl_amps (blob), bl_nsub, presence, pr_thresh
New STATUS fields: presence=, pr_score=
New events: calibrate=done, presence=0|1
2026-02-04 23:04:19 +01:00
user
47db176619 feat: Add POWERSAVE command with DFS + light sleep (v1.6)
Enable ESP-IDF power management framework (DFS 240/80 MHz + light sleep)
and add POWERSAVE command to toggle WiFi modem sleep. NVS-persisted,
default off. Automatically disabled during POWERTEST.
2026-02-04 22:34:13 +01:00
user
4358ce8b96 feat: Add NVS persistence for SCANRATE and PROBERATE commands
Both settings now save to NVS and restore on boot, matching
the pattern used by other persisted config (rate, tx_power, etc).
2026-02-04 22:06:04 +01:00
user
8c79d20cd8 feat: Add POWERTEST command, update roadmap with v2.0 FTM milestone
Add 7-phase power profiling command (POWERTEST) that cycles through
idle, CSI 10/100 Hz, BLE-only, combined, tx_low/tx_high with EVENT
markers for external power meter correlation. Saves/restores all
settings on completion.

Update roadmap: mark v1.4 done, add v2.0 hardware upgrade milestone
for ESP32-S3/C6 with WiFi FTM / 802.11mc inter-sensor ranging.
2026-02-04 21:47:28 +01:00
user
fa589b0238 fix: Revert explicit REQUIRES mbedtls, move flood globals before NVS load
The main component in ESP-IDF auto-includes all components; explicit
REQUIRES overrides this and breaks the build. mbedtls is available
without it. Also moved flood detection globals above config_load_nvs
to fix undeclared identifier errors.
2026-02-04 21:11:24 +01:00
user
2586234473 feat: Add HMAC command auth, deauth flood detection, sign all tools
Firmware:
- HMAC-SHA256 command authentication (AUTH command, NVS persisted)
- Deauth flood detection with ring buffer and aggregate ALERT_DATA
- FLOODTHRESH command (count + window, NVS persisted)
- New STATUS fields: auth=on/off, flood_thresh=5/10
- mbedtls dependency in CMakeLists.txt, rx_buf increased to 192

Tools:
- esp-cmd/esp-fleet/esp-ota import sign_command from esp_ctl.auth
- Commands auto-signed when ESP_CMD_SECRET env var is set

Docs:
- CHEATSHEET: AUTH, FLOODTHRESH, HMAC auth, OUI, watch, osint sections
- TASKS: v1.3 completed section with all new features
2026-02-04 21:07:00 +01:00
user
27aeddbc45 feat: Add channel, boot count, RSSI min/max, actual CSI rate to STATUS
- WiFi channel in STATUS (channel=)
- Boot counter persisted in NVS (boots=)
- RSSI min/max tracked from CSI frames since boot (rssi_min=, rssi_max=)
- Actual CSI rate computed from csi_count/uptime_s (csi_rate=)
2026-02-04 20:12:04 +01:00
user
46d53ae71a feat: Enable FreeRTOS CPU runtime stats, increase cmd_task stack to 6KB
Enable CONFIG_FREERTOS_USE_TRACE_FACILITY and
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS so PROFILE command reports
per-task CPU usage. Increase cmd_task stack from 4KB to 6KB — was
down to 516 bytes free with current PROFILE reply size.
2026-02-04 20:06:40 +01:00
user
1a4a5a4ac1 fix: Disable promiscuous mode on ESP32 — breaks CSI callback
Promiscuous mode (deauth/probe detection) disables CSI data collection
on original ESP32 at the driver level. Guard with #if !CONFIG_IDF_TARGET_ESP32
to only enable on newer chips where the two coexist.
2026-02-04 19:45:56 +01:00
user
60264d83ae feat: Add STATUS counters, WiFi reconnect events, SCANRATE/PROBERATE commands
- Promote CSI packet counter to global, add csi_count= to STATUS
- Add uptime_s= (raw seconds) to STATUS for programmatic parsing
- Emit EVENT on WiFi reconnect with rssi and ip fields
- Add SCANRATE command (5-300s) to tune BLE scan restart interval
- Add PROBERATE command (1-300s) to tune probe dedup cooldown
2026-02-04 19:26:09 +01:00
user
ca526ef667 feat: Add probe request capture and mDNS service advertisement
- Capture WiFi probe requests (subtype 0x04) in promiscuous callback
- Parse SSID from tagged parameters, emit PROBE_DATA via UDP
- Per-MAC deduplication (10s cooldown) to limit probe flood
- Advertise _esp-csi._udp mDNS service for sensor discovery
2026-02-04 19:07:16 +01:00
user
a87151cc9c feat: Add runtime HOSTNAME command — NVS persisted, mDNS updated
Replace all CONFIG_CSI_HOSTNAME usage with runtime s_hostname variable.
Load from NVS on boot (falls back to Kconfig default). HOSTNAME <name>
sets hostname, persists to NVS, updates mDNS live. HOSTNAME (no arg)
queries current value. One firmware binary now works for all devices.
2026-02-04 18:40:47 +01:00
user
59b8001047 docs: Update ROADMAP, TASKS, TODO — mark v1.1 items done
Check off sensor ID, deauth detection, chip temperature, BLE alerting,
dwell time, timestamped logging. Advance TASKS sprint to v1.1. Clean
completed items from TODO.
2026-02-04 18:30:19 +01:00
user
2554e11a0e feat: Add deauth/disassoc frame detection via promiscuous mode
Enable WiFi promiscuous mode (MGMT filter only) to detect deauth and
disassociation frames. Sends ALERT_DATA packets via UDP with sender MAC,
target MAC, and RSSI. Coexists with CSI via separate callback path.
2026-02-04 18:21:45 +01:00
user
a917a5ea02 feat: Add chip temperature to STATUS reply
Use IDF 5.x temperature_sensor driver. Adds temp=XX.X field to STATUS
response. Graceful fallback if sensor init fails.
2026-02-04 18:21:28 +01:00
user
8885b95ee7 feat: Add sensor hostname prefix to CSI_DATA, BLE_DATA, EVENT packets
Multi-sensor support: all data streams now include CONFIG_CSI_HOSTNAME
after the packet type tag. Increase BLE and EVENT buffer sizes.
2026-02-04 18:20:57 +01:00
user
7ec70a653d feat: Add PROFILE command — heap, stack watermarks, CPU runtime stats
- PROFILE command returns heap usage (free/min/dram/iram),
  per-task stack high watermark, and per-task CPU % (when
  CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is enabled)
- Enable FreeRTOS runtime stats in sdkconfig.defaults
- Enlarge cmd reply buffer to 1400 bytes for multi-line output
- Add esp_heap_caps.h include
2026-02-04 17:59:30 +01:00
user
92e65d8775 feat: Add TARGET command — runtime UDP destination config
- TARGET <ip> [port] command to change data destination live
- NVS persistence for target_ip and target_port
- Falls back to Kconfig defaults when no NVS config
- target= field added to STATUS reply
- config_save_str helper for NVS string storage
2026-02-04 17:47:50 +01:00
user
81c4337646 feat: Add v0.5 BLE scanning — NimBLE passive scan, BLE_DATA UDP stream
- NimBLE stack init with passive BLE scanning
- BLE ON/OFF command with NVS persistence
- BLE_DATA,<mac>,<rssi>,<pub|rnd>,<name> UDP packets
- 30s periodic scan restart to refresh duplicate filter
- ble= field in STATUS reply
- sdkconfig: enable BT+NimBLE, BLE-only mode, disable Bluedroid
2026-02-04 17:40:20 +01:00
user
c922e05266 feat: Add v0.4 adaptive sampling — wander detection, auto rate control
On-device CSI wander calculation (coefficient of variation over 50-packet
window). Rate drops to 10 Hz when idle, jumps to 100 Hz on motion with
3s holdoff. EVENT notifications sent to Pi on rate changes. New commands:
ADAPTIVE ON/OFF, THRESHOLD. RATE command disables adaptive mode.
All settings NVS-persisted.
2026-02-04 16:34:19 +01:00
user
d65ac208b9 feat: Add v0.3 OTA updates — dual partition, esp-ota tool, rollback
Dual OTA partition table (ota_0/ota_1, 1920 KB each) on 4MB flash.
Firmware gains OTA command, LED_OTA double-blink, version in STATUS,
and automatic rollback validation. Pi-side esp-ota tool serves firmware
via HTTP and orchestrates the update flow. esp-fleet gains ota subcommand.
2026-02-04 16:19:09 +01:00
user
44bd549761 feat: Add mDNS, watchdog, human-readable uptime, esp-fleet tool
Firmware:
- mDNS announcement as <hostname>.local (configurable via Kconfig)
- Task watchdog with 30s timeout and auto-reboot on hang
- STATUS now returns human-readable uptime (e.g., 3d2h15m) and hostname

Pi-side tools:
- esp-cmd: mDNS hostname resolution (esp-cmd amber-maple.local STATUS)
- esp-fleet: parallel command to all sensors (esp-fleet status)

Tested on amber-maple — mDNS resolves, watchdog active, fleet tool works.
2026-02-04 15:59:18 +01:00
user
18933ea778 feat: Add v0.2 remote management — UDP commands, LED, NVS persistence
Firmware (app_main.c):
- UDP command listener on port 5501 (configurable via Kconfig)
- Commands: REBOOT, IDENTIFY, STATUS, RATE, POWER
- LED status indicator on GPIO2 (off/slow/fast blink/solid)
- NVS persistence for send_rate and tx_power settings
- Refactored ping to support stop/restart for dynamic rate changes
- TX power control via esp_wifi_set_max_tx_power()

Pi-side tooling:
- tools/esp-cmd: standalone Python3 UDP client for device management

Tested on amber-maple (ESP32 v3.1) with ESP-IDF v5.5.2.
2026-02-04 15:36:14 +01:00
user
298e98befb feat: Initial esp32-hacking project with firmware sources and docs 2026-02-04 12:59:28 +01:00