From 66fe1f46ca1bac40194cd240d5c22e9c5cdf781c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Apr 2026 21:56:33 +0000 Subject: [PATCH] Fix CAM_NAME bug, set -x noise, wrong Python package in README daily_sunrise_video.sh: derive CAM_NAME from $1 (defaulting to SUNRISE_CAM) instead of an undefined variable; this was causing empty image/output paths. install.sh: pass $SUNRISE_CAM as argument to daily_sunrise_video.sh so it matches the pattern used by every other per-camera script. sunrise2mm.py: use SUNRISE_CAM config key (not the undefined CAM_NAME) to locate the output directory; fixes silent path mismatch on non-default names. 4-seasons.sh: remove stray `set -x` that was flooding systemd logs with shell trace output. README.md: correct Python dependencies from `ephem` to `suntime pytz` to match what sunrise.py actually imports. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ --- 4-seasons.sh | 1 - README.md | 2 +- daily_sunrise_video.sh | 2 ++ install.sh | 2 +- sunrise2mm.py | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/4-seasons.sh b/4-seasons.sh index 213361c..d917fb1 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -8,7 +8,6 @@ # Run once per day from cron (e.g. 01:00 daily). set -euo pipefail -set -x SCRIPT_DIR="$(dirname "$(realpath "$0")")" source "$SCRIPT_DIR/sky-cam.conf" diff --git a/README.md b/README.md index 2e98066..0e127a4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Automated sky / timelapse camera scripts that produce: Install Python dependencies: ```bash -pip3 install ephem requests +pip3 install suntime pytz requests ``` --- diff --git a/daily_sunrise_video.sh b/daily_sunrise_video.sh index cba0e87..5e32e14 100644 --- a/daily_sunrise_video.sh +++ b/daily_sunrise_video.sh @@ -17,6 +17,8 @@ SCRIPT_DIR="$(dirname "$(realpath "$0")")" source "$SCRIPT_DIR/sky-cam.conf" export TZ="$TIMEZONE" +CAM_NAME="${1:-$SUNRISE_CAM}" + # ── Date / paths ────────────────────────────────────────────────────────────── current_date=$(date +%Y-%m-%d) output_date=$(date +%Y-%m) diff --git a/install.sh b/install.sh index a687a91..847fb4c 100755 --- a/install.sh +++ b/install.sh @@ -86,7 +86,7 @@ OnSuccess=sky-cam-sunrise-upload.service [Service] Type=oneshot -ExecStart=$SCRIPT_DIR/daily_sunrise_video.sh +ExecStart=$SCRIPT_DIR/daily_sunrise_video.sh $SUNRISE_CAM StandardOutput=journal StandardError=journal EOF diff --git a/sunrise2mm.py b/sunrise2mm.py index 5419fc1..c404eb7 100755 --- a/sunrise2mm.py +++ b/sunrise2mm.py @@ -47,7 +47,7 @@ today_date_str = today.strftime("%Y-%m-%d") # e.g., "2024-11-05" today_month_str = today.strftime("%Y-%m") # e.g., "2024-11" # Set the full folder path for today's video -base_video_folder = os.path.join(config.get('MOVIES_DIR', ''), config.get('CAM_NAME', 'sunrise')) +base_video_folder = os.path.join(config.get('MOVIES_DIR', ''), config.get('SUNRISE_CAM', 'sunrise')) output_dir = os.path.join(base_video_folder, today_month_str, "sunrise-only") # Check if the directory exists