Web-controlled focus stacking for macro photography. Drives camera focus via libgphoto2, stepper motor via GPIO, serves a control UI over HTTP. Runs on Raspberry Pi Zero 2 W or desktop Linux.
git clone <repo-url> && cd focus-rail
direnv allow # or: nix developcp .env.example .env # edit with your Pi's SSH target./scripts/pi-setup.sh pi@raspberrypi.local
ssh pi@raspberrypi.local sudo rebootzig build -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseSafe
./scripts/deploy.shOpen http://<pi-ip>:8080 in a browser.
# 1. Capture a stack via the web UI
# 2. Pull images to your desktop
./scripts/pull-stack.sh S001 # -> ./S001/
# 3. Process
./scripts/stack.sh S001/S001_manifest.json| Command | Description |
|---|---|
zig build |
Native debug build |
zig build -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseSafe |
Cross-compile for Pi |
./scripts/deploy.sh |
Deploy binary + calibrations to Pi, restart server |
./scripts/pi-setup.sh <host> |
One-time Pi configuration |
./scripts/pull-stack.sh S001 [dest] |
Download stack from Pi (default: ./S001/) |
./scripts/stack.sh <manifest>... |
Process a focus stack |