tools: add recover_batch.py — fleet-wide camera recovery sweep#7
Open
dropchop wants to merge 1 commit into
Open
tools: add recover_batch.py — fleet-wide camera recovery sweep#7dropchop wants to merge 1 commit into
dropchop wants to merge 1 commit into
Conversation
Batch version of recover_camera.py: scan ActionCam_* APs, multi-select, one scan pass to inventory every camera, then a single confirm to pull the whole fleet (auto-cycling each AP into ~/larkfly-recovered/<SSID>/). Reuses recover_camera.py's per-step methods via new label= params so the batch flow can relabel the step output. --scan-only stops after inventory; -n previews. Same root-refusal, dongle-restore-on-exit, and Ctrl-C safety. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
tools/recover_batch.py, a batch/"secondary" version ofrecover_camera.pyfor sweeping a fleet of Larkfly cameras in one run instead of one camera at a time — the rig workflow where several cameras are powered up at once.Flow: scan
ActionCam_*APs → multi-select (1,3,4/all, or skip the scan with repeated--ssid) → scan pass inventories every camera (connect → list → disconnect) → one keypress (y, or--yes) confirms the whole batch → download pass auto-cycles through each camera's AP, mirroring into its own~/larkfly-recovered/<SSID>/.How
Built entirely on
recover_camera.py's proven primitives — samesudo nmclibring-up (BSSID fallback →/32camera route → DHCP IP detect+validate → FTP reachability), sameftp_pull.pyread-only listing + download-only mirror, samebind=192.168.1.10source-pinning. The parent's per-step methods gained an optionallabel=param so the batch flow can relabel step output; defaults keeprecover_camera.py's own output identical.Preserves all the safety properties: refuses to run as root, RETR-only (never DELE/STOR), dongle-restore-on-exit, Ctrl-C-safe.
--scan-onlystops after inventory;-npreviews the exact commands. Exit code is the worst seen across the fleet.Testing
tests/test_recover_batch.py— 10 unit tests coveringparse_selection(ranges, dedup, out-of-range/garbage → re-prompt) and the reusedderive_dest/map_pull_rccontract. Pure logic, no hardware/sudo.--helpand-ndry-run smoke-checked.--scan-onlyto confirm per-AP connect+inventory before committing to the download pass.🤖 Generated with Claude Code