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: 15698
Latest: kronescharles
New This Month: 16
New This Week: 2
New Today: 0
Stats
Total Posts: 128629
Total Topics: 15828
Most Online Today: 51
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 21
Total: 21

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

Libre SBC with oled by mel4853
Today at 04:04:06 PM

K8-Pi - Random Pixels on by cybercop23
Today at 10:44:49 AM

Limitations on Video file size? by Jayl
March 23, 2023, 11:06:14 AM

FPP 7 Kubernetes Error by Jlwright325
March 22, 2023, 11:11:59 AM

FPP Install on Raspberry Pi Zero W by k6ccc
March 21, 2023, 05:53:50 PM

FPP install script on Ubuntu, no video by AlexanderMedia
March 21, 2023, 09:37:23 AM

DMX to pneumatic solenoid by JerryPlak
March 20, 2023, 01:03:53 PM

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

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod