Skip to content

📶 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

  1. Add pictures to Google Photos album.
  2. Download pictures from album to homelab.
  3. 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:

Create Album

rclone mkdir gphotos:album/"Your New Album Name"

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:

Download Images

task download
./download.sh

This will execute the download.sh script, which will:

  1. Check for rclone dependency.

  2. Load environment variables from .env.

  3. Verify or attempt to configure the gphotos rclone remote.

  4. Create the Google Photos album if it does not already exist.

  5. Create the local destination directory if it doesn't exist.

  6. 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.

Create Crontab Job

./create-crontab.sh

🔍 Verify Crontab Job

To verify that the crontab job has been successfully added, you can list your current crontab entries:

List Crontab Jobs

crontab -l

❌ Remove Crontab Job

If you need to remove the crontab job, you can edit your crontab and delete the relevant line:

Edit Crontab Jobs

crontab -e

Locate and delete the line containing download.sh.

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.

🔗 References