GPIO Pins to control volume

The code looks really promising, but I was never able to get it to work on my system that uses un Raspberry Pi Zero W. It was only able to show the volumio logo. In the end, it only inspired me to write my own code.

Hi, would you share it ?

I have tried volumio-buddy as well to drive a little Oled screen but it wonā€™t work because of some dependencies not installed correctly (I think). thanks

Hi guys, anyone tried this plugin for rotary encoder ?
volumio-plugins-collection-t6251-20.html#p43781

I didnā€™t managed to get it working.
The button doesnā€™t react, rotation is doing erratic volume level.
I will try Hardware debouncing as advised.

If Saiyato can read thisā€¦

If you pull the latest version, you shouldnā€™t experience any misfires.
That being said, volume control could be better, Volumio is quite slow to react on the new volume pushes.

I did find that the button push stopped working for some command, definitely not for all. If youā€™re experiencing problems, please deliver as much info as you can gather, I canā€™t debug much, based on ā€˜doesnā€™t workā€™, e.g. maybe the wrong PIN was configured. You can enable some extra logging to help you identify the problem. :wink:

Hi Saiyato,

Yes, of course I will give you some more information, I understand that my last message canā€™t help, It was just to verify that itā€™s the good place to talk.

So, I did some tests.

and the log says :
2018-03-09T14:19:24.837Z - info: [Rotary encoder] Encoder #1 button pressed; press state = pressed
2018-03-09T14:19:24.930Z - info: [Rotary encoder] Encoder #1 rotated right
2018-03-09T14:19:24.945Z - info: [Rotary encoder] Encoder #1 rotated left
2018-03-09T14:19:25.135Z - info: [Rotary encoder] Encoder #1 button pressed; press state = pressed
2018-03-09T14:19:25.368Z - info: [Rotary encoder] Encoder #1 button pressed; press state = pressed
2018-03-09T14:19:26.229Z - info: [Rotary encoder] Encoder #1 button pressed; press state = pressed

So, itā€™s not a problem of GPIO config
I think itā€™s a hardware problem. I have maybe 1 meter between rpi and rotary encoder plugged by a RJ45 cable

When I watch log I understand that I have 2 or 3 rotation logged instead of only one physically done. Iā€™ve soldered 0,22uF capacitors because I didnā€™t have 0,1uF, is it that ?

When I push the button, itā€™s possible to have 10 or 15 repetition of the toggle play/pause, I need to unplug rotary encoder to stop that.
A bouncing effect, ok, I can understand, but 10-15 timesā€¦

I will try to plug rotary encoder with small cables.

Thanks for your help !

Hi,

How did you install the plugin? Because I just noticed I missed a commit two weeks ago.
If you installed the plugin using the CLI or drag-and-drop, it shouldā€™ve worked fine. If you installed using the GUI (search plugins), I think you should reinstall and try again.

Howeverā€¦ I noticed another bug, the switch is rendered useless if you save a configuration, it needs a restart of volumio to work properly again.
Iā€™ve patched and uploaded the fix, but Iā€™m awaiting Volumio to approve it (thereā€™s a lot of patches in my PR now).

Hi Saiyato,

I think you have found the problem, I installed it by GUI because I thought that your first corrective was commited by volumio dev in rev368.
So, when I can, i will reinstall it and come back here.

Thanks !!

Hi,

I just added a lazy install script for unsanctioned versions in the repo.

WOuah !! great !

Iā€™ve just seen that before coming here. just a lazy install :wink:
So, rotary encoder works with volume. Thank you for your job !!
I invite every people who want a rotary encoder installing your plugin.

Iā€™ve just a problem with button, changed GPIO pin, it works andā€¦stopped working.

What iā€™ve done :
Test GPIO before : 3,3V
plug it.
Test GPIO : 3,3V
push the button : It works
Push 2, 3 times : It donā€™t work
Test GPIO : 0V
After reboot, the same.

Is there a problem to plug switch pin directly to GPIO pin without capa or resistor? i think itā€™s only a switcher.
I hope i didnā€™t burnt those pins
I tried to use pintest from wiringPi but not found it where it should be. find command give nothing.

Ai caramba, that doesnā€™t sound good. Iā€™ve not experienced problems switching GPIO pins.
I do however use 5V instead of 3.3V

Yes, Iā€™m affraid of that :neutral_face:

I downloaded pintest utility from wiringPi package, but no problem detectedā€¦

I struggled with using a cheap KY040 rotary encoder using the rotary encoder plug-in with all sorts of spurious changes to volume and button presses. I didnā€™t want to de-bounce the switch in hardware, so created the very simple python script below which I launch at boot time. Does the job and uses approx 1% CPU on a Pi 3

script.png

I have installed a cheap rotary encoder. the gui .ma plugin does not work. It is very irregular. I turn the volume up and after two clicks instead of getting up, it goes down again. I see that encoder has 3 resistors on its board. but I have heard of condenser between clk and gnd. e possible? tell me how to do in a week the khadas tone board arrives and I would like the volume control to work

Is it possible to turn off and on again using the button without removing power?

I was under the impression that you could use GPIO 13 to the SW of the encoder and via the plugin for the rotary encoder using the drop down activate the SW so that it would do something? I have had no success with that, good luck and hope you have success. I have been able to control the volume but nothing else happens

Is this still working? want to add a rotary encoder to my project for volume control.

Is the plugin on volumio app is working?

GPIO_buttons plugin works like a charm, I am using it daily

On a Raspberry Pi 4 that i have, i been looking for buying some GPIO wire to do some customizing. What is a good wire gauge to get to use.

24 awg stranded is easy to work with and rugged enough for hobbyists.