11-13-2020, 03:02 PM
Hi,
I have ordered an audio streamer from Audiophonics which is planned to run Moode. The device embeds an ATX-like power supply & management board (https://www.audiophonics.fr/en/raspberry...11504.html). Some scripts are required for the board to get the state of the system (booting, application running, rebooting, shutting down...) in order to handle a front panel system status LED and properly cut the power off after the system is halted.
My concern is about monitoring the hardware power button when the system is running (button pressed = shutdown request) and handling a clean shutdown of moode.
A basic solution is to lauch a script during boot that periodically polls the relevant GPIO input pin to checks wether the power button is depressed. This is what Audiphonics suggests with a period of 0.25s. The Moode "GPIO button handler" does the same and could be used for the same purpose.
An more "modern" approach is suggested which uses overlay :
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=0,gpio_pull=down in boot/config.txt (customized for Audiophonics hardware)
Q1 : Should this alternative be preferred as it might be implemented more efficiently deeper into the system ?
Q2 : Does this solution gracefully shutdown Moode ? (when shutdown is handled through the Moode interface, mpd and nginx are stopped before poweroff)
Q3 : Is there a way using the overlay approach to have a script executed (which would cleanly shutdown the system instead of only issuing a shutdown) when a transition occurs on the GPIO input pin ?
Q4 : Apart from stopping mpc an nginx, are there other (background) processes to take care off (such as music library indexing) when shutdown is requested outside the Moode user interface ?
(I am a newbie with overall IT culture but poor Pi and Linux knowledge)
Thank you for the tremendous work (I will make a donation as soon as my future system is running !)
Kind regards.
Philippe
I have ordered an audio streamer from Audiophonics which is planned to run Moode. The device embeds an ATX-like power supply & management board (https://www.audiophonics.fr/en/raspberry...11504.html). Some scripts are required for the board to get the state of the system (booting, application running, rebooting, shutting down...) in order to handle a front panel system status LED and properly cut the power off after the system is halted.
My concern is about monitoring the hardware power button when the system is running (button pressed = shutdown request) and handling a clean shutdown of moode.
A basic solution is to lauch a script during boot that periodically polls the relevant GPIO input pin to checks wether the power button is depressed. This is what Audiphonics suggests with a period of 0.25s. The Moode "GPIO button handler" does the same and could be used for the same purpose.
An more "modern" approach is suggested which uses overlay :
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=0,gpio_pull=down in boot/config.txt (customized for Audiophonics hardware)
Q1 : Should this alternative be preferred as it might be implemented more efficiently deeper into the system ?
Q2 : Does this solution gracefully shutdown Moode ? (when shutdown is handled through the Moode interface, mpd and nginx are stopped before poweroff)
Q3 : Is there a way using the overlay approach to have a script executed (which would cleanly shutdown the system instead of only issuing a shutdown) when a transition occurs on the GPIO input pin ?
Q4 : Apart from stopping mpc an nginx, are there other (background) processes to take care off (such as music library indexing) when shutdown is requested outside the Moode user interface ?
(I am a newbie with overall IT culture but poor Pi and Linux knowledge)
Thank you for the tremendous work (I will make a donation as soon as my future system is running !)
Kind regards.
Philippe