FrameFi
¶
FrameFi is an application used to display pictures on my digital picture frame using a LILYGO T-Dongle S3. This documentation focuses on how to download images from a Google Photos album using rclone
so that the photos can then be synced with the frame.
Workflow¶
- Add pictures to Google Photos album.
- Download pictures from album to homelab.
- Sync photos from homelab to digital picture frame via FrameFi (FTP).
Installation¶
See rclone for rclone
installation and FrameFi for how to setup FrameFi on your LILYGO T-Dongle S3.
Configuration path: /opt/frame-fi
Config¶
Before running the download script, you need to configure the .env
file and rclone
.
Copy the .env.tmpl
to .env
and then edit the following variables:
homelab/pve/frame-fi/.env
CONFIG_DIR=/etc/frame-fi
INSTALL_DIR=/opt/frame-fi
SERVICE_NAME=frame-fi
RCLONE_GPHOTOS_CLIENT_ID="your_client_id"
RCLONE_GPHOTOS_CLIENT_SECRET="your_client_secret"
RCLONE_GPHOTOS_ALBUM_NAME=""
RCLONE_DOWNLOAD_DESTINATION="${INSTALL_DIR}/images"
# Mailrise Notification Settings (Optional)
MAILRISE_HOST="smtp://smtp.l.nicholaswilde.io"
MAILRISE_PORT="8025"
MAILRISE_API_KEY=""
MAILRISE_FROM="[email protected]"
MAILRISE_TO="[email protected]"
RCLONE_GPHOTOS_CLIENT_ID
: Your Google API client ID for rclone.RCLONE_GPHOTOS_CLIENT_SECRET
: Your Google API client secret for rclone.RCLONE_GPHOTOS_ALBUM_NAME
: The exact name of the Google Photos album you wish to download.RCLONE_DOWNLOAD_DESTINATION
: The local directory where the downloaded images will be stored. Defaults to${INSTALL_DIR}/images
.
Rclone Configuration¶
The download.sh
script assumes an rclone
remote named gphotos
is configured to access Google Photos. If it's not already set up, you will need to configure it interactively using rclone config
.
Warning
While the script sets the client ID and secret as environment variables, rclone
typically requires an authenticated token for Google Photos. It is highly recommended to run rclone config
interactively to set up the gphotos
remote and obtain the necessary token.
Warning
Rclone can only download photos from albums that were created by rclone itself. It cannot download from albums created directly in Google Photos or by other applications.
Creating Google Photos Albums with Rclone¶
To create a new Google Photos album that rclone can later download from, use the following command:
Replace "Your New Album Name"
with the desired name for your album. Once created, you can upload photos to this album using rclone or manually via the Google Photos interface.
Usage¶
To download images from your configured Google Photos album, simply run the download
task:
This will execute the download.sh
script, which will:
-
Check for
rclone
dependency. -
Load environment variables from
.env
. -
Verify or attempt to configure the
gphotos
rclone remote. -
Create the Google Photos album if it does not already exist.
-
Create the local destination directory if it doesn't exist.
-
Use
rclone sync
to download images from the specified Google Photos album to the local destination.
Automated Downloads (Crontab)¶
To automate the daily download of images, a crontab job can be created using the create-crontab.sh
script.
Create Crontab Job¶
Run the following command to create a daily crontab job that executes the download.sh
script at 3:00 AM.
Verify Crontab Job¶
To verify that the crontab job has been successfully added, you can list your current crontab entries:
Remove Crontab Job¶
If you need to remove the crontab job, you can edit your crontab and delete the relevant line:
Task List¶
task: Available tasks for this project:
* clean: Remove all downloaded images from the local destination.
* decrypt: Decrypt sensitive configuration files using SOPS.
* default: List all available tasks.
* download: Download images from Google Photos album.
* enable: Enable the application's systemd service.
* encrypt: Encrypt sensitive configuration files using SOPS.
* export: Export the task list to `task-list.txt`.
* init: Initialize the application's environment and configuration files.
* install: Install the FrameFi application and set up its environment.
* mklinks: Create symbolic links for configuration files.
* restart: Restart the application's systemd service.
* start: Start the application's systemd service.
* status: Check the status of the application's systemd service.
* stop: Stop the application's systemd service.
* update: Update the application or its running containers.
* upgrade: Upgrade the application by pulling the latest changes and updating.