News:

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

+-+-

+-User

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

+-Site Stats

Members
Total Members: 15699
Latest: Nicole4Z
New This Month: 17
New This Week: 1
New Today: 0
Stats
Total Posts: 128638
Total Topics: 15831
Most Online Today: 56
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 3
Guests: 32
Total: 35

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

Flexible ws2811 panels by Mark_M
March 29, 2023, 09:39:37 PM

Problem with one of my Remotes - syslog always starts with "soliciting.." by Jayl
March 28, 2023, 11:03:41 PM

F48v4-NS unable to connect to WiFi Hotspot by joeyblasko
March 28, 2023, 03:18:46 PM

F/S Arduino UNO R3 with extras by StickyWicket
March 28, 2023, 09:28:23 AM

DMX to pneumatic solenoid by deanathpc
March 27, 2023, 07:54:22 AM

Libre SBC with oled by mel4853
March 24, 2023, 04:04:06 PM

K8-Pi - Random Pixels on by cybercop23
March 24, 2023, 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

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod