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: 16901
Latest: Mr Tinker
New This Month: 17
New This Week: 2
New Today: 0
Stats
Total Posts: 135508
Total Topics: 16992
Most Online Today: 370
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 187
Total: 187

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

Falcon PiCap not working on FPP 8.3.1 by Poporacer
Today at 05:36:12 PM

Virtual Display not working? by avarrassi
Today at 02:29:34 PM

Interactive Mini golf using FPP? by Bwinter
Today at 09:32:30 AM

Cheap Amazon pixel controller by MikeKrebs
March 23, 2025, 08:10:55 PM

Light Elf Bluetooth IP65 Laser by Kap10G
March 22, 2025, 12:45:02 PM

HA MQTT plugin for single model by s1godfrey
March 20, 2025, 08:21:46 PM

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

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod