Falcon Christmas

Falcon Player (FPP) => BeagleBone Black Controllers => Topic started by: pierlux on September 17, 2022, 11:34:01 AM

Title: How to connect a button (via GPIO) to a K16A-B
Post by: pierlux on September 17, 2022, 11:34:01 AM
I'm following these (https://www.instructables.com/Start-Your-Christmas-Light-Show-With-a-Button/) tutorials (https://learn.adafruit.com/connecting-a-push-button-to-beaglebone-black?view=all) on how to connect a button to a GPIO port to trigger events in FPP (such as starting a sequence). 

On the K16A-B there's an I/O EXP connector and I expected to be able to use that to connect my button. Unfortunately I couldn't figure out what GPIO these were connected to – nor did the Zoom room.  

Screen Shot 2022-09-17 at 13.27.50.png

Has anyone been successful at using them? Or would mind pointing me in the right direction? I promise to fully document this once I'm up and running.
Title: Re: How to connect a button (via GPIO) to a K16A-B
Post by: dkulp on September 17, 2022, 12:42:25 PM
At the bottom of the GPIO inputs page, there should be a bunch of pins that start with "pca".   Those are the pins.  8 through 15 are available on the header.
Title: Re: How to connect a button (via GPIO) to a K16A-B
Post by: pierlux on September 17, 2022, 02:36:23 PM
Here's how to start a playlist when a button is pressed.  I striked the original text and made corrections based on comments below.    There also are more detailed diagrams in the FPP Manual, have a look at that too.

1. Material Needed

2. Setup the wiring
Following the circuit in the image below, you will connect the 3.3V pin to your button and the other side of the button to the GPIO pin of your choice (more on where to find the pins below).  When the button is open, the resistor will "pull" the voltage on the GPIO down to 0V by connecting it to the ground.  When the button is closed, +3.3V will travel to the GPIO pin triggering an event in FPP.

circuit.jpg
3. Finding the GPIO pins
On a K16A-B board, the pins are located in the lower left part of the board. The connector is labeled I/O EXP and has +3.3V, G and pins 8-15 available to use as GPIOs.

Screen Shot 2022-09-17 at 13.27.50.png

4. Configure FPP 6.1
In FPP's web interface, go to Input/Output Setup / GPIO Inputs.  At the bottom of the page, you will find entries prefixed with pca. In my case, entry pca9675-15 corresponds to pin 15 on the I/O EXP jumpers.

To play a song when the users releases the button, select Pull UpNone/External in the PULL UP/DOWN combo box. Then select Start Playlist in the COMMAND RISING EDGE combo box. Select a playlist name if you need to.

Restart FPPD and voilà! The button should work.
Title: Re: How to connect a button (via GPIO) to a K16A-B
Post by: dkulp on September 17, 2022, 02:50:09 PM
If you are using an external pull down resistor, you don't want to enable the internal pull up resistor.  

The buttons on the board are wired the other way.   They connect the GPIO pin to ground.   The internal pull up resistor is enabled. (no external resistors).  The buttons don't need the 3.3V at all.   The trigger is on the falling edge then.   
   
Title: Re: How to connect a button (via GPIO) to a K16A-B
Post by: Poporacer on September 17, 2022, 03:25:49 PM
Quote from: pierlux on September 17, 2022, 02:36:23 PMTo play a song when the users releases the button, select Pull Up in the PULL UP/DOWN combo box.
NO! like Dan stated (and it is covered in the FPP Manual) you do NOT want to configure the Pull UP/Down in the interface if you are using external Pull up/Down resistors using both can cause some overcurrent issues to the GPIO pins. The option states None/External and is the option if you are using External resistors. 

Quote from: pierlux on September 17, 2022, 02:36:23 PMThen select Start Playlist in the COMMAND RISING EDGE combo box.
You can actually trigger two events, one for when the button is pressed (in your case rising edge) and another one for when the button is released (Falling edge in your case)

I would be very careful following tutorials for stock BeagleBone or Pi computers. Once another device is connected to them, things can be dramatically different than how they are without the added hardware. But Nice write up! Thanks for the contribution.
Title: Re: How to connect a button (via GPIO) to a K16A-B
Post by: pierlux on September 23, 2022, 05:44:49 PM
Thanks for the input, I'll check that. The thing is that there's just too little information on how to do this with a beaglebone. Woa, I had never opened the FPP Manual as Google only has the 5.0 and 1.x indexed.  There's way more details in there!
Powered by SMFPacks Menu Editor Mod