News:

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

+-+-

+-User

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

+-Site Stats

Members
Total Members: 16897
Latest: 1492
New This Month: 13
New This Week: 1
New Today: 0
Stats
Total Posts: 135488
Total Topics: 16988
Most Online Today: 168
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 79
Total: 79

GPIO Button Input enabled by scheduler

Started by bdoljac, December 27, 2022, 10:10:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

darylc

Quote from: Aaron Maue on January 02, 2023, 08:06:18 PMIf it's not too much to ask, I'd love to see some sample code that interacts with the API.  I have a different use case, but I'm not skilled enough to know how to start.  With an example, and the help of Google/YouTube, I usually can hack my way through things.
http://192.168.33.236/api/command/Insert%20Random%20Item%20From%20Playlist/playlistname

bdoljac

Thank you darylc for sharing, I really appreciate it, unfortunately I can't see it, I think the link is local.
Would you be so kind and paste the code please?

Best regards Branko 

CaptainMurdoch

If you are still wanting to enable/disable the gpio input via the scheduler, you can try running a script that calls the 'fpp' command to switch the gpio pin from input to output.  If it is set to output, then any button presses should be ignored until you run the fpp helper again to set it back to an input.

/opt/fpp/src/fpp -G GPIO_NUMBER Output
/opt/fpp/src/fpp -G GPIO_NUMBER Input

/opt/fpp/src/fpp -G 17 Output
/opt/fpp/src/fpp -G 17 Input

The case is sensitive on the Input/Output keywords.  The GPIO_NUMBER is the number on the FPP GPIO Input config page.
-
Chris

Aaron Maue

Quote from: darylc on January 02, 2023, 10:41:09 PM
Quote from: Aaron Maue on January 02, 2023, 08:06:18 PMIf it's not too much to ask, I'd love to see some sample code that interacts with the API.  I have a different use case, but I'm not skilled enough to know how to start.  With an example, and the help of Google/YouTube, I usually can hack my way through things.
http://192.168.33.236/api/command/Insert%20Random%20Item%20From%20Playlist/playlistname

Awesome.  Thanks!!  I assume that all of the "%20" escape characters are intentional and should be part of the line?

k6ccc

Quote from: Aaron Maue on January 03, 2023, 02:16:09 PMI assume that all of the "%20" escape characters are intentional and should be part of the line?

Yes.  That's what spaces become in a url.
Using LOR (mostly SuperStar) for all sequencing - using FPP only to drive P5 and P10 panels.
My show website:  http://newburghlights.org

Jim

darylc

Quote from: bdoljac on January 03, 2023, 12:10:39 PMThank you darylc for sharing, I really appreciate it, unfortunately I can't see it, I think the link is local.
Would you be so kind and paste the code please?

Best regards Branko
I guess I should have explained that it was an example of an API call that you can put in a script. You replace that IP address with the IP address of your FPP and that it will start playing a random item from a playlist.

bdoljac

#21
CaptainMurdoch thank you very much for your help. This is what I was looking for. As this is my first script for falcon, please confirm or correct my understanding. To set the pin to input I need to create .sh file with the  lines:

#!/bin/sh

/opt/fpp/src/fpp -G GPIO_NUMBER Input

/opt/fpp/src/fpp -G 17 Input



For set the pin to output

#!/bin/sh

/opt/fpp/src/fpp -G GPIO_NUMBER Output

/opt/fpp/src/fpp -G 17 Output



Please confirm or correct me.

I would like to understand the thing in more detail,  /opt/fpp/srcis this the path or API call?
I was trying to find the fpp -G GPIO_NUMBER Output in API help but I didn't find it, is this command from source files or class?

Best Regards, Branko

bdoljac

darylc thank you for the explanation it was needed.

Best Regards, Branko

Support FPP

+- Recent Topics

PixelOverlay-Clock - Revisited Again by jnealand
March 18, 2025, 06:00:53 PM

PixelOverlay-Clock.php works but I have questions... by datajack
March 18, 2025, 04:38:32 AM

Backup Feature not functional by efamlights
March 16, 2025, 11:58:28 AM

WS2811, Raspberry Pi 5, GPIO, could not initialize. by Ulysse-srfc24
March 16, 2025, 05:07:48 AM

K16A-B Issue by nolatron
March 15, 2025, 01:52:26 PM

F16V5 and SRx1 v5 by jkp
March 15, 2025, 07:19:44 AM

Differential Board: PSU & Enclosure by hakko808
March 14, 2025, 09:17:01 AM

FPP 8.4 Back up by Jradical
March 13, 2025, 05:38:18 AM

FPP on Pi5 won't start with "FPPD boot delay" set to 2 min or higher by dnapier65
March 12, 2025, 05:39:00 PM

OBJ File in Sketchup by dspenman
March 11, 2025, 09:19:08 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod