How 1061700625/raspberrypi-magicmirror works
Main Components
• Hardware/Sensors: Represent the physical inputs including the camera for face and emotion detection, temperature/humidity sensors (as indicated by DHT11 files and GPIO usage), and microphone/speaker components for voice interaction.
• Core Processing Layer (Python Project):
• UI & Display: The mirror UI scripts (mirrorUI.py, mirrorUI.ui) and the layout design which drive the actual display on the mirror.
• Recognition & Interaction: Modules for face detection (face.py, haarcascades data), voice processing/speech (speech.py, snowboydecoder.py), and emotional analysis.
• Utility & Sensor Integration: Files like the GPIO usage table and DHT11 C file indicate sensor readings are integrated here.
• Mobile/Remote Interface:
• Android App: Present inside the AndroidStudioProjects directory, which likely communicates with the Raspberry Pi (via an API or socket connection) to push usage information and exchange commands.
• Web Interface:
• WebProject: Contains a picture viewer and PHP scripts (upload_file.php) indicating some web-based interaction, possibly for monitoring or additional content display.
• External Documentation/Deployment:
• Various Markdown files (e.g., “第三方库的安装.md”, “服务器部署.md”) and flowcharts (in the “各模块大致流程图” directory) suggest additional deployment and operational framing for the system.
Relationships and Data Flow
• The Core Processing Layer will process data (e.g., face recognition, sensor readings) and update the UI display module.
• Parallel channels: Voice interaction and emotion/speech modules communicate with both the display and with external endpoints.
• Remote Interaction:
• Data communication between the Android app and the Core Processing Layer (to receive push notifications or control signals).
• The Web interface, which might be used for uploading or viewing data (e.g., picture uploads, status monitoring), connects to the backend via standard web protocols.
Architectural Patterns and Technologies
• Modular Design: Separate functionality into discrete modules such as sensor handling, UI rendering, recognition processing, and network communication.
• Full-stack Integration: Combining local processing on the Raspberry Pi (using Python) with distributed interfaces (Android app, Web UI).
• Communication Protocols: Identify and visually annotate any protocols (e.g., HTTP/REST for web communication, possibly WebSocket or similar for real-time control) if details are known.
• Interaction Patterns: Show how user inputs (via voice or remote app) generate feedback on the mirror display.