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

Hello, thank you for this plugin!

The question may be silly, but I use a RPI3 with Allo Boss DAC and Allo Volt amp. I don’t see any available GPIO anymore. Is there a possibility to connect buttons? How should I do?

Following Allo’s specification, I understand that these pins are used by the Boss: physical pins 3-5-12-27-28-31-35-40 (SDA1-I2C ; SCL1-I2C ; 2S_BCLK ; ID_SD ; ID_SC ; GPIO6/DMUTE ; I2S_LRCLK ; I2S_DOUT).

And then I understand that the Volt uses the outgoing pins from the Boss in addition to physical pins 15-16 (GPIO22 and GPIO23)

The specs are here:

And last question: do you still plan to integrate the support for rotary encoder to control volume?

Thank you very much for your help.

What do you mean “you don’t see any GPIO available anymore”? Where is what missing?

The plugin doesn’t know if other components are using specific GPIO pins. If you try to use the same pins in the plugin you will likely get errors.

I would like to improve the plugin and rotary encoders are definitely on the list of improvements. Unfortunately I do not have the time to improve the plugin at this time. The source is on github and anyone can improve upon it.

Hello, thank you for your quick reply.

I mean that there’s no pin available anymore: the DAC is plugged on the RPI’s pins, and the amp is plugged on the DAC’s pins. Is there a way to use not-used pins anyway? It looks something like this:

and the Volt looks like this:

Oh, the physical pins. I have no experience with those boards. Maybe someone else on this forum knows the answer, or if there is a forum for the specific board?

Thank you, I asked the question there: help-with-gpio-buttons-and-allo-boss-dac-t7354.html#p40452

For the record, @cldebuhr (thank you again) made a perfect answer here: https://community.volumio.com/t/help-with-gpio-buttons-and-allo-boss-dac/6657/5

Hi,

I´m on Pi Zero W with Volumio 2.323 working and want to use GPIO buttons.
I installed the NanoSound Plugin by nanomesher which is based on this GPIO Buttons Plugin.

The buttons are fixed to GPIO 9,10,11,12,13,16.
nanomesher.com/nanosound-gpio-usage/
Buttons GPIO 12,13,16 work like a charme for play/pause, previous and next.

I want to add/replace the function stop, fastforward and rewind to pin 9,10 and 11.

These function still exist in volumio:
volumio stop
volumio seek plus
volumio seek minus

But which files do I have to modify to change the action according the button ?

THX for ur help,
kind regards,
Michael

Hi Michael

As you say the NanoSound Plugin is only based on my plugin. I have never heard of that plugin before - and hence I have no idea how much has been changed. It is a bit hard for me to answer your question.

Do you have the source for the NanoSound plugin?
Did you try to use the GPIO Buttons plugin instead? Or does the NanoSound plugin have some additional functionality?

Regards
tomatpasser

2 Likes

Hi tomatpasser,

thanks for your quick reply, the source could be found here:

github.com/nanomesher/Nanomeshe … mio_plugin

But it would be a great help, if you could explain your plugin - perhaps I can transfer it !
According your plugin (github.com/tomatpasser/gpio-but … io-buttons)

I don´t have a clue how it works :frowning:
Which files are important, where are they placed @volumio ??

UIconfig - seems to be the UserInterface for the plugin
config.json - seems to be the file I need to edit

  • which is the right folder on my pi to place it?
  • what does this file do ?
    example:

“volumeUp”:{
“enabled”: {“value”: false, “type”: “boolean”},
“pin”: {“value”: 18,“type”:“number”},
“value”: {“value”: 0, “type”: “number”}
},

does ist connect GPIO 18 to volumeUp ? Is it pin 18 or GPIO 18 ?

index.js - don´t have a clue what´s this

Thanks for your help,
kind regards,
Michael

Which platform are you on? You should be able to install GPIO Buttons plugin from within volumio. Then you can configure the buttons manually in the config…

I looked at the nanosound plugin. It is basically “GPIO Buttons”, but with the pin numbers hardcoded and added all their OLED and IR remote stuff.
You will probably have problems if you try to use both the NanoSound plugin and the GPIO Buttons plugin, because of conflicts on the GPIO pins they are trying to listen on.

You could try and edit the hardcoding in the NanoSound plugin to your liking.

Hi tomatpasser,

thx for you reply. Have you located the file with the hardcoded gpio in the nanomesher release ?

Where does your plugin store the configuration ?

Kind regards,
Michael

1 Like

In nanosound it is hardcoded in index.is. In my plugin you set it in the UI configuration in volumio, and it is saved in a file read by the plugin.

1 Like

Hi tomatpasser,

Tnx for the great work!
I want to use a pir sensor to play and pause volumio. I’ve connected it to gpio17 and when it’s sees movement it becoms high (3,3v) it plays the volumio en when it’s inactive it becoms low 0v. If there is movement, it becomes high again and volumio pauses.

Is there a possibilaty to change the code so it pauses on a low gpio17 and plays ond a high gpio17?

Hi guys,

I have found a script to use rotary buttons here, it’s for Rpi so near from working in this script.

gist.github.com/savetheclocktow … 2e594d43c1

I think you probably know it thanks to google but if I can remotivate this implementation…

I will have a look.

Hi guys,
Can someone help me customize this plugin for Odroid C2?

Best,
Ralf

I want to built a standalone steampunk webradio. I installed volumio and activated the push button plugin. Everything works fine. I started wiring and testing the buttons, wow so easy. Then the k.o for this system. How can I handle a radio without a posibility to change the radio station ? The prev/next buttons can only be used in the playlist. Are there any plans for an upgrade or is that not an issue?

So here’s the bug I’m seeing:
When I power up volumio, the GPIO buttons don’t work. I have another script I wrote that also uses GPIO buttons, but it is not active (it was for some testing I was doing earlier). If I run the script, then break out of it, the GPIO buttons start working as expected from the plugin. But I have to do this each time I restart the device - SSH in, run my script, break out of my script, and then everything works.
Thoughts?

There seems to be a bug indeed, I just finished the following setup:

Volumio 1.018 running on RPI2 with Waveshare 3.2" LCD Touch screen
Display and Touch function both work OK, after configuration of hardware, drivers and ‘Touch Display’ plugin
To get the three hardware buttons to function on the Touchscreen, I installed plugin: ‘GPIO Buttons (updated 20-6-18)’

RPI has been rebooted, plugin switched to activated.
Configured settings, saved and got a confirmation.
Rebooted again, no working buttons…
Checked settings in /data/plugins/system_controller/gpio-buttons/config.json.
They were not saved correctly by changing the settings and saving them in GUI.
I added the correct GPIO pin numbers for my hardware to the config.json by hand.
Rebooted again.
Still, no buttons…

Contents of my config.json file:

{ "playPause":{ "enabled": {"value": true, "type": "boolean"}, "pin": {"value": 16,"type":"number"}, "value": {"value": 0, "type": "number"} }, "volumeUp":{ "enabled": {"value": false, "type": "boolean"}, "pin": {"value": 18,"type":"number"}, "value": {"value": 0, "type": "number"} }, "volumeDown":{ "enabled": {"value": false, "type": "boolean"}, "pin": {"value": 22,"type":"number"}, "value": {"value": 0, "type": "number"} }, "previous":{ "enabled": {"value": true, "type": "boolean"}, "pin": {"value": 12,"type":"number"}, "value": {"value": 0, "type": "number"} }, "next":{ "enabled": {"value": true, "type": "boolean"}, "pin": {"value": 18,"type":"number"}, "value": {"value": 0, "type": "number"} }, "shutdown":{ "enabled": {"value": false, "type": "boolean"}, "pin": {"value": 3,"type":"number"}, "value": {"value": 0, "type": "number"} } }
Link to Waveshare 3.2" screen product sheet with table of the interface pins:
https://www.waveshare.com/product/3.2inch-RPi-LCD-B.htm

Double. See below.

OK, simple question. I must be doing something wrong. I am trying to get multiple buttons to work, but the max I can get to work is 2, in which one is connected in between GND and GPIO, and one in between 3.3V and GPIO. Because I am working from the header on top of a Allo Piano 2.1 I have limited GPIO pins: only one with a default ‘high’ (GPIO 4). The rest op the available GPIOs is default ‘low’, so I should connect to 3.3V. One button works on 3.3V, but when connecting multiple buttons to 3.3V it does not. What I did was have the 3.3V on a breadboard rail, and connected to two buttons to the rail, and from the buttons back to two GPIOs. What wrong with this? Should I add resistors to get this to work?