Hi all.
I seem to have tried and failed to get a single on off push-button setup to work with my Pi3B+ and IQaudio PiDigiamp+. I can not use the usual Pi on/off GPIO pins as these are used by the HAT.
Can someone tell me if the shut down power off button within Volumio does fully shut down the Pi and leave it in a safe state to shut off the power.
I have noticed that the mute light on the Digiamp stays off when shutting down from within Volumio. When I power off and back on again the mute light is on until the program is loading and then turns off. Could this indicate that the method of shutdown I am using is not leaving the Pi in a safe state to switch off the power?
If it is in a safe state at that point then I will continue to shut down using that method and to re-start I can use a push button and small relay to interupt the power supply and prompt a re-boot.
You can use pin 24 and it’s adjacent pin. Put a 5k ohm resistor in circuit with connection shutdown button. Just load the GPIO plugin and link pin 24 to the shutdown of the rpi. No sw to write or load all just a menu pick.
Hi.
Thanks cmullen for the reply.
I think at present pin gpio 24 is set up as one of the rotary encoder pins, so I think that would need removing/disabling first. I do not intend to use a rotary encoder. The other problem I have is getting both startup and shut down on the same pins so that I can use a single pushbutton. At the moment I have soldered wires to the normally used pins for startup, i.e. ground and gpio3 (physical pin numbers 5&6) and this works o.k. I then tried to use gpio3 in the gpio plugin to shut down Pi but it did not work. Would gpio 24 work like this? Any ideas
A rotary knob and shutdown switch hardware can both monitor and react or not to the same pin. Therefore I believe you can link the shutdown command with the GPIO plugin with pin 24 and it’s adjacent power pin (remember resistor). IQaudio has great email tech support so you can check with them.
You don’t have a “power on” GPIO pin. You must power fail (cycle on/off) to reboot the rpi. I found a simple micro USB power cable with a simple on/off switch or for the IQaudio amp+ splice in an on/off switch in power supply cable.
Download and checkout GPIO plugin before you mess with pins to see this approach.
Hi.
I should explain. I have built my hardware into a box and all I want on the front panel is the push button ( which has an led in it)
I have installed a rocker switch on the back which can turn on/off the power supply to the Pi and hat.
At the moment I can put the Pi into safe sleep mode by using the power off tab in Vollumio. I can wake it up again by pressing the push button on the front panel which closes gpio pins 3 and ground. I have soldered wires directly to the board to achieve this.
In safe sleep mode I can kill the power supply with the rocker switch and then reboot the pi by switching it back on.
So far so good.
But I would like to use the push button to put the Pi to sleep safely as well as wake it again.
I know that this has been done by others but at the moment I am out of my depth on the subject of writing files etc. to the operating system.
Hi.
Thanks for the reply.
I have re-installed the plugin and set shutdown to the same pin that wakes from sleep (gpio3) and it works perfectly
Many thanks for the help.
Hang on though! All is not well. After putting Pi to sleep and waking it again using the push button I found I had no sound. Everything looks as if it is playing - track progress, vollume control etc. but no sound output. The only way I could sound back was to disable the plugin, power off and restart.
I am baffled. Must be a clash somewhere with the pin usage of the Pi Digiamp hat.
i have now soldered wires directly to gpio pin 26 and ground. Have set this in the gpio plugin in volumio but not working.
Have I misunderstood the pin usage and should I in fact use pin26 and 3v3 not ground.
If pin 26 is not suitible There are other unused pins I could use instead. If I get this working I have a double pole push button which I can use to wake up Pi ( gpio3 and ground) and also send Pi to sleep using 26 (or other) and ground or 3v3, whichever is correct.
I found a post where somebody had a similar problem in losing sound when trying to use gpio3 to shut down Pi.
UPDATE
I have just down what I should have done in the beginning. I have read and understood the difference between pull up and pull down on gpio pins.
I have now connected across gpio 26 and 3v3 for my shut down pushbutton. Wake stays as gpio 3 and ground. I configured the button plugin and it works perfectly.
Manny thanks for the help.