Author Topic: GPIO Event Trigger Question  (Read 212 times)

Offline LED Killer

  • Newbie
  • *
  • Join Date: Jul 2018
  • Location:
  • Posts: 3
  • Kudos: 0
GPIO Event Trigger Question
« on: July 09, 2018, 11:33:49 PM »
Using latest Beta 2 (614), I am trying to use a button push to perform a safe shutdown of the pi. What I *HAVE* done so far:


1. Installed Shutdown.sh from the repository
2. Created Event that calls that script
3. Enabled GPIO pin 40 (BCM 21) and enabled a FALLING event to the event created in step 2

4. Manually triggered the event created in step 2 to confirm that the script performs the shutdown task, and it does.
5. Wired a NO switch across pins 39 (GND) and 40 (GPIO 21)


Nothing happens when I press the switch.


What did I miss?

Offline Setarcos

  • Developer
  • ******
  • Join Date: Jan 2015
  • Location: San Jose, CA
  • Posts: 323
  • Kudos: 6
Re: GPIO Event Trigger Question
« Reply #1 on: July 10, 2018, 03:53:49 PM »
Check out the Help section in FPP on GPIO Input Triggers, and peruse the manual here: https://falcon-player.gitbooks.io/falcon-player-manual/chapter_five_inputoutput_setup/gpio_inputs.html It sounds like you are missing the 10k pullup and 1k current limiting resistors.

Offline LED Killer

  • Newbie
  • *
  • Join Date: Jul 2018
  • Location:
  • Posts: 3
  • Kudos: 0
Re: GPIO Event Trigger Question
« Reply #2 on: July 11, 2018, 03:29:43 PM »
Yup, somebody forgot a step. Works like a champ. Thanks for the second set of eyes.

Offline Barnabybear

  • Newbie
  • *
  • Join Date: May 2016
  • Location:
  • Posts: 27
  • Kudos: 0
Re: GPIO Event Trigger Question
« Reply #3 on: July 17, 2018, 07:10:36 AM »
Hi, what step did you forget? I need to do the same thing.
If anyone can offer other advice this would be appreciated as time is not my friend at the moment. I have to put up my mega tree this weekend (21/07/18) for an international scout camp. Unfortunately I on holiday during the camp so someone will need to shutdown the PI with a button at the end of each evening or if the power needs to be disconnected.
 

Offline LED Killer

  • Newbie
  • *
  • Join Date: Jul 2018
  • Location:
  • Posts: 3
  • Kudos: 0
Re: GPIO Event Trigger Question
« Reply #4 on: July 17, 2018, 11:10:56 AM »
The step where one adds the proper resistors to the equation. I used some sub-mini size momentary switches that fit perfectly right above the power connector so there's no excuses but to use them. For the units with black enclosures, I also drilled a hole in the top of the case so you could look inside and see the red and green LEDs. You don't want to disconnect power until the GREEN LED stops flashing completely, which, in my case, is about 10 seconds after you depress the switch.

Of course, if you only need something temporary you can always run the wires out of the box instead of mounting the switch, but personally I don't know why I wouldn't do this with every pi.

Offline Barnabybear

  • Newbie
  • *
  • Join Date: May 2016
  • Location:
  • Posts: 27
  • Kudos: 0
Re: GPIO Event Trigger Question
« Reply #5 on: July 18, 2018, 03:38:16 PM »
 Hi, thanks - that is working a treat and helped me out with the two other buttons I needed, sequence start repeat and sequence stop.
 

Offline Barnabybear

  • Newbie
  • *
  • Join Date: May 2016
  • Location:
  • Posts: 27
  • Kudos: 0
Re: GPIO Event Trigger Question
« Reply #6 on: July 19, 2018, 10:36:57 AM »
Hi, I'll try this here and move to a new thread if needed.
I'm running the 'StartRepeatingPlaylist.sh' which works fine when triggered the play list is played. An unexpected issue is that if you trigger the script a second time it stops playing and clears the playlist from the 'Status page'. Is this an expected outcome? It's worth noting that if you trigger the script a third time the playlist is played again from the start. Thanks for looking.

v1.9-64-g01a080f.

 

Back to top