How michaelpenner/greifarm works
The product is a DIY CoreXY arcade claw machine: an ESP32 runs the hardware, a Raspberry Pi backend exposes APIs and bridges the ESP32 to browser clients, and a tablet UI provides the operator/player surface. The principal workflow is a browser command routed through the backend to the machine, with telemetry relayed back. Firmware also covers game control, motion, sensing, safety, configuration, and lighting. Some firmware subsystems and frontend wiring are represented from the source index or README rather than inspected excerpts, so uncertain links are omitted.
Main entry points: main.cpp Firmware runtime · main.py FastAPI application · websocket-client.js WebSocket client · esp_client.py ESP WebSocket client
Components 23
Tablet Interface
- Browser UI
frontend/js/state-manager.js - WebSocket client
frontend/js/websocket-client.js
Backend Services
- FastAPI application
backend/main.py - Machine controls
backend/api/routes_machine.py - Game API
backend/api/routes_game.py - Statistics API
backend/api/routes_stats.py - Admin API
backend/api/routes_admin.py - Game database
backend/database/models.py - ESP WebSocket client
backend/services/esp_client.py
Firmware Control
- Firmware runtime
firmware/src/main.cpp - WebSocket server
firmware/src/communication/websocket_server.cpp - Command protocol
firmware/src/communication/protocol.h - Game state machine
firmware/src/game/game_state_machine.cpp - Runtime configuration
firmware/src/config/config_manager.cpp
Machine Systems
- Motion planner
firmware/src/motion/motion_planner.cpp - Homing control
firmware/src/motion/homing.cpp - Stepper control
firmware/src/motion/stepper_controller.cpp - Claw control
firmware/src/claw/claw_controller.cpp - Sensor manager
firmware/src/sensors/sensor_manager.cpp - Safety control
firmware/src/safety/safety_controller.cpp - Joystick input
firmware/src/joystick/joystick_reader.cpp - LED control
firmware/src/lighting/led_controller.cpp
Other components
- Tablet user
Connections 24
- Tablet user → Browser UI: uses
- Browser UI → WebSocket client: sends commands
- WebSocket client → FastAPI application: WebSocket commands
backend/main.py - FastAPI application → WebSocket client: broadcasts telemetry
backend/main.py - FastAPI application → ESP WebSocket client: starts and listens
backend/main.py - FastAPI application → Machine controls: mounts router
backend/main.py - FastAPI application → Game API: mounts router
backend/main.py - FastAPI application → Statistics API: mounts router
backend/main.py - FastAPI application → Admin API: mounts router
backend/main.py - Machine controls → ESP WebSocket client: sends commands
backend/api/routes_machine.py - FastAPI application → Game database: initializes
backend/main.py - ESP WebSocket client → WebSocket server: WebSocket link
- WebSocket server → Command protocol: uses messages
- Firmware runtime → WebSocket server: runs firmware service
- Firmware runtime → Game state machine: runs game control
- Firmware runtime → Motion planner: runs motion control
- Firmware runtime → Homing control: runs homing
- Motion planner → Stepper control: controls steps
- Firmware runtime → Claw control: runs claw control
- Firmware runtime → Sensor manager: updates sensors
- Firmware runtime → Safety control: updates safety
- Firmware runtime → Joystick input: reads input
- Firmware runtime → LED control: runs lighting
- Firmware runtime → Runtime configuration: loads settings