News:

Server migration complete, Welcome to version 2.1.1

+-+-

+-User

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

+-Site Stats

Members
Total Members: 15649
Latest: Androom
New This Month: 0
New This Week: 1
New Today: 0
Stats
Total Posts: 128375
Total Topics: 15784
Most Online Today: 41
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 4
Guests: 22
Total: 26

Script/Plug-In Trigger on Data

Started by Bwinter, January 24, 2023, 12:50:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bwinter

Is it possible to trigger action (ie., GPIO pin) based on whether or not any type of pixel-data is being output (whether it being a playlist playing, a sequence playing, or even display-testing being output)?

I know I can toggle GPIO pins at the start/end of a playlist, by adding the GPIO function to the playlist itself.  But that doesn't handle instances for playing a single sequence or display-testing.

Is there something that can be done (script or plug-in or other?) that can do this automatically anytime something is playing (playlist/sequence/test-data)?

darylc


Aaron Maue

It doesn't do exactly what you want, but here's a bash script I use to determine if something is playing.  You can add your code inside the case statements.  Maybe you can do something with this?

#!/bin/sh
############################################################################
#
# Run scripts based on whether or not FPP is currently playing a sequence of some sort.                       
#
############################################################################

# Get our current status
STATUS=$(/opt/fpp/src/fpp -s | cut -d',' -f2)

# Act on the current status
case $STATUS in
# IDLE
0)
                echo "Not playing."
;;
# PLAYING
1)
                echo "Playing."
;;
# STOPPING GRACEFULLY
*)
echo "Unknown status."
esac

CaptainMurdoch

You could use the PLAYLIST_STARTED/PLAYLIST_STOPPED/SEQUENCE_STARTED/SEQUENCE_STOPPED Command Presets and turn on/off a GPIO in the command.
-
Chris

Bwinter

Quote from: CaptainMurdoch on January 30, 2023, 01:41:47 PMYou could use the PLAYLIST_STARTED/PLAYLIST_STOPPED/SEQUENCE_STARTED/SEQUENCE_STOPPED Command Presets and turn on/off a GPIO in the command.
Correct—that's what I currently do for playlists (and it works fine, as long as I remember to add the command at the start/end of each playlist).

However, it doesn't work when playing a single song/sequence (or anything from display-testing).

So I'm looking for a something a little higher-level, that can be globally set for anytime something is playing

darylc

You misunderstand Chris's suggestion.

Go into the command preset page, in the preset name type PLAYLIST_STOPPED etc, then define what the action is you want to happen.

Bwinter

Ah thanks--I see it now. Seems to be working exactly the way I need!

I've never fully understood what that section was used for, but now it makes perfect sense.

darylc

it doesn't cover all of your use cases (eg display testing) but it gets closer than adding stuff to playlists.

Bwinter

Quote from: darylc on January 30, 2023, 08:40:34 PMit doesn't cover all of your use cases (eg display testing) but it gets closer than adding stuff to playlists.

I did notice that, but I rarely use display testing...so at least having it function for playlist and sequences is sufficient.

My intended use is for a RPI PiCape situation, where I'm operating in Master/Remote mode.  If I set these commands in the Master, would checking the "multi sync" button also trigger the GPIO pins in all the remotes?  Or if not, is there a way to do that?

tbone321

I would bet that you would need to use the "run a remote script" command to do that and then install the GPIO ON and OFF scripts on your remotes to set the desired GPIO's.

darylc

Quote from: Bwinter on January 30, 2023, 09:03:56 PM
Quote from: darylc on January 30, 2023, 08:40:34 PMit doesn't cover all of your use cases (eg display testing) but it gets closer than adding stuff to playlists.

I did notice that, but I rarely use display testing...so at least having it function for playlist and sequences is sufficient.

My intended use is for a RPI PiCape situation, where I'm operating in Master/Remote mode.  If I set these commands in the Master, would checking the "multi sync" button also trigger the GPIO pins in all the remotes?  Or if not, is there a way to do that?

Not sure, you'd need to test it.

Worst cast call a remote trigger preset command thing.

Support FPP

+- Recent Topics

Set Time/Date by jnealand
Today at 08:03:03 AM

Help How I use Orange Pi with FPP by tbone321
February 01, 2023, 02:41:58 PM

No network by Steve_63
January 31, 2023, 08:17:21 PM

F48V4-NS Pixel Controller using all 12 Differential SmartReceiver ports by BirdingPix
January 31, 2023, 02:26:30 PM

F48v4NS - Pi or No Pi? by rjhodgefamily
January 31, 2023, 09:25:20 AM

Trying to configure LOR CF50D Floods on FPP Pi Player with PiCap by JonD
January 31, 2023, 07:01:41 AM

Script/Plug-In Trigger on Data by darylc
January 30, 2023, 11:31:16 PM

Attempting to move to FPP 6.3 from 4.4 - Assigned IP is in different subnet. by Poporacer
January 30, 2023, 05:06:59 PM

Camera input for WS2811's by dkulp
January 30, 2023, 04:02:55 PM

F16v3 Won't boot or power on by rjhodgefamily
January 30, 2023, 02:22:05 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod