![]() |
How to set-up GPIO output status - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: How to set-up GPIO output status (/showthread.php?tid=5489) |
How to set-up GPIO output status - recce - 04-09-2023 Hello, I kindly ask your help to try a function I'd like to activate on Raspberry, possibly using MoodeAudio. I need to set a GPIO pin or Raspberry 3B as "System Startup Event" so that one GPIO pin status goes ON at startup and OFF at shutdown. This because I need to set 2 LEDs On and Off when Moode is On and Off, the status of that Pin (GPIO 17) is read by an auxiliary board and drives the LEDs The producer of the board suggest a way but only using Volumio (see the attachment). Can someone kindly suggest me if it's possible using MoodAudio (I've not found such a function) or a different way to set GPIO pin as System Startup Event ? Thank you very much !! Enrico RE: How to set-up GPIO output status - recce - 04-10-2023 Hello, I've done it by writing the following code in /boot/config.txt: dtoverlay=gpio-poweroff,gpiopin=17,active_low If someone has some comments about that or there is a better way to reach the result, please let me know. Thank you very much for your upcoming suggestion. RE: How to set-up GPIO output status - Tim Curtis - 04-10-2023 You could try a little hacking. Add these 3 echo lines to the beginning of /var/www/daemon/watchdog.sh like below. Code: . Add these 3 echo lines to the beginning of the if block in /var/local/www/commandw/restart.sh Code: . RE: How to set-up GPIO output status - recce - 04-10-2023 Thank you Tim, I'll try shortly and give a feedback. RE: How to set-up GPIO output status - recce - 04-10-2023 Hi Tim, your code works very good, better than my solution. Thank you. My solution worked well but there is a problem: after shutdown, I'm not able to use other GPIO pin as input (for example the restart function). I don't know why but at the moment I have no time to investigate and also you provided a perfect solution. Moreover, with your code, GPIO 17 turns ON just when MoodeAudio gests ready for music, and not before... perfect. Thanks again. Enrico |