News:

LATEST RELEASE:  FPP 9.5 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/9.5

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 17209
Latest: MichaelGilley
New This Month: 8
New This Week: 4
New Today: 1
Stats
Total Posts: 136927
Total Topics: 17300
Most Online Today: 305
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 234
Total: 234

Help with script to run an ESEQ effect - FPP 8.5

Started by robbiet, December 11, 2025, 11:13:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

robbiet

Hi all.  I've created a script that reads a text file to determine which ESEQ file to run based on the date.  For my use case, this is easier than trying to handle in the scheduler.  In fact, I'm building this to greatly simplify my FPP scheduler.  Everything works fine until it gets to the execution step to run the effect and then it errors out.  The ESEQ file exists and can be run manually.  Am I using the correct path?  No matter what I try, it keeps telling me "No such file or directory".  Here is the line causing the error and the error below that as well.  (Full script below)

Line 49 from Code:
        # Run the eseq effect
        /usr/local/bin/fpp -e "${effect_name}",0,1,0,0

Error:
2025-12-11T12:55:50.833517-05:00 Sign fppd[7963]: Starting effect schedule check for date: 2025-12-11 using file: /home/fpp/media/upload/NP_Message1_Schedule.txt
2025-12-11T12:55:50.902996-05:00 Sign fppd[7963]: Condition met: Today is >= 2025-12-01. Running first matching effect: Pick_A_Song_6_10.eseq
2025-12-11T12:55:50.905772-05:00 Sign fppd[8000]: /home/fpp/media/scripts/RunEffectByDateArg.sh: line 49: /usr/local/bin/fpp: No such file or directory


#!/bin/bash

# Define the base upload directory
UPLOADS_DIR="/home/fpp/media/upload"

# Check if a filename was provided as an argument
if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <schedule_filename>"
    echo "Example: $0 my_schedule.txt"
    exit 1
fi

# Construct the full path to the schedule file in the uploads directory
SCHEDULE_FILENAME="$1"
SCHEDULE_FILE="$UPLOADS_DIR/$SCHEDULE_FILENAME"

# Verify that the specified file exists
if [ ! -f "$SCHEDULE_FILE" ]; then
    echo "Error: Schedule file not found at $SCHEDULE_FILE"
    exit 1
fi

# Get today's date in YYYY-MM-DD format for easy comparison
TODAY=$(date +%Y-%m-%d)

echo "Starting effect schedule check for date: $TODAY using file: $SCHEDULE_FILE"

# Read the schedule file line by line
while IFS=',' read -r effect_date effect_name
do
    # Trim whitespace
    effect_date=$(echo "$effect_date" | xargs)
    effect_name=$(echo "$effect_name" | xargs)

    # Skip empty lines or comments
    if [[ -z "$effect_date" || "$effect_date" == \#* ]]; then
        continue
    fi

    # Convert the file date to epoch seconds
    FILE_DATE_EPOCH=$(date -d "$effect_date" +%s)
    TODAY_EPOCH=$(date -d "$TODAY" +%s)

    # Compare dates: check if today's date is greater than or equal to the file date
    if (( TODAY_EPOCH >= FILE_DATE_EPOCH )); then
        echo "Condition met: Today is >= $effect_date. Running first matching effect: $effect_name"
       
        # Run the eseq effect
        /usr/local/bin/fpp -e "${effect_name}",0,1,0,0
       
        # *** EXIT HERE ***
        # This stops the script after the first successful match is run.
        exit 0
    fi
done < "$SCHEDULE_FILE"

echo "Schedule check complete without finding a valid effect to run."

darylc

You need to call the FPP API to start an effect not /usr/local/bin/fpp.  You might find the simplest way is to create a command preset inside fpp and then call it eg heres a command to call a preset called foo on my dev fpp.

curl http://192.168.33.254/api/command/Trigger%20Command%20Preset/foo

robbiet

Well I went round and round with my buddy ChatGPT.  In the end, could not find a solution that works.  I got the script running and can also run the ESEQ manually.  However, when the script tries running, I don't visually see the effect running.  Here is the script so far just if you are curious.  ChatGPT recommended in the end upgrading to 9.X from 8.X



[th]Requirement[/th]
[th]Your Current FPP 8.x[/th]
[th]FPP 9.x+[/th]
Run Pixel Overlay via CLI❌ (still not CLI)
Run Pixel Overlay via REST API
Schedule overlay scripts
Plugin/scripting supportlimitedexpanded

Conclusion:
✨ Upgrade to FPP 9.x (ideally 9.3) to unlock the API support you need for scripted Pixel Overlay control.



#!/bin/bash
# ===============================
# Effect Schedule Runner for FPP
# Pixel Overlay Model version
# ===============================
UPLOADS_DIR="/home/fpp/media/upload"
EFFECTS_DIR="/home/fpp/media/effects"
# Pixel Overlay Model name (exact)
MODEL_NAME="NorthPoleMatrix"
# FPP binary
FPP_BIN="/opt/fpp/src/fpp"
# -------------------------------
# Input validation
# -------------------------------
if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <schedule_filename>"
    exit 1
fi
SCHEDULE_FILE="$UPLOADS_DIR/$1"
if [ ! -f "$SCHEDULE_FILE" ]; then
    echo "Error: Schedule file not found: $SCHEDULE_FILE"
    exit 1
fi
TODAY=$(date +%Y-%m-%d)
TODAY_EPOCH=$(date -d "$TODAY" +%s)
echo "Schedule check for date: $TODAY"
echo "Using Pixel Overlay Model: '$MODEL_NAME'"
# -------------------------------
# Process schedule file
# -------------------------------
while IFS=',' read -r effect_date effect_name; do
    effect_date=$(echo "$effect_date" | xargs)
    effect_name=$(echo "$effect_name" | xargs)
    # Skip empty lines or comments
    if [[ -z "$effect_date" || "$effect_date" == \#* ]]; then
        continue
    fi
    if ! FILE_DATE_EPOCH=$(date -d "$effect_date" +%s 2>/dev/null); then
        echo "Warning: Invalid date format in schedule: $effect_date"
        continue
    fi
    if (( TODAY_EPOCH >= FILE_DATE_EPOCH )); then
        EFFECT_FILE="$EFFECTS_DIR/$effect_name"
        if [ ! -f "$EFFECT_FILE" ]; then
            echo "ERROR: Effect file not found: $EFFECT_FILE"
            exit 1
        fi
        echo "Running effect '$effect_name' on model '$MODEL_NAME'"
        # Run effect silently (suppress stdout/stderr)
        "$FPP_BIN" -x "$MODEL_NAME" "$effect_name" >/dev/null 2>&1
        RESULT=$?
        if [ $RESULT -eq 0 ]; then
            echo "Effect started successfully."
        else
            echo "ERROR: Failed to start effect (exit code $RESULT)."
        fi
        exit 0
    fi
done < "$SCHEDULE_FILE"
echo "No effect scheduled to run today."
exit 0

robbiet

Quote from: darylc on December 11, 2025, 09:59:47 PMYou need to call the FPP API to start an effect not /usr/local/bin/fpp.  You might find the simplest way is to create a command preset inside fpp and then call it eg heres a command to call a preset called foo on my dev fpp.

curl http://192.168.33.254/api/command/Trigger%20Command%20Preset/foo
Thanks.  I'm changing my script to call a preset rather than try to run the effect directly.

Support FPP

+- Recent Topics

FPP MIDI plugin installed but wont trigger Playlist by MichaelGilley
January 13, 2026, 04:12:30 PM

SRx4 Long Range Quad SmartReceiver by tbone321
January 13, 2026, 03:32:30 PM

Pixel Port by LedMutt
January 13, 2026, 12:57:46 AM

Peace Stake material by LedMutt
January 12, 2026, 12:15:36 AM

Forbidden Error Port 80 by darylc
January 11, 2026, 10:24:48 PM

LoRa plugin. Is it worth pursuing in 2026 by k6ccc
January 11, 2026, 11:16:25 AM

Analog input by MikeKrebs
January 10, 2026, 10:28:19 PM

2025 Show Video by MikeKrebs
January 10, 2026, 10:20:00 PM

Christmas count down timer by tbone321
January 09, 2026, 07:21:32 PM

DPIPixels-24 lock gpio inputs by CaptainMurdoch
January 09, 2026, 03:17:06 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod