How falleng0d/pi-remote works
Main Components
a) Client Layer:
• Remote Control App (external mobile application)
• This as the entry point for user interactions
b) Communication Layer:
• gRPC Server (represented by server.py)
• Protocol Buffers (input.proto and generated files)
c) Core Processing Layer:
• Input Service (input_service.py)
• Config Service (config_service.py)
• Text-to-HID Converter (text_to_hid.py)
d) Hardware Interface Layer:
• USB Gadget Implementation (otg directory)
• HID Protocol Handler (app/hid directory)
Component Relationships
[Mobile App] → [gRPC Server] → [Input Service] → [HID Protocol Handler] → [USB Gadget] → [Target Device]
Specific Implementation Details
Technical elements:
• Protocol Buffers for data serialization (input.proto)
• USB Gadget configuration scripts
• HID keycodes mapping
• System services (pi-remote.service)
Key Architectural Patterns to Highlight
• Client-Server architecture via gRPC
• Hardware abstraction layer for USB/HID
• Service-based architecture (input and config services)
Implementation-Specific Notes
Crucial elements:
• The USB gadget initialization flow
• HID protocol translation process
• Configuration management
• Service deployment
• Client Layer | → | Processing Layer | → | Hardware Layer |
• (Mobile App) | | (gRPC + Services)| | (USB + HID) |