[Plugin] GPIO Buttons: Control Volumio 2/ Volumio 3 with buttons

@MarkZ

Please make sure to proper connect your switches.
Just tested the plugin on a rpi5, with 1 button.
Connected the switch between pin GND and GPIO 26. (didn’t test GPIO 17 as this is already used on my system for a rotary encoder)
I guess connecting one lead to 3.3V is not advised.

Hi Wheaton,

Thanks for your reply. Does this work on your install?

No luck with mine, still no response from the player. I have tried closed to ground, pull down and pull up, on several inputs, several functions and multiple reboots, nothing works.

It’s as if the plugin isn’t communicating to the Pi yet it’s installed correctly.

Thanks

MarkZ

Disable the GPIO button plugin.

What is the output of:
gpiomon gpiochip0 17

In my example, on a button press:

gpiomon gpiochip0 5 26
event: FALLING EDGE offset: 26 timestamp: [    1054.652320940]
event:  RISING EDGE offset: 26 timestamp: [    1054.759454654]
event: FALLING EDGE offset: 5 timestamp: [    1056.573904362]
event:  RISING EDGE offset: 5 timestamp: [    1056.704149232]

It’s 0V

Please follow instructions, 0V is not a result from this?

I think I have misunderstood, I’m not familiar with gpiomon, I’ll look it up

Disable the GPIO Button plugin
Just open a ssh connection and copy/paste my command.
gpiomon gpiochip0 17

If this command spits out data without pressing a button, GPIO 17 is already occupied by something else.

if this is the case, also provide the output of:
gpioinfo gpiochip0

Sorry I’ll have to get back to you, for some unknown reason I keep getting a permission denied error with SSH irritatingly I’ve tried three different computers and they all fail, let me sort this out…

How do I enable ssh connection?.
SSH Connection | Volumio Developers Documentation

Thanks normally I have no trouble with SSH except for my Macs security and having to update the known hosts file.

I’d been using SSH on other projects and my pi imager was attempting to save my details.

Volumio credentials on SSH definitely work better. Connection restored.

I am getting a

-bash: gpiomon: command not found

when I try gpiomon gpiochip0 17 from the command line prompt

run:
sudo apt-get update && sudo apt-get install -yf gpiod libgpiod-dev

Thank you, that installed okay and when I run gpiomon gpiochip0 17 I get no output shown.

volumio@volumio:~$ gpiomon gpiochip0 17

and when you press the button?
and the output of
gpioinfo gpiochip0

A single press of the switch gives multiple events

event:  RISING EDGE offset: 17 timestamp: [    4301.852491924]
event:  RISING EDGE offset: 17 timestamp: [    4301.852538221]
event: FALLING EDGE offset: 17 timestamp: [    4301.852661148]
event: FALLING EDGE offset: 17 timestamp: [    4301.852711389]
event:  RISING EDGE offset: 17 timestamp: [    4301.852717908]
event: FALLING EDGE offset: 17 timestamp: [    4301.852723352]
event: FALLING EDGE offset: 17 timestamp: [    4301.852728037]
event:  RISING EDGE offset: 17 timestamp: [    4301.852984688]

this is with the 10K pull down to ground

Here is GPIO Info

gpiochip0 - 54 lines:
	line   0:     "ID_SDA"       unused   input  active-high 
	line   1:     "ID_SCL"       unused   input  active-high 
	line   2:      "GPIO2"       unused   input  active-high 
	line   3:      "GPIO3"       unused   input  active-high 
	line   4:      "GPIO4"       unused   input  active-high 
	line   5:      "GPIO5"       unused   input  active-high 
	line   6:      "GPIO6"       unused   input  active-high 
	line   7:      "GPIO7"       unused   input  active-high 
	line   8:      "GPIO8"       unused   input  active-high 
	line   9:      "GPIO9"       unused   input  active-high 
	line  10:     "GPIO10"       unused   input  active-high 
	line  11:     "GPIO11"       unused   input  active-high 
	line  12:     "GPIO12"       unused   input  active-high 
	line  13:     "GPIO13"       unused   input  active-high 
	line  14:     "GPIO14"       unused   input  active-high 
	line  15:     "GPIO15"       unused   input  active-high 
	line  16:     "GPIO16"       unused   input  active-high 
	line  17:     "GPIO17"       unused   input  active-high 
	line  18:     "GPIO18"       unused   input  active-high 
	line  19:     "GPIO19"       unused   input  active-high 
	line  20:     "GPIO20"       unused   input  active-high 
	line  21:     "GPIO21"       unused   input  active-high 
	line  22:     "GPIO22"       unused   input  active-high 
	line  23:     "GPIO23"       unused   input  active-high 
	line  24:     "GPIO24"       unused   input  active-high 
	line  25:     "GPIO25"       unused   input  active-high 
	line  26:     "GPIO26"       unused   input  active-high 
	line  27:     "GPIO27"       unused   input  active-high 
	line  28: "PCIE_RP1_WAKE" unused output active-high 
	line  29:   "FAN_TACH"       unused   input  active-high 
	line  30:   "HOST_SDA"       unused   input  active-high 
	line  31:   "HOST_SCL"       unused   input  active-high 
	line  32:  "ETH_RST_N"  "phy-reset"  output   active-low [used]
	line  33:          "-"       unused   input  active-high 
	line  34: "CD0_IO0_MICCLK" "cam0_reg" output active-high [used]
	line  35: "CD0_IO0_MICDAT0" unused input active-high 
	line  36: "RP1_PCIE_CLKREQ_N" unused input active-high 
	line  37:          "-"       unused   input  active-high 
	line  38:    "CD0_SDA"       unused   input  active-high 
	line  39:    "CD0_SCL"       unused   input  active-high 
	line  40:    "CD1_SDA"       unused   input  active-high 
	line  41:    "CD1_SCL"       unused   input  active-high 
	line  42: "USB_VBUS_EN" unused output active-high 
	line  43:   "USB_OC_N"       unused   input  active-high 
	line  44: "RP1_STAT_LED" "PWR" output active-low [used]
	line  45:    "FAN_PWM"       unused  output  active-high 
	line  46: "CD1_IO0_MICCLK" "cam1_reg" output active-high [used]
	line  47:  "2712_WAKE"       unused   input  active-high 
	line  48: "CD1_IO1_MICDAT1" unused input active-high 
	line  49: "EN_MAX_USB_CUR" unused output active-high 
	line  50:          "-"       unused   input  active-high 
	line  51:          "-"       unused   input  active-high 
	line  52:          "-"       unused   input  active-high 
	line  53:          "-"       unused   input  active-high 
volumio@volumio:~$

This means that everything act as expected.
Summary:

  • You did a clean install on your rPi5
  • You only installed GPIO Button
  • Key press is properly identified
  • GPIO setting for 17 is OK
  • As soon as you enable GPIO Buttons, with Play on GPIO17, nothing happens.

I’ve tested the same on my rPi5 and it works.

@Darmur
Dario, any suggestion, did I miss a step?

@MarkZ
Can you enable GPIO Buttons, and enable PLAY on GPIO17.
When finished run again:
gpioinfo gpiochip0

Summary:

  • You did a clean install on your rPi5 - Yes using the latest image from Volunio
  • You only installed GPIO Button - Yes
  • Key press is properly identified
  • GPIO setting for 17 is OK
  • As soon as you enable GPIO Buttons, with Play on GPIO17, nothing happens. -Yes

This is my input circuitry:

c8a7ef0d245927957179babbfa1677ec073b9964

I have another M.2 drive with a ‘main’ installation of Volumio including peppy meter, rotary encoder and GPIO control, everything works perfectly other than GPIO buttons. I can only think its a problem with my Pi5 - it was one of the very first available, not sure if RPI updated anything since then.

With GPIO buttons enabled:

volumio@volumio:~$ gpioinfo gpiochip0
gpiochip0 - 54 lines:
line 0: “ID_SDA” unused input active-high
line 1: “ID_SCL” unused input active-high
line 2: “GPIO2” unused input active-high
line 3: “GPIO3” unused input active-high
line 4: “GPIO4” unused input active-high
line 5: “GPIO5” unused input active-high
line 6: “GPIO6” unused input active-high
line 7: “GPIO7” unused input active-high
line 8: “GPIO8” unused input active-high
line 9: “GPIO9” unused input active-high
line 10: “GPIO10” unused input active-high
line 11: “GPIO11” unused input active-high
line 12: “GPIO12” unused input active-high
line 13: “GPIO13” unused input active-high
line 14: “GPIO14” unused input active-high
line 15: “GPIO15” unused input active-high
line 16: “GPIO16” unused input active-high
line 17: “GPIO17” unused input active-high
line 18: “GPIO18” unused input active-high
line 19: “GPIO19” unused input active-high
line 20: “GPIO20” unused input active-high
line 21: “GPIO21” unused input active-high
line 22: “GPIO22” “mute” output active-high [used]
line 23: “GPIO23” unused input active-high
line 24: “GPIO24” unused input active-high
line 25: “GPIO25” unused input active-high
line 26: “GPIO26” unused input active-high
line 27: “GPIO27” unused input active-high
line 28: “PCIE_RP1_WAKE” unused output active-high
line 29: “FAN_TACH” unused input active-high
line 30: “HOST_SDA” unused input active-high
line 31: “HOST_SCL” unused input active-high
line 32: “ETH_RST_N” “phy-reset” output active-low [used]
line 33: “-” unused input active-high
line 34: “CD0_IO0_MICCLK” “cam0_reg” output active-high [used]
line 35: “CD0_IO0_MICDAT0” unused input active-high
line 36: “RP1_PCIE_CLKREQ_N” unused input active-high
line 37: “-” unused input active-high
line 38: “CD0_SDA” unused input active-high
line 39: “CD0_SCL” unused input active-high
line 40: “CD1_SDA” unused input active-high
line 41: “CD1_SCL” unused input active-high
line 42: “USB_VBUS_EN” unused output active-high
line 43: “USB_OC_N” unused input active-high
line 44: “RP1_STAT_LED” “PWR” output active-low [used]
line 45: “FAN_PWM” unused output active-high
line 46: “CD1_IO0_MICCLK” “cam1_reg” output active-high [used]
line 47: “2712_WAKE” unused input active-high
line 48: “CD1_IO1_MICDAT1” unused input active-high
line 49: “EN_MAX_USB_CUR” unused output active-high
line 50: “-” unused input active-high
line 51: “-” unused input active-high
line 52: “-” unused input active-high
line 53: “-” unused input active-high

Mute appeared on GPIO 22 ?

Not sure, I received one from the first batch, which I return in a week due to issues (didn’t like to get powered on). But if there was a random problem, more people would have complained here.

Try to move the wire from GPIO17 to GPIO5 or 6 and see if that makes a difference.

If not lets see if Dario has a suggestion, as I am running out of them.

Yes I’ve never had any issues with any of the pi’s I’ve bought to date, amazing value for money for most projects.

With switch moved to GPIO 5, plugin enabled and play set to gpio5

volumio@volumio:~$ gpioinfo gpiochip0
gpiochip0 - 54 lines:
line 0: “ID_SDA” unused input active-high
line 1: “ID_SCL” unused input active-high
line 2: “GPIO2” unused input active-high
line 3: “GPIO3” unused input active-high
line 4: “GPIO4” unused input active-high
line 5: “GPIO5” unused input active-high
line 6: “GPIO6” unused input active-high
line 7: “GPIO7” unused input active-high
line 8: “GPIO8” unused input active-high
line 9: “GPIO9” unused input active-high
line 10: “GPIO10” unused input active-high
line 11: “GPIO11” unused input active-high
line 12: “GPIO12” unused input active-high
line 13: “GPIO13” unused input active-high
line 14: “GPIO14” unused input active-high
line 15: “GPIO15” unused input active-high
line 16: “GPIO16” unused input active-high
line 17: “GPIO17” unused input active-high
line 18: “GPIO18” unused input active-high
line 19: “GPIO19” unused input active-high
line 20: “GPIO20” unused input active-high
line 21: “GPIO21” unused input active-high
line 22: “GPIO22” “mute” output active-high [used]
line 23: “GPIO23” unused input active-high
line 24: “GPIO24” unused input active-high
line 25: “GPIO25” unused input active-high
line 26: “GPIO26” unused input active-high
line 27: “GPIO27” unused input active-high
line 28: “PCIE_RP1_WAKE” unused output active-high
line 29: “FAN_TACH” unused input active-high
line 30: “HOST_SDA” unused input active-high
line 31: “HOST_SCL” unused input active-high
line 32: “ETH_RST_N” “phy-reset” output active-low [used]
line 33: “-” unused input active-high
line 34: “CD0_IO0_MICCLK” “cam0_reg” output active-high [used]
line 35: “CD0_IO0_MICDAT0” unused input active-high
line 36: “RP1_PCIE_CLKREQ_N” unused input active-high
line 37: “-” unused input active-high
line 38: “CD0_SDA” unused input active-high
line 39: “CD0_SCL” unused input active-high
line 40: “CD1_SDA” unused input active-high
line 41: “CD1_SCL” unused input active-high
line 42: “USB_VBUS_EN” unused output active-high
line 43: “USB_OC_N” unused input active-high
line 44: “RP1_STAT_LED” “PWR” output active-low [used]
line 45: “FAN_PWM” unused output active-high
line 46: “CD1_IO0_MICCLK” “cam1_reg” output active-high [used]
line 47: “2712_WAKE” unused input active-high
line 48: “CD1_IO1_MICDAT1” unused input active-high
line 49: “EN_MAX_USB_CUR” unused output active-high
line 50: “-” unused input active-high
line 51: “-” unused input active-high
line 52: “-” unused input active-high
line 53: “-” unused input active-high