Thank you for your donation!

Instruction Guide Modding moOde: Switching amps

as I already posted some time ago my "moOde mod" for switchin amps in the old thread I updated this to the latest version (moOde 4.2 07-19-2018)

With the modified files I have  an additional "Amplifier" menu entry . I am using two amps which can be switched On/Off from here.
This happens by two relais connected to the GPIO connectors (I am using a cheap China relais platine for this - connected to GPIO 23 and 24).

Additionaly the amp gets switched off, when music is paused, stopped or muted for more than 5 minutes.
They are switched on again (last amp selection) when the music is resumed.

To use this mod, the attached files have to be replaced and two additional settings have to be added to the moode-sqlite3.db:

insert into cfg_system VALUES(100, amp-1, Off);
insert into cfg_system VALUES(101, amp-2, Off);

The amps name and description of the amps are hardcoded in the footer.php file.
The used GPIOs are set in the file

Maybe it is usefull for others, too.
Download Link


added Dropbox link

Attached Files Thumbnail(s)
Hi Hans,

I remember this nice mod :-) I was going to try and integrate it and offer it as an option but never got to doing it.

Are you trying to add zip files and how large are they?

Hi Tim,

I tried, *.zip, *.tar *.txt - even renaming the achive to *.jpg isn't possible.
The size is quite small - 55kB.

This forum software is quite clever :-)
(07-22-2018, 09:47 AM)Highsider Wrote: Hi Tim,

I tried, *.zip, *.tar *.txt - even renaming the achive to *.jpg isn't possible.
The size is quite small - 55kB.

This forum software is quite clever :-)

Maybe use a cloud service like DropBox, Google Drive, Microsoft OneDrive?
Never used Dropbox & co. before.
But thanks for the hint... Dropbox is quite easy to register.
Download link is added at first posting
Hi Hans,

Just a heads up that the next moOde update will likely have some new cfg_system rows starting at 100 (there are already 99 rows. Just to be safe I would recommend starting at 200 otherwise the update will will not be able to insert the new rows.

delete from cfg_system where id='100';
delete from cfg_system where id='101';
insert into cfg_system values (200, amp-1, Off);
insert into cfg_system values (201, amp-2, Off);

Hi Tim,

thank you for the information - i supose, it would have cost me quite some time to figure this out after next update :-)
Hi guys,

@Highsider: Sorry for hijacking your thread. (Reithalle und Stall, wo die Raspis überall arbeiten :-)

my solution for switching the amplifier is using the popular SONOFF-Wifi-devices with the great Tasmota-Firmware . In my case the Sonoff will power up the Raspberry-Pi and the amplifiers simultaneously. After shutting down MoodeAudio the Sonoff will switch the power off with a delay of 20 seconds. In this time period the RaspberryPi has gone down safely.

/var/local/www/ Wrote:...
if [[ $1 = "poweroff" ]]; then
curl -s "http://SONOFF.IP/cm?user=admin&password=secret&cmnd=Backlog%20Delay%20200;Power%20off"
mpc stop
systemctl stop nginx

Maybe there is a way to combine multiple solutions for switching the amps in MoodeAudio`s webinterface.

In Tasmota`s webinterface you can build a link to Moodeaudio by adding the red line to xdrv_01_webserver.ino and recompile it.

xdrv_01_webserver.ino Wrote:  "<br/><form action='up' method='get'><button>" D_FIRMWARE_UPGRADE "</button></form>"
  "<br/><form action='cs' method='get'><button>" D_CONSOLE "</button></form>"
  "<br/><form action='http://YOUR.IP'><button class='button bgrn'>MoodeAudio</button></form>";


Attached Files Thumbnail(s)
Hi there

This Mod looks very nice Smile I would really like to implement this in my MoOde player. Should i replace all the files with yours from the Dropbox folder to implement/install this? Would I then have to create a new build with that "Stretch" like from the download section on Could I use the automated builder for this or is there a guide anywhere on how to do this please? Not quite sure how it works without the automated builder...

My plan is to use this for a mute function that always pulls a pin when the music is paused (Link to other thread)

Regards Mikkel

Forum Jump: