System Requirements¶
This document contains high-level system requirements for the ESP32 Distance Sensor project.
Document Version: 2.0 Last Updated: 2025-11-12
Description: The system SHALL provide a parking assistance solution for garage parking by measuring the distance to the vehicle and providing visual feedback to help the driver park at the optimal position. Use Case: A driver pulls into their garage and needs to park at the correct distance from the back wall - not too close (risk of hitting the wall) and not too far (wasting garage space or blocking the garage door). The system continuously measures the distance and displays visual feedback (e.g., via LED indicators or display) to guide the driver to the perfect parking spot. Rationale: Many home garages have limited space, and parking too close or too far can be problematic. An automated distance measurement system removes guesswork and enables consistent, safe parking. Acceptance Criteria:
|
Description: The system SHALL operate on ESP32 microcontroller with 4MB flash memory. Rationale: ESP32 provides WiFi connectivity, sufficient processing power, and adequate flash memory for IoT applications. Acceptance Criteria:
|
Description: The system SHALL provide WiFi connectivity in both Access Point (AP) and Station (STA) modes. Rationale: Enables web interface access and network configuration flexibility. Acceptance Criteria:
|
Description: The system SHALL provide web interface for configuration and monitoring. Rationale: User-friendly interface for system setup and operation without firmware recompilation. Acceptance Criteria:
|
Description: The system SHALL persist configuration settings across power cycles using ESP32 NVS (Non-Volatile Storage). Rationale: Maintains user settings and system configuration permanently. Acceptance Criteria:
|
Description: The system SHALL implement modular component-based architecture following ESP-IDF conventions. Rationale: Enables maintainability, testability, and reusability. Acceptance Criteria:
|
Description: The system SHALL handle errors gracefully and attempt recovery where possible. Rationale: Ensures system reliability and user experience. Acceptance Criteria:
|
Description: The system SHALL manage memory efficiently within ESP32 constraints. Rationale: Prevents memory leaks and ensures stable operation. Acceptance Criteria:
|
Description: The system SHALL support build-time selectable emulator mode (QEMU) that replaces hardware-specific modules with simulator implementations while preserving public APIs. Rationale: Enables development and testing without physical hardware, improves reproducibility and CI test coverage. Acceptance Criteria:
|
Description: The system SHOULD provide network connectivity when running in QEMU emulation to enable testing of network-dependent features. Rationale: Enables development and testing of web interfaces, WiFi configuration, and network protocols without physical ESP32 hardware. Acceptance Criteria:
|
Future Enhancements¶
Description: The system MAY support HTTPS for encrypted web interface communication. Rationale: Encrypted communication protects sensitive data (WiFi passwords, configuration) from network eavesdropping. However, embedded certificate management is complex. Known Challenges:
Acceptance Criteria (if implemented):
Note: This requirement is intentionally marked “open” due to complexity. For many embedded use cases, physical access security and network isolation provide sufficient protection. Production deployments requiring HTTPS should evaluate alternatives (VPN, mTLS, secure network). |
Description: The system MAY support network time synchronization via NTP for accurate timestamps. Rationale: Accurate system time enables timestamped logs, scheduled tasks, and time-based security features. Many IoT applications require synchronized time. Acceptance Criteria (if implemented):
Note: This requirement is marked “open” as template focuses on core functionality. Time synchronization can be added when application requires timestamped events or scheduling. |
Traceability¶
All traceability is automatically generated by Sphinx-Needs based on the :links: attributes in each requirement.
ID |
Title |
Status |
Tags |
|---|---|---|---|
Certificate Handler |
implemented |
||
Config Manager |
implemented |
||
Display Logic |
implemented |
||
Distance Sensor |
implemented |
||
LED Controller |
implemented |
||
Network Tunnel |
implemented |
||
Startup Tests |
implemented |
||
Web Server |
implemented |
||
WiFi Manager |
implemented |
||
cert_handler_get_ca_cert |
implemented |
||
cert_handler_get_info |
implemented |
||
cert_handler_get_server_cert |
implemented |
||
cert_handler_get_server_key |
implemented |
||
cert_handler_init |
implemented |
||
config_commit |
implemented |
||
config_factory_reset |
implemented |
||
config_get_all_as_json |
implemented |
||
config_get_bool |
implemented |
||
config_get_int16 |
implemented |
||
config_get_int32 |
implemented |
||
config_get_schema_json |
implemented |
||
config_get_string |
implemented |
||
config_init |
implemented |
||
config_set_all_from_json |
implemented |
||
config_set_bool |
implemented |
||
config_set_bool_no_commit |
implemented |
||
config_set_int16 |
implemented |
||
config_set_int16_no_commit |
implemented |
||
config_set_int32 |
implemented |
||
config_set_string |
implemented |
||
config_set_string_no_commit |
implemented |
||
config_write_factory_defaults |
implemented |
||
display_logic_start |
implemented |
||
distance_sensor_get_latest |
implemented |
||
distance_sensor_get_queue_overflows |
implemented |
||
distance_sensor_has_new_measurement |
implemented |
||
distance_sensor_init |
implemented |
||
distance_sensor_is_running |
implemented |
||
distance_sensor_monitor |
implemented |
||
distance_sensor_start |
implemented |
||
distance_sensor_stop |
implemented |
||
led_clear_all |
implemented |
||
led_clear_pixel |
implemented |
||
led_color_brightness |
implemented |
||
led_color_rgb |
implemented |
||
led_controller_deinit |
implemented |
||
led_controller_init |
implemented |
||
led_get_all_colors |
implemented |
||
led_get_count |
implemented |
||
led_get_pixel |
implemented |
||
led_is_initialized |
implemented |
||
led_set_pixel |
implemented |
||
led_show |
implemented |
||
netif_uart_tunnel_deinit |
implemented |
||
netif_uart_tunnel_get_handle |
implemented |
||
netif_uart_tunnel_init |
implemented |
||
led_running_test_multiple_cycles |
implemented |
||
led_running_test_rainbow |
implemented |
||
led_running_test_single_cycle |
implemented |
||
web_server_get_port |
implemented |
||
web_server_init |
implemented |
||
web_server_is_running |
implemented |
||
web_server_start |
implemented |
||
static_file_handler |
implemented |
||
web_server_stop |
implemented |
||
wifi_manager_clear_credentials |
implemented |
||
wifi_manager_get_ip_address |
implemented |
||
wifi_manager_get_status |
implemented |
||
wifi_manager_init |
implemented |
||
wifi_manager_monitor |
implemented |
||
wifi_manager_set_credentials |
implemented |
||
wifi_manager_start |
implemented |
||
wifi_manager_stop |
implemented |
||
wifi_manager_switch_to_ap |
implemented |
||
distance_sensor_error_t |
implemented |
||
distance_measurement_t |
implemented |
||
distance_raw_measurement_t |
implemented |
||
led_color_t |
implemented |
||
netif_uart_tunnel_config_t |
implemented |
||
web_server_config_t |
implemented |
||
wifi_credentials_t |
implemented |
||
wifi_manager_mode_t |
implemented |
||
wifi_status_t |
implemented |
||
JSON Schema as Configuration Source of Truth |
implemented |
config; schema; architecture |
|
Web Interface Integration Support |
approved |
config; integration |
|
NVS Error Graceful Handling |
implemented |
config; error-handling; reliability |
|
Configuration Initialization on Boot |
implemented |
config; boot |
|
Simple Process to Add Configuration Fields |
implemented |
config; extensibility; developer-experience |
|
Type Safety via Optional Static Validation |
implemented |
config; validation; developer-experience |
|
Configuration Schema Versioning and Migration |
open |
config; versioning; migration; future |
|
Parameter Grouping for UI Organization |
implemented |
config; ui; schema |
|
Parameter Type System |
implemented |
config; types |
|
Build-Time Factory Defaults Generation |
implemented |
config; build; code-generation |
|
No Runtime JSON Parsing in C Code |
implemented |
config; performance; memory |
|
Key-Based NVS Storage |
implemented |
config; storage; nvs |
|
Type-Safe Configuration API |
implemented |
config; api; type-safety |
|
Persistent Configuration Storage |
implemented |
config; storage; nvs |
|
Factory Reset Capability |
implemented |
config; reset |
|
Supporting Documentation Traceability |
implemented |
developer; documentation; traceability |
|
Supported Development Environments |
implemented |
developer; devcontainer; codespaces |
|
Debugging Guide Content |
implemented |
developer; documentation; debugging |
|
Web Flasher Guide Content |
implemented |
developer; documentation; flasher |
|
Switching Dev Modes Guide Content |
implemented |
developer; documentation; devmodes |
|
QEMU Emulator Guide Content |
implemented |
developer; documentation; qemu |
|
Known Limitations Documentation |
implemented |
developer; limitations; known-issues |
|
Hardware Specifications Content |
implemented |
developer; documentation; hardware |
|
Overview Index Content |
implemented |
developer; documentation; overview |
|
Quick Start Content |
implemented |
developer; documentation; quickstart |
|
README Content Scope |
implemented |
developer; documentation; readme |
|
Hardware Platform |
approved |
display; hardware; integration |
|
Configuration Integration |
approved |
display; configuration; integration |
|
Core Visualization Concept |
approved |
display; ux; visualization |
|
Below Minimum Distance Warning |
approved |
display; ux; safety |
|
Out of Range Display |
approved |
display; ux; error-handling |
|
WS2812 LED Strip Support |
approved |
led; hardware; ws2812 |
|
Individual Pixel Control |
approved |
led; control; api |
|
Configurable LED Count |
approved |
led; configuration; flexibility |
|
Accurate Color Display |
approved |
led; quality; color-accuracy |
|
LED State Read API |
approved |
led; api; monitoring; web-interface |
|
QEMU UART Network Bridge |
approved |
emulation; network; qemu; uart |
|
Packet Encapsulation |
approved |
emulation; protocol |
|
Host-Side Bridge Script |
approved |
emulation; tooling; host |
|
DHCP Client Support |
approved |
emulation; network; dhcp |
|
Conditional Compilation |
approved |
emulation; build |
|
Emulation Setup Documentation |
approved |
emulation; documentation |
|
Tunnel Throughput |
approved |
emulation; performance |
|
Packet Loss Handling |
approved |
emulation; reliability |
|
Component Initialization |
approved |
sensor; initialization; gpio |
|
Timing and Performance |
approved |
sensor; performance; timing |
|
Accuracy and Calibration |
approved |
sensor; accuracy; calibration |
|
Timeout Error Handling |
approved |
sensor; error-handling; timeout |
|
Range Validation |
approved |
sensor; error-handling; validation |
|
Queue Overflow Management |
approved |
sensor; error-handling; queue |
|
Trigger Pulse Generation |
approved |
sensor; trigger; timing |
|
Real-Time Timestamp Capture |
approved |
sensor; isr; timing; real-time |
|
Measurement Processing |
approved |
sensor; processing; filtering |
|
Blocking API Access |
approved |
sensor; api; synchronization |
|
Task Lifecycle Management |
approved |
sensor; lifecycle; freertos |
|
Health Monitoring |
approved |
sensor; monitoring; diagnostics |
|
Real-Time ISR Constraints |
approved |
sensor; performance; real-time; isr |
|
Memory Resource Limits |
approved |
sensor; memory; resource |
|
LED Controller Initialization |
approved |
startup; initialization; led |
|
Visual Boot Sequence |
approved |
startup; ux; validation |
|
Timing Performance |
approved |
startup; performance; timing |
|
Garage Parking Assistance System |
approved |
system; parking; garage |
|
Component-based Architecture |
approved |
architecture; modularity |
|
Non-volatile Configuration Storage |
approved |
storage; nvs; configuration |
|
ESP32 Hardware Platform |
approved |
hardware; platform |
|
WiFi Connectivity |
approved |
network; wifi |
|
Memory Management |
approved |
performance; memory |
|
Error Handling and Recovery |
approved |
reliability; error-handling |
|
HTTPS Support |
open |
security; https; future |
|
Emulator Support |
approved |
emulator; qemu; testing |
|
Emulator Network Connectivity |
approved |
emulator; qemu; network; development |
|
System Time and NTP Support |
open |
time; ntp; future |
|
Web-based Configuration |
approved |
web; configuration |
|
Real-time Status Display |
approved |
web; ui; monitoring |
|
Configuration Interface |
approved |
web; ui; configuration |
|
WiFi Setup Interface |
approved |
web; wifi; network |
|
Web Interface Navigation |
approved |
web; ui; navigation |
|
HTTP Server Concurrency |
approved |
web; performance |
|
Configuration REST API |
approved |
web; api; config |
|
LED State API Endpoint |
approved |
web; api; led; visualization |
|
Web UI Responsiveness |
approved |
web; performance; ux |
|
Mobile-First Design |
approved |
web; ui; mobile |
|
Schema-Driven Configuration Form |
approved |
web; ui; config |
|
ESP-IDF CMake Integration |
approved |
build; cmake |
|
Certificate Handler Component Design |
draft |
component; security |
|
GitHub Codespaces Integration |
approved |
development; devcontainer |
|
Component Communication Pattern |
approved |
dataflow; communication |
|
Configuration Manager Component Design |
approved |
component; config |
|
Configuration Data Flow |
approved |
dataflow; config |
|
Error Recovery and Reset Strategy |
approved |
error-handling; reliability; reset |
|
Flash Memory Configuration |
approved |
flash; memory |
|
HTTP Server Architecture Details |
approved |
network; http; web |
|
ESP32 Distance Sensor Layered Architecture |
approved |
architecture; layering |
|
Logging and Diagnostics Strategy |
approved |
logging; diagnostics; debugging |
|
Memory Management Strategy |
approved |
memory; performance |
|
Network Tunnel Component Design |
approved |
component; qemu; network |
|
System Performance Requirements |
approved |
performance; requirements |
|
QEMU Hardware Abstraction |
approved |
qemu; emulation |
|
QEMU Component Selection |
approved |
qemu; build |
|
FreeRTOS Task Organization |
approved |
threading; rtos |
|
Web Server Component Design |
approved |
component; web; network |
|
WiFi Manager Design Details |
approved |
network; wifi |
|
Type-Safe Configuration API |
approved |
api; interface; c-api |
|
JSON Schema-Driven Architecture |
draft |
architecture; config; json-schema |
|
Bulk JSON Configuration API |
approved |
api; json; bulk-operations |
|
Factory Reset via Bulk JSON Update |
approved |
build-process; code-generation; factory-reset |
|
Adding New Configuration Fields |
approved |
development; guide; extensibility |
|
Configuration Schema Structure |
approved |
data-structure; schema |
|
JSON Schema as Single Source of Truth |
approved |
architecture; schema; design-pattern |
|
NVS Storage Format |
approved |
storage; nvs |
|
Type Safety Without Code Generation |
approved |
type-safety; best-practices |
|
JSON Schema for UI Generation |
approved |
web; ui; javascript |
|
Configuration Webpage Architecture |
implemented |
frontend; javascript; ui |
|
Device Reset Countdown Interface |
implemented |
ui; countdown; reset |
|
Error Handling and User Feedback |
implemented |
error-handling; feedback |
|
Configuration Data Flow |
implemented |
data-flow; json; api |
|
Dynamic Form Generation from Schema |
implemented |
form-generation; schema; javascript |
|
Complete Page Initialization Flow |
implemented |
initialization; lifecycle |
|
JSON Array to Form Field Mapping |
implemented |
data-mapping; json; form |
|
UI State Management |
implemented |
ui-state; javascript |
|
Supported Development Environments — Options |
implemented |
developer; devcontainer; codespaces |
|
Supported Development Environments — Setup Steps |
implemented |
developer; devcontainer; codespaces |
|
Debugging Guide — Debugging Features |
implemented |
developer; documentation; debugging |
|
Debugging Guide — Quick Start in QEMU |
implemented |
developer; documentation; debugging |
|
Web Flasher Guide — Overview and Browser Requirements |
implemented |
developer; documentation; flasher |
|
Web Flasher Guide — Flash Procedure |
implemented |
developer; documentation; flasher |
|
Dev Modes Guide — What Changes Between Modes |
implemented |
developer; documentation; devmodes |
|
Dev Modes Guide — How to Switch |
implemented |
developer; documentation; devmodes |
|
QEMU Guide — Starting QEMU |
implemented |
developer; documentation; qemu |
|
QEMU Guide — Stopping QEMU |
implemented |
developer; documentation; qemu |
|
QEMU Guide — Accessing the Web Interface |
implemented |
developer; documentation; qemu |
|
Known Limitations File Structure and Process |
implemented |
developer; limitations; known-issues |
|
Hardware Components Listing |
implemented |
developer; documentation; hardware |
|
Hardware Pin Assignment Table |
implemented |
developer; documentation; hardware |
|
Overview Index — Navigation Section |
implemented |
developer; documentation; overview |
|
Overview Index — Project Description |
implemented |
developer; documentation; overview |
|
Overview Index — Audience Section |
implemented |
developer; documentation; overview |
|
Quick Start — Hardware Path |
implemented |
developer; documentation; quickstart; hardware |
|
Quick Start — QEMU Path |
implemented |
developer; documentation; quickstart; qemu |
|
README Introduction and Project Link |
implemented |
developer; documentation; readme |
|
README Metadata Section |
implemented |
developer; documentation; readme |
|
Distance-to-Visual Mapping Algorithm |
approved |
display; algorithm; mapping |
|
Embedded Arithmetic Architecture |
approved |
display; performance; arithmetic |
|
Public Display API |
approved |
display; api; interface |
|
Task-Based Architecture |
approved |
display; freertos; task |
|
Configuration Integration |
approved |
display; configuration |
|
WS2812 Hardware Integration |
approved |
display; hardware; integration |
|
Pixel-Level Control API |
approved |
led; api; control |
|
Batch Operations API |
approved |
led; api; batch |
|
LED State Read API |
approved |
led; api; monitoring; thread-safety |
|
RMT Peripheral Hardware Abstraction |
approved |
led; rmt; hardware |
|
RAM Buffer Architecture |
approved |
led; memory; buffer |
|
Color Representation and Conversion |
approved |
led; color; conversion |
|
Error Handling and Validation |
approved |
led; error-handling; validation |
|
Dynamic Memory Management |
approved |
led; memory; resource |
|
LED Controller Simulator |
approved |
led; simulator; qemu |
|
WS2812 Timing Specification |
approved |
led; timing; ws2812 |
|
UART Tunnel Component Architecture |
implemented |
netif; qemu; uart; architecture |
|
Host-Side Serial-TUN Bridge Script |
implemented |
netif; qemu; python; bridge; tooling |
|
Conditional Compilation — QEMU-Only Build Guard |
implemented |
netif; qemu; build; kconfig |
|
IP Configuration and DHCP Client Integration |
implemented |
netif; qemu; dhcp; ip |
|
Emulation Setup Documentation |
implemented |
netif; qemu; documentation |
|
Performance Characteristics and Known Limitations |
implemented |
netif; qemu; performance; limitations |
|
UART Wire Protocol — Length-Prefix Framing |
implemented |
netif; qemu; protocol; framing |
|
Distance Calculation Algorithm |
approved |
sensor; algorithm; calibration |
|
EMA Smoothing Filter Design |
approved |
sensor; algorithm; filtering |
|
Public API Design |
approved |
sensor; api; interface |
|
Dual-Queue Real-Time Architecture |
approved |
sensor; architecture; real-time |
|
GPIO Interface Design |
approved |
sensor; gpio; hardware |
|
Error Handling Design |
approved |
sensor; error-handling; robustness |
|
Interrupt Service Routine Design |
approved |
sensor; isr; real-time |
|
Distance Sensor Simulator Design |
approved |
sensor; simulator; qemu |
|
Sensor Task Design |
approved |
sensor; freertos; task |
|
LED Controller Dependency Design |
approved |
startup; initialization; dependency |
|
Sequential LED Pattern Algorithm |
approved |
startup; algorithm; visual |
|
Startup Integration and Cleanup |
approved |
startup; integration; cleanup |
|
Component Architecture |
approved |
startup; architecture; component |
|
Web Server Architecture |
approved |
web; architecture |
|
Captive Portal Design |
approved |
web; captive-portal; wifi |
|
HTTP Server Configuration |
approved |
web; config; performance |
|
Extension Guide for Web Pages |
approved |
web; extensibility; guide |
|
Config Manager Integration Pattern |
approved |
web; integration; config |
|
WiFi Manager Integration Pattern |
approved |
web; integration; wifi |
|
Mobile-First Responsive Design |
approved |
web; ui; mobile; responsive |
|
Configuration API Endpoints |
approved |
web; api; config; schema |
|
System Health API Endpoint |
approved |
web; api; diagnostics |
|
LED State API Endpoint |
approved |
web; api; led; visualization |
|
WiFi Management REST API Endpoints |
approved |
web; api; wifi |
|
URI Routing Table |
approved |
web; routing |
|
CORS Configuration |
approved |
web; security; cors |
|
Static File Embedding Strategy |
approved |
web; build; embedding |
|
Web Server Testing Strategy |
approved |
web; testing |
|
Modular Firmware Extensibility |
implemented |
developer; firmware; extensibility |
|
Traceable Supporting Documentation |
implemented |
developer; documentation; traceability |
|
Visual Distance Feedback for Parking |
approved |
display; sensor; garage-user |
|
Appliance Reliability - Just Works on Power |
approved |
reliability; startup; garage-user |
|
Device Setup via Web Interface |
approved |
setup; wifi; web; maker |

REQ_SYS_HW_1¶