Posts: 14
Threads: 4
Joined: Dec 2020
Reputation:
2
Hi
I've Moode Audio running on a Raspberry Pi 3 B with a HifiBerry DAC+ Pro
To turn off properly the Pi, I have to use the shutdown menu on Moode Audio web interface
I want to wire a "off" button to the Pi in the GPIO pins, and also, I need the Pi send a pulse or a level to tells an external circuit that's it's OK to disconnect supply from 230V (with a relay)
So, when user push the "off" button, the Pi will shut down and then disconnect from 230V.
(To turn "on" again, the user should switch on the relay to connect power supply - I know how to do that)
Is it possible with Moode Audio ?
Also, I have to select GPIO pins not already used by HifiBerry DAC+ Pro
I find it strange that Raspberry Pi don't give this feature, it's an electronic device without on/off switch
Regards
Posts: 571
Threads: 16
Joined: Apr 2020
Reputation:
23
(03-21-2021, 08:15 PM)electroremy Wrote: Hi
I've Moode Audio running on a Raspberry Pi 3 B with a HifiBerry DAC+ Pro
To turn off properly the Pi, I have to use the shutdown menu on Moode Audio web interface
I want to wire a "off" button to the Pi in the GPIO pins, and also, I need the Pi send a pulse or a level to tells an external circuit that's it's OK to disconnect supply from 230V (with a relay)
So, when user push the "off" button, the Pi will shut down and then disconnect from 230V.
(To turn "on" again, the user should switch on the relay to connect power supply - I know how to do that)
Is it possible with Moode Audio ?
Also, I have to select GPIO pins not already used by HifiBerry DAC+ Pro
I find it strange that Raspberry Pi don't give this feature, it's an electronic device without on/off switch
Regards
The standard Raspberry overlays provides both functions. Requires manual editing of config.txt in the boot partition.
Posts: 14
Threads: 4
Joined: Dec 2020
Reputation:
2
03-22-2021, 03:42 PM
Hi,
I can do the first part (wire a "off" push button)
Here is a GPIO map - We can use pins that are not marked with a red dot :
Please mind that other Hifi DAC can use differents GPIO pins !
Then, turn Raspberry Pi ON
Connect to the PI with SSH :
- Run PuTTY on your computer
- login "pi"
- password "moodeaudio"
Then, open and edit /boot/config.txt ( https://www.makeuseof.com/tag/edit-boot-...pberry-pi/)
- enter "cd /"
- enter "ls"
- enter "cd /boot"
- enter "sudo nano config.txt"
- add a line "dtoverlay=gpio_shutdown,gpio_pin=23"
(I use GPIO 23 that is pin 16 to connect my "off" push button)
NB: verr num key may not work... so that to type numbers and "-" use keys on top of QWERTY
- enter CTRL+X to save
- enter "exit" to close PuTTY
Then shut down the PI with the shutdown menu of the Moode Audio web interface
Thus, you can plug the "off" push button between the pin 16 and ground
When I turn on again the PI, the push button makes the PI shutdown properly
It works also when Moode Audio is playing music.
The first part is done
I have to do the next part : find or generate an electronic signal to said PI is ready to power down - I don't know how to do that...
Regards
Posts: 14
Threads: 4
Joined: Dec 2020
Reputation:
2
Hi,
I find the solution
You juste have to add an other line in the setup.txt file as explained before :
" dtoverlay=gpio-poweroff,gpiopin=25"
Here, I choose the GPIO 25 (connected to pin 22)
Thus, the RPI boot with GPIO 25 set to 0V state
An when shutdown is finished, GPIO 25 is set to 3,3V state
You can connect GPIO 25 to a NPN transistor base with a 10K resistor, to drive a bistable relay reset coil to cut power supply
So to manage power, don't use complex power hat with add-on software
Just add two lines in setup.txt and use a few simple electronic components.
Regards
Posts: 14
Threads: 4
Joined: Dec 2020
Reputation:
2
Hi everybody
I notice that the GPIO "poweroff" pin behavior is a little bit more complex
This is the diagram of my wiring, it's works fine ("BP" are push buttons)
Hope that can helps other people
Regards
Posts: 571
Threads: 16
Joined: Apr 2020
Reputation:
23
Great solution! moOde icw with Pi is a great platform to tinker with .
I use a little variation on this theme; Raspberry Soft Power off in combination with small pcb with a Solid State relay Hereby an led also indicates if the Pi is booting, is booted or is shutting down.
Posts: 37
Threads: 7
Joined: Feb 2021
Reputation:
3
Hi,
Maybe this is not helping a lot, as you seem to want to build your device from scratch (which is perfectly fine), but being a bit of a debutant in the raspberry pi world, and wanting a robust solution for daily use at home, I went for completely built power management HAT; Here is what I tried:
I first used the MSL Digital RemotePi board, which offered also IR remote support for on/off, as well as a pushbutton, and passed lirc commands to the rbp4.
That one worked ok with Moode and a HiFiBerry DAC2 HD.
But something was conflicting or undervoltaged when I added the DSP add-on board (rbpi never booted when I stacked everything, ethernet leds blinking very fast and impossible to ssh on the rbpi).
So I searched and went for the WittyPi3 board, which offers RTC as well as a power pushbutton, but offers also complex ON/OFF schedule rules. This one works perfectly with Moode and the HifiBerry DAC2 HD and DSP add-on. Now I have everything set up and the rbp4 is booting alone at 7AM and shuts down at 23PM everyday (I didn't experiment more complex schedule, but one could have this during five working days, then different for weekends, and even have a week different than the next one, the schedule script is quite robust for this).
On another setup used for osmc, I use an Argon On Fan Hat in combination with an X-862 for Sata SSD and a HiFiBerry DAC+ DSP. This Fan HAT also has a power pushbutton, aswell as a fan that one can set up the speeds / t° curve or configuration. Very handy too, but this one just manage to initiate a soft shutdown, a reboot and a boot up, but does not completely cuts power (PWR red led constantly on after power off).
Hope that this can help you, or someone seeking such solution and have no clue, at least this is my feedback :-)
All the best,
Greg
Posts: 1,538
Threads: 106
Joined: Mar 2018
Reputation:
73
Quote: Very handy too, but this one just manage to initiate a soft shutdown, a reboot and a boot up, but does not completely cuts power (PWR red led constantly on after power off).
Greg.....If you then hold the power button down for the count of three or more on the rear of the Argon-One case the power is cut completely and the Led is no longer lit.
----------
bob
Posts: 37
Threads: 7
Joined: Feb 2021
Reputation:
3
Hi Drone7,
Thanks for the advice. I'll try this.
But I don't have the Argon-one case, just the fan HAT ( https://www.argon40.com/argon-fan-hat-fo...i-3-b.html), which has its own button. Anyway, thanks :-).
btw, I wonder why they did put a female GPIO terminal on both sides of the hat, this lengthen uselessly the connection to the next hat (in my case HiFiBerry DAC+ DSP); not a big deal, but wonder why this is so...
All the best,
Greg
Posts: 1,538
Threads: 106
Joined: Mar 2018
Reputation:
73
04-19-2021, 08:30 AM
(This post was last modified: 04-19-2021, 08:32 AM by DRONE7.)
Seems the fan-hat and Argon-one case use the same power scripts...:-)
and as for the gpio length this might explain it....(from their site)
Quote:Provides enough space for a heat sink to be used on the chips of the Raspberry Pi board
and presumably any further stacked HAT's ?
cheers,
Bob
----------
bob
|