Page 1 of 2

Does MightyOhm's radio remember the last station?

Posted: Sat Jun 26, 2010 2:30 am
by ozBillo
Hi,

Quick question.

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

Cheers,
Bill

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

Posted: Tue Jun 29, 2010 9:46 am
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.

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

Posted: Wed Oct 27, 2010 6:50 pm
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?

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

Posted: Thu Oct 28, 2010 8:31 am
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"
#
################################################################

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

Posted: Thu Oct 28, 2010 10:54 am
by pscrzy
Yes I tried turning on the save state file but when I boot the router nothing plays.

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

Posted: Thu Oct 28, 2010 10:57 am
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?

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

Posted: Thu Oct 28, 2010 1:24 pm
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.

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

Posted: Thu Oct 28, 2010 2:46 pm
by mightyohm
What do the contents of ~/.mpd/mpdstate look like? And what are the file permissions?

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

Posted: Thu Oct 28, 2010 7:53 pm
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"
#
################################################################

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

Posted: Thu Oct 28, 2010 9:31 pm
by mightyohm
do an ls -l ~/.mpd/

and a cat ~/.mpd/mpdstate