Does MightyOhm's radio remember the last station?

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
User avatar
ozBillo
Posts: 8
Joined: Sat Jun 26, 2010 2:24 am
Location: Melbourne, Australia

Does MightyOhm's radio remember the last station?

Post by ozBillo »

Hi,

Quick question.

Does the MightyOhm wifi radio remember the last station it was playing if it's switched off?

Cheers,
Bill
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Does MightyOhm's radio remember the last station?

Post by mightyohm »

No, because it reads the position of the tuning dial to set the station every time you reboot.

You can change this behavior by editing /etc/mpd.conf and turning on the save state feature.
pscrzy
Posts: 7
Joined: Sat Oct 23, 2010 6:53 pm

Re: Does MightyOhm's radio remember the last station?

Post by pscrzy »

I tried turning this on but I'm not sure If it does what I want. Is there any way to play a station when the router boots up automatically?
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Does MightyOhm's radio remember the last station?

Post by mightyohm »

If you follow my tutorial, the radio will read the position of the tuner knob and start playing automatically every time you turn it on. At least that is how it should work.

If you're not using the tuning knob and my shell scripts, then create a script that runs at boot and plays a stream. Or turn on the mpd state_file setting and mpd will resume playing the stream you last played when it starts up at boot.

Look in /etc/mpd.conf

Code: Select all

######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
pid_file                        "~/.mpd/mpd.pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
#state_file                      "~/.mpd/mpdstate"
#
################################################################
pscrzy
Posts: 7
Joined: Sat Oct 23, 2010 6:53 pm

Re: Does MightyOhm's radio remember the last station?

Post by pscrzy »

Yes I tried turning on the save state file but when I boot the router nothing plays.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Does MightyOhm's radio remember the last station?

Post by mightyohm »

pscrzy wrote:Yes I tried turning on the save state file but when I boot the router nothing plays.
Is mpd being launched on startup?

Did you have a stream playing with the radio was turned off or rebooted?

Have you checked if the state file exists?
pscrzy
Posts: 7
Joined: Sat Oct 23, 2010 6:53 pm

Re: Does MightyOhm's radio remember the last station?

Post by pscrzy »

Yes I set it to start up and I know that works. I leave a station on but when it boots up, nothing plays.
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Does MightyOhm's radio remember the last station?

Post by mightyohm »

What do the contents of ~/.mpd/mpdstate look like? And what are the file permissions?
pscrzy
Posts: 7
Joined: Sat Oct 23, 2010 6:53 pm

Re: Does MightyOhm's radio remember the last station?

Post by pscrzy »

######################## OPTIONAL PATHS ########################
#
# If you wish to use mpd --kill to stop MPD, then you must
# specify a file here in which to store MPD's process ID.
#
#pid_file                        "~/.mpd/mpd.pid"
#
# If specified, MPD will save its current state (playlist,
# current song, playing/paused, etc.) at exit.  This will be
# used to restore the session the next time it is run.
#
state_file                      "~/.mpd/mpdstate"
#
################################################################
User avatar
mightyohm
Site Admin
Posts: 1064
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Does MightyOhm's radio remember the last station?

Post by mightyohm »

do an ls -l ~/.mpd/

and a cat ~/.mpd/mpdstate
Post Reply