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: 15733
Latest: aquila2heman
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 128997
Total Topics: 15888
Most Online Today: 150
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 3
Guests: 113
Total: 116

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

colorlight 5a-75b not working with raspberry pi4B fpp by Kensington Graves
Today at 10:09:36 AM

Multi Channel Audio by dkulp
Today at 09:30:24 AM

Wifi help by dkulp
June 04, 2023, 12:24:56 PM

MMAL error 2 "ENOSPC" by MikeKrebs
June 03, 2023, 09:34:36 PM

Dmx by MikeKrebs
June 03, 2023, 08:53:35 PM

F48V4-NS at 40 fps using all 48 pixel output ports? by MikeKrebs
June 02, 2023, 09:36:11 PM

EEEPROM Files by shanebou24
June 01, 2023, 01:27:06 PM

Kulp OctoPlus v2.3 by MikeKrebs
May 31, 2023, 10:03:21 PM

Weird latency over artnet by MikeKrebs
May 30, 2023, 09:50:12 PM

Discontinued P10 1/2 Scan Panel Issues by MikeKrebs
May 30, 2023, 09:40:30 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod