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: 15697
Latest: ejrich83
New This Month: 15
New This Week: 1
New Today: 1
Stats
Total Posts: 128620
Total Topics: 15828
Most Online Today: 52
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 2
Guests: 34
Total: 36

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

FPP 7 Kubernetes Error by Jlwright325
Today at 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

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

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

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod