[SOLVED] RaspDAC OLED & Power management w/Moode 6.7.1 - 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: [SOLVED] RaspDAC OLED & Power management w/Moode 6.7.1 (/showthread.php?tid=3215) Pages:
1
2
|
RE: RaspDAC OLED & Power management w/Moode 6.7.1 - JuanJB - 01-05-2021 (01-04-2021, 08:37 AM)JuanJB Wrote: In fact I'm exploring this line just now. The code is simple so it should be easy to translate it using Phyton based GPIO library. Hi, I have flashed a new Moode_R6.7_RaspDacMini image downloaded from https://mega.nz/file/gBpBCapQ#yagnsjvpH034LFa_gKV5V0yQZ4wigzfaHbhXZLuEUio As python3 is installed here, I have “translated” the power management scripts into python. My setup is as follows: 1.- dtoverlays for GPIO17 and GPIO22 included in /boot/config.txt 2.- softshutdown.py launched from /var/local/www/comandw/restart.sh on “poweroff” 3.- softreboot.py launched from /var/local/www/comandw/restart.sh on “restart”. This was not used previously but it allows to make SPC-II board to react (via GPIO4) also to a restart from moode UI. 4.- sds.py is finally not used (and not tested also). I think that it is not needed. Everything works well with this setup, I think. I have e-mail also to Audiophonics. They told me they are looking for a solution, hopefully in the near future. Maybe mine could help. Please see also https://github.com/audiophonics/Raspberry-pwr-management Here you have the scripts: sds.py (not used in my setup, as I said before) Code: #!/usr/bin/python3 softshutdown.py Code: #!/usr/bin/python3 softreboot.py Code: #!/usr/bin/python3 Best regards Juan RE: RaspDAC OLED & Power management w/Moode 6.7.1 - chano22000 - 01-05-2021 Hi Juan JB, The only interest of not using the following overlay for GPIO pin 22 (but keeping one for GPIO pin 17 to handle the power button) Code: dtoverlay=gpio-poweroff,gpiopin=22,active_low and keep part of sds.sh : Code: #!/bin/bash is to have BootOK active (= power led to stop blinking) when Moode is ready and not just when boot is finished. Thank you for your Python version I will use when moving forward to Moode 7(.1 !) since WiringPi is deprecated (I still run Moode 6.7.1 on a Pi 3B+) Regards. Philippe RE: RaspDAC OLED & Power management w/Moode 6.7.1 - JuanJB - 01-05-2021 Hi Philippe, Thanks for your suggestion. I have tested your sds (translated to python, removing the overlay for GPIO22) and it works but I have a remark: the button led stops blinking anyway before Moode is ready. About 10-15 seconds before. It is possible to let both, Moode and led, to arrive at the same time to finish line by setting a sleep time in sds.py before putting GPIO22 to 1. I know this is not, let's say, an elegant solution, but it works. It would be perfect to have a catchable signal indicating that Moode is ready. The script could then wait until this signal arrives and then put GPIO22=1. You're welcome. Feel free to use/modify/improve the scripts. Regards Juan RE: RaspDAC OLED & Power management w/Moode 6.7.1 - TheOldPresbyope - 01-05-2021 (01-05-2021, 08:12 PM)JuanJB Wrote: ... Check out Tim's post from yesterday. Regards, Kent RE: RaspDAC OLED & Power management w/Moode 6.7.1 - JuanJB - 01-09-2021 (01-05-2021, 08:24 PM)TheOldPresbyope Wrote:(01-05-2021, 08:12 PM)JuanJB Wrote: ... Thank you @TheOldPresbyope. I'm not very skilled in python so it took to me a little to translate the command from @Tim Curtis (thank you too) into python statements. But finally I did. Now the button finishs blinking only when MoOde is really ready. The script is launched from /etc/rc.local by adding, before exit 0, at the end of rc.local script: python3 /home/pi/sds.py & This is my new sds.py script Code: #!/usr/bin/python3 Regards, Juan RE: RaspDAC OLED & Power management w/Moode 6.7.1 - audiophonics - 01-21-2021 I made an updated all-in-on script that avoid to deal with 3 files. I also included the SQL verification before initializing Boot ok. Thanks you all for supporting our product. https://github.com/audiophonics/Raspberry-pwr-management/blob/master/spc_moode.py RE: RaspDAC OLED & Power management w/Moode 6.7.1 - JuanJB - 01-24-2021 (01-21-2021, 04:55 PM)audiophonics Wrote: I made an updated all-in-on script that avoid to deal with 3 files. I also included the SQL verification before initializing Boot ok. Nice script. Thank you @audiophonics |