volumio@ohc-speaker:~$ python test_gpio.py
buttons.py - Detect which button has been pressed
This example should demonstrate how to:
1. set up RPi.GPIO to read buttons,
2. determine which button has been pressed
Press Ctrl+C to exit!
Button press detected on pin: 5 label: A
Button press detected on pin: 6 label: B
Button press detected on pin: 16 label: X
initalisiere Shutdown
Button press detected on pin: 6 label: B
Button press detected on pin: 6 label: B
Button press detected on pin: 16 label: X
initalisiere Shutdown
Button press detected on pin: 5 label: A
The difference this time is that after the X button is pressed, I’m able to continue to press other buttons. still no Y button tho…
Button press detected on pin: 5 label: A
Button press detected on pin: 6 label: B
Button press detected on pin: 16 label: X
initalisiere Shutdown
Button press detected on pin: 24 label: Y
Button press detected on pin: 24 label: Y
so, it is back to the link I posted that mentions the Y button is on GPIO 24 but I didn’t understand how to assign the button… I’ll play around some more.
change line 80 in display.py from BUTTONS = [5, 6, 16, 20] to BUTTONS = [5, 6, 16, 24]
change line 436 in display.py from if pin == 20: to if pin == 24:
change line 458 in display.py from for x in [5, 6, 16, 20]: to for x in [5, 6, 16, 24]:
I had already changed line 80 in testing but didn’t venture that far down in display.py
Thank you @AxLED for your support. much appreciated.
In my attempts to free up some GPIO pins by wiring the Pimoroni to the pi rather than plugging it into the pi socket I used this diagram from the web (although I can’t remember where I found it)
yes the plugin should work on pirate audio headphone amp as well.
According to https://pinout.xyz/pinout/pirate_audio_headphone_amp# there are two versions, which use different GPIO for Y Button. So the worst thing could happen, that Y Button is not working (so far).
But here are the good news, i am working on a update for the plugin, where you can choose the GPIO Pin for Y Button via volumio GUI.
thanks for the fast reply. I set up a new volumio with the pirate headphone dac and installed your plugin. Works great! Thanks for your work
Only problem I have found, is that Button Y isn’t working as you mentioned. I have tested the GPIOs with your test_gpio.py and it seems that my hat also uses gpio 24, like the one from @spinkman.
Unfortunately the steps you mention above:
stop pirateaudio plugin via volumio GUI
change directory to path /data/plugins/miscellanea/pirateaudio
change line 80 in display.py from BUTTONS = [5, 6, 16, 20] to BUTTONS = [5, 6, 16, 24]
change line 436 in display.py from if pin == 20: to if pin == 24:
change line in /boot/userconfig.txt from gpio=20=pu to gpio=24=pu
reboot your pi
activate pirateaudio plugin via volumio GUI
doesn’t work for me. I have double checked the lines, but Button Y still doesn’t work after a reboot. Have you any suggestions how i can fix the problem?
did test_gpio.py show 24 for your Y button ?
If yes, try to deactived and activate pirateaudio plugin via GUI (no reboot).
Is there any other hardware attached to the GPIOs?
Which plugins are installed?
@spinkman Aaah thanks! I have missed that line. Thanks a lot.
@AxLED so now the buttons are working well.
I just have the spotify plugin installed. When I use the buttons to navigate to a song in spotify, I can’t play it. So the A button seems to not work here. Is this a known bug oder does this suppose to be working?
as i dont use spotify i couldnt test it.
But i changed the play function in my release anyway. If someone can send me some sample outputs from spotify i could implement this.
Give me some days for the update.
AxLED
@AxLED
Thanks for the info. Since I mainly use Spotify, I’ll take a look at Mopidy. Maybe that is better suited for my project. And I’m switching from volumio to Mopidy. But thanks a lot for your efforts.
Thanks for building this plugin, its great to get the pirate audio up and running on volumio.
I managed to get everything installed and working - however, the volume is very low, much lower than when i had the original software running on the pirate audio. Is there something im missed with the mixer - i have it set to hifiberry dac and software mixer. I need to set it to the high 70s to get any kind of decent volume out…
any help would be really appreciated.
Thanks,
Mark