Controlling mpd using the SES/AOSS/EZ-SETUP button

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
mcc253
Posts: 10
Joined: Mon Mar 05, 2012 4:48 pm
Location: Portugal

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by mcc253 » Sat May 05, 2012 6:58 am

Gerben, I'm sorry to disturb you again.

I've tested today and I've noticed that the sound stops after 30 min of inactivity even without pressing the ez-button for that propose (with the code which you previously have sent me to do that).
I would like the router to play continuous all the time without turning off the volume after 30 min of inactivity (except of course when I press the button to enable the sleep function of 30 min which you gave me the code to be able to do that).
Can you help me changing this?

Other doubt. I know that MPD for OpenWRT don't play the streaming .ASX files or .AAC. Do you know if there is any update that enables the MPD to play Wifi Radios based on this Microsoft ".ASX" or Apple ".AAC" file formats?

Once more, many thanks for your precious help.

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by gerben » Sat May 05, 2012 12:05 pm

Please double check that you made all the changes I provided here: viewtopic.php?f=2&t=247&start=10#p2976 Specifically the lines with touch "/tmp/lastradioinput"
Also make sure you remove "/tmp/lastradioinput". It could be that that file was still there from before you made those changes, which would result in sleep being triggered.

Try changing the value of 1800second in check-sleep to something a smaller while testing. That way you don't have to wait half an hour to see if it's working.

Let me know how it goes.


For AAC you'll need a newer version of MPD I think. Other people on this forum have got it working, so do a search for AAC on this forum. Not my expertise. As for ASX, I'm doubtful, but again, not my expertise.

mcc253
Posts: 10
Joined: Mon Mar 05, 2012 4:48 pm
Location: Portugal

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by mcc253 » Sun May 06, 2012 4:55 pm

Gerben, once more many thanks for your help.

Problem solved. It was the "lastradioinput" file. Removed and all is working now as it should.

Regarding the ".AAC" extension by what I've searched (it was a quick search), in my 520-GU it's not possible to read it yet due memory limitations.

Now I would like to implement your code of the topic " viewtopic.php?f=2&t=448 " , to be able to call the web page from my Iphone. Although I would like to add a Virtual button to this code with this sleep function, so asking you for help again :) Is that possible?

If you prefer I can post it in that topic.

Many thanks!

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by gerben » Mon May 07, 2012 8:11 am

Glad you got it working.

To get the newer version of MPD you could try installing it to an external thumb drive as described here viewtopic.php?p=5264#p5264

Sleep function is possible in the web interface. I would suggest your try to modify mpc.js and /www/cgi-bin/mpd yourself first. Since this feature is depending on some of the other code on your router, I'm a bit reluctant to add it, since it won't work for other people. I would have to fork the code.

yura.lesn
Posts: 7
Joined: Wed Aug 08, 2012 12:30 pm

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by yura.lesn » Sun Sep 09, 2012 2:28 am

Hi there!
very interesting scripts.
Thanks a lot, Gerben for posting them!!!
i want to ask about switching stations, as i would like to use it.
as i got from the discussion tht was here i will need only 3 files that are :
/root/buttonpressed.sh
/root/buttonreleased.sh
/etc/hotplug.d/button/01-radio-control
the only thing i have to change is in file /root/buttonpressed.sh all links to file /root/mympc.sh change just to mpc.
after creating everyone in exact directories,do i have to use chmod ugo+x for every file?
If i am wrong please,do tell me, cause i'm newbie in scripts. :geek:

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by gerben » Sun Sep 09, 2012 5:18 am

You kind of need mympc.sh too. As mpc doesn't support playnext and playprev. My playnext will start playback if not yet playing, and select the next station if already playing.
But you could replace "/root/mympc.sh playnext" with "mpc next;mpc play".
Playprev is not that critical, so just replace "/root/mympc.sh playprev" with "mpc prev".

You are correct in that you need to chmod every .sh-file

good luck.

Jatt
Posts: 1
Joined: Sun Nov 18, 2012 8:43 pm

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by Jatt » Sun Nov 18, 2012 8:53 pm

Hi i am newbie i just want to use red EZ button to control start playing, stop and next stream in my playlist, i just copied to thre code of 3 files 01-radio-control , buttonpressed and buttonreleased and saved the files as .sh, after that what i need to do i did not understand , i log in using the winscp and where i need to copy these files. after what eles i need to do, please if anyone can give step by step directions in detail , i really appreiate that, thanks you .

User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Controlling mpd using the SES/AOSS/EZ-SETUP button

Post by gerben » Mon Nov 19, 2012 4:33 am

Most files go into the home folder, so "/root/"; except for 01-radio-control, which goes into "/etc/hotplug.d/button/"

You'll need to copy these files:
  • /root/buttonpressed.sh
  • /root/buttonreleased.sh
  • /root/mympc.sh
  • /root/show-preset.sh
  • /root/flash-led.sh
  • /etc/hotplug.d/button/01-radio-control
The files should start with "#!/bin/sh ...", so don't copy the first 3 lines from the code block in the forum post.

Also make sure you make the scripts executable by using chmod

If you have any more questions, just let me know (,but please spend a little more time checking what you typed, as your question is riddled with typos :-) )

Post Reply