How hkucukdereli/vrfarm works
VRFarm coordinates browser-operated behavioral sessions across a controller and two Raspberry Pis. The controller configures rigs and experiments, deploys and starts sessions, and receives live events. The Leader prepares stimuli, runs trial stages, operates behavioral devices, records HDF5 data, and commands the Follower to render; session data is then consolidated and synchronized for analysis. The graph preserves documented calibration, diagnostics, and rig-health capabilities. Some subsystem wiring is based on the README because their source was not sampled.
Main entry points: leader.py Trial engine · app.py Flask application · displayd.py Projector daemon · api.py Pi REST API
Components 26
Controller
- Flask application
controller/app.py - Experiment tab
controller/experiment.py - Setup tab
controller/setup.py - Data tab
controller/data.py - Network tab
controller/network.py - Rig registry
controller/registry.py - UDP event receiver
controller/events.py
Session Runtime
- Pi REST API
pi_api/api.py - Trial engine
engine/leader.py - Stimulus planner
shared/stim_generator.py - Behavioral devices
devices
Display System
- Projector daemon
displayd/displayd.py - Display renderer
displayd/renderer.py - DLP control
displayd/dlpc.py - Display calibration
display_calibration - Display diagnostics
display_diagnostics
Data and Health
- Session HDF5
- Session consolidation
shared/consolidate.py - Leader data access
shared/leader_data.py - Analysis loaders
analysis/loaders.py - Rig health monitor
shepherd/shepherd.py
Other components
- Rig operator
- Browser UI
- Leader Pi
- Follower Pi
- Controller data storage
Connections 31
- Rig operator → Browser UI: operates
- Browser UI → Flask application: requests
- Flask application → Experiment tab: mounts
- Flask application → Setup tab: mounts
- Flask application → Data tab: mounts
- Flask application → Network tab: mounts
- Flask application → UDP event receiver: starts receiver
- Experiment tab → Rig registry: loads rig
- Setup tab → Pi REST API: deploys via REST
- Experiment tab → Pi REST API: controls session
- Pi REST API → Trial engine: starts process
- Trial engine → Stimulus planner: builds plan
- Trial engine → Behavioral devices: operates
- Trial engine → Session HDF5: writes trials
- Trial engine → Projector daemon: sends SHOW/QUIT
- Projector daemon → Display renderer: dispatches render
- Projector daemon → DLP control: controls projector
- Projector daemon → Follower Pi: runs on
- Trial engine → Leader Pi: runs on
- Trial engine → UDP event receiver: sends live events
- UDP event receiver → Flask application: demultiplexes events
- Display calibration → Pi REST API: calibrates display
- Display diagnostics → Projector daemon: checks output
- Data tab → Leader data access: inspects sessions
- Data tab → Controller data storage: syncs data
- Leader data access → Leader Pi: reads session files
- Session HDF5 → Session consolidation: merges sidecars
- Session consolidation → Controller data storage: transfers session
- Controller data storage → Analysis loaders: loads sessions
- Rig health monitor → Pi REST API: probes status
- Rig health monitor → Leader Pi: monitors health