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: 15696
Latest: st3v3
New This Month: 14
New This Week: 0
New Today: 0
Stats
Total Posts: 128606
Total Topics: 15827
Most Online Today: 42
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 25
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

FPP Install on Raspberry Pi Zero W by k6ccc
March 19, 2023, 07:08:01 PM

Libre SBC with oled by mel4853
March 19, 2023, 12:24:34 PM

Limitations on Video file size? by darylc
March 19, 2023, 02:53:52 AM

DMX to pneumatic solenoid by JerryPlak
March 18, 2023, 05:23:13 AM

F16v3 External Power Connector by darylc
March 16, 2023, 05:25:46 PM

FPP on PC HDMI Output by AlexanderMedia
March 15, 2023, 01:17:55 PM

Orange Pi One and external DS3231 RTC on rtc1 by Arti G
March 13, 2023, 09:29:28 AM

FM transmitters by Poporacer
March 12, 2023, 10:54:39 AM

fpp-videoCapture overwhelms F16v3 by k6ccc
March 10, 2023, 04:21:28 PM

Kulp OctoPlus v2.3 by jnealand
March 10, 2023, 04:08:22 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod