Remote Pi deploy tooling: config + run, and SSH fixes #3

Merged
balint merged 5 commits from feat/pi-deploy-tooling into main 2026-06-06 21:10:52 +01:00
Owner

Follow-on to the installer (#2), shaped by first contact with the real Pis.

Why

  • The install failed on hardware: sudo had no TTY over a non-interactive SSH session, and every step re-prompted for the login password.
  • Bring-up still needed two manual steps per Pi — hand-editing peer_host and SSHing in to launch the phone.

Changes (one per commit)

  1. Make the remote install complete over SSHssh -t so sudo can prompt, a single multiplexed connection so the password is asked once, and drop the redundant mkdir (rsync makes the dir).
  2. make config — prompts for peer_host (the only per-Pi field), defaulting to the current value; writes config/config.yaml. Also runs as piinstall's last step, and stands alone to re-point a Pi.
  3. make run — sync latest code and start the phone in the foreground over ssh -t (log streams back, Ctrl-C stops it); shared push factored into rsync_tree.

On-Pi logic stays in scripts/pi_*.sh, consistent with pi_install.sh. Decisions logged in DECISIONS.md.

🤖 Generated with Claude Code

Follow-on to the installer (#2), shaped by first contact with the real Pis. ## Why - The install failed on hardware: `sudo` had no TTY over a non-interactive SSH session, and every step re-prompted for the login password. - Bring-up still needed two manual steps per Pi — hand-editing `peer_host` and SSHing in to launch the phone. ## Changes (one per commit) 1. **Make the remote install complete over SSH** — `ssh -t` so `sudo` can prompt, a single multiplexed connection so the password is asked once, and drop the redundant `mkdir` (rsync makes the dir). 2. **`make config`** — prompts for `peer_host` (the only per-Pi field), defaulting to the current value; writes `config/config.yaml`. Also runs as `piinstall`'s last step, and stands alone to re-point a Pi. 3. **`make run`** — sync latest code and start the phone in the foreground over `ssh -t` (log streams back, Ctrl-C stops it); shared push factored into `rsync_tree`. On-Pi logic stays in `scripts/pi_*.sh`, consistent with `pi_install.sh`. Decisions logged in `DECISIONS.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sudo on the Pi aborted with "a terminal is required to read the password" on a
non-interactive SSH session, so the install never got past apt — give it a TTY
with `ssh -t`. Each step also opened its own SSH connection, re-asking the login
password every time; reuse a single multiplexed connection and drop the extra
mkdir (rsync creates the dir) so it's asked once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bringing up a Pi meant copying the example and editing peer_host by hand — the
one field that differs between the two Pis. Prompt for it (defaulting to the
current value, so a tuned config survives), and expose it as a standalone
`make config` so a Pi can be re-pointed at a new peer without a full reinstall.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each test cycle meant pushing the latest code and launching the phone on the Pi
over a manual SSH session. `make run` does both and runs it in the foreground so
the log streams back and Ctrl-C stops it. Now that install and run both push the
tree, factor that into a shared rsync_tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gpiozero ships no pin driver of its own; without one it falls back to its
experimental NativeFactory (three warnings at startup, unreliable edge
detection). lgpio is the right backend for current Pi OS. There's no 3.13
wheel, but the Pis run Trixie whose system Python is also 3.13, so it builds
from source against the apt-installed liblgpio — hence the extra build deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The LED was hardcoded to /sys/class/leds/led0, but the Pi 4 names its activity
LED ACT, so the path didn't exist and the LED silently failed. Auto-detect it
instead. Driving sysfs also needs root, so the installer now lays down a udev
rule granting the phone's user write access and applies it on the spot — the
LED works after a plain install, no manual step or reboot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
balint merged commit 378d1efcaf into main 2026-06-06 21:10:52 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
balint/phone!3
No description provided.