Auto start MPC playing a Wifi Radio

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

Auto start MPC playing a Wifi Radio

Post by mcc253 »

Hi,

I've recently transformed my Asus 520gu into a wifi radio receiver, thanks to MightyOhm tutorial.

Everytime I reboot or power off, the router losts all the radio links and volume settings which I have added to mpc.
My question is if is there some way to save my prefered wifi radios links and everytime I power on or reboot, the router auto start with mpc playing my favourite wifi radio with for example 90% volume.

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

Re: Auto start MPC playing a Wifi Radio

Post by gerben »

add the stations to the mpc. Then save the playlist using

Code: Select all

mpc save a-name-for-playlist
then load this station, and set the volume on startup by editing /etc/init.d/mpd. And the end of the start section (after the line containing /usr/bin/mdp) add the following

Code: Select all

/usr/bin/mpc repeat on
/usr/bin/mpc volume 90
/usr/bin/mpc load a-name-for-playlist
mcc253
Posts: 10
Joined: Mon Mar 05, 2012 4:48 pm
Location: Portugal

Re: Auto start MPC playing a Wifi Radio

Post by mcc253 »

Many many thanks for your reply. It's working thanks to you :)

I've added in mpd the line commands:
/usr/bin/mpc repeat on
/usr/bin/mpc volume 90
/usr/bin/mpc load myplaylist
/usr/bin/mpc play 1

(I've added one more line "/usr/bin/mpc play 1" to auto-start with the first wifi radio of the playlist).

Just one more question. After the line containing "/usr/bin/mdp" I had this lines which I deleted and wrote over with previous the command lines given by Gerben. The lines were:
#generate playlist and start to play
/usr/bin/mpc listall | /usr/bin/mpc add -
/usr/bin/mpc play
/usr/bin/mpc repeat

Any problem to delete this lines?

One more time, many thanks for your help Gerben.
User avatar
gerben
Posts: 164
Joined: Sat Oct 16, 2010 8:41 am
Location: Netherlands

Re: Auto start MPC playing a Wifi Radio

Post by gerben »

Removing those lines is not a problem.
And you're welcome.

Shameless plug: Check out my other scripts. Maybe you find them useful.
viewtopic.php?f=2&t=247
viewtopic.php?f=2&t=448
mcc253
Posts: 10
Joined: Mon Mar 05, 2012 4:48 pm
Location: Portugal

Re: Auto start MPC playing a Wifi Radio

Post by mcc253 »

Very interesting scripts. For now I will try to use the sleep function and also the Web Interface. I'm using MPoD for Iphone and it's working, but I will use your Web interface to use it on my pc.

I have some doubts where to add the code for sleep function, but I will post my questions for you in that specific topic :)

Many thanks once again Gerben.
Post Reply