How onehumanbeing/esp32-iphone-agent works
ESP32 iPhone Agent lets a user automate a real iPhone through an AI planner/actor loop: the browser submits a goal, the server observes mirrored frames, asks vision-capable models for actions, and sends gestures through an ESP32 HID bridge. Separate manual controls and calibration support direct operation; live status, screenshots, logs, and optional traces expose runs. The README documents AirPlay/UxPlay, firmware behavior, and optional local models; unsampled firmware and some API routes are represented only at the documented subsystem level.
Main entry points: agent.py Planner/actor loop · phone.py Gestures/calibration · app.py Web API · screen.py Screen capture
Components 16
Web control
- Control UI
server/hidagent/static/app.js - Bilingual UI
server/hidagent/static/i18n.js - Web API
server/hidagent/app.py
Agent runtime
- Planner/actor loop
server/hidagent/agent.py - Model client
server/hidagent/llm.py - Run traces
server/hidagent/debug.py
Phone I/O
- Screen capture
server/hidagent/screen.py - Frame analysis
server/hidagent/vision.py - Gestures/calibration
server/hidagent/phone.py - HID TCP device
server/hidagent/device.py - HID bridge firmware
hardware/hid_bridge/hid_bridge.ino
External integrations
- iPhone
- UxPlay receiver
- Vision model API
- Transformers model server
server/serve/transformers_server.py
Other components
- User
Connections 20
- User → Control UI: submits goal
README.md - Control UI → Web API: sends controls
server/hidagent/static/app.js - Web API → Planner/actor loop: starts/stops runs
server/hidagent/app.py - Web API → Gestures/calibration: routes manual actions
server/hidagent/app.py - Web API → Screen capture: serves frames
server/hidagent/app.py - Control UI → Bilingual UI: renders translations
server/hidagent/static/app.js - Planner/actor loop → Screen capture: reads frames
server/hidagent/agent.py - Planner/actor loop → Model client: requests plans/actions
server/hidagent/agent.py - Planner/actor loop → Gestures/calibration: executes actions
server/hidagent/agent.py - Planner/actor loop → Frame analysis: checks screen changes
server/hidagent/agent.py - Planner/actor loop → Run traces: records run data
server/hidagent/agent.py - Gestures/calibration → Frame analysis: locates pointer
server/hidagent/phone.py - Gestures/calibration → Screen capture: observes pointer
server/hidagent/phone.py - Gestures/calibration → HID TCP device: sends gestures
server/hidagent/phone.py - HID TCP device → HID bridge firmware: sends commands
README.md - HID bridge firmware → iPhone: emulates HID
README.md - iPhone → UxPlay receiver: mirrors screen
README.md - UxPlay receiver → Screen capture: streams frames
server/hidagent/screen.py - Model client → Vision model API: calls compatible API
server/hidagent/llm.py - Transformers model server → Vision model API: serves completions
server/serve/transformers_server.py