Moode Forum
[IDEA] Autoplay MusicRadioStation after disconnect - Printable Version

+- Moode Forum (http://moodeaudio.org/forum)
+-- Forum: moOde audio player (http://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (http://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] Autoplay MusicRadioStation after disconnect (/showthread.php?tid=1849)



Autoplay MusicRadioStation after disconnect - TheClaw - 10-26-2019

Hi, there!
I'am from Germany and thats my first Post, and yes I love Moodeaudio.  Heart
First time i tried Volumio Rolleyes , but its to unstable for me.

My Idea
Problem: If Wlan disconnects, because Firmware Update, Internet disconnects or something other, the last played Radiostation will be not Autostart.
So it would be nice to have a feature do that auto. So the Radio plays continuously without hands.


RE: Autoplay MusicRadioStation after disconnect - TookaFace - 10-26-2019

Hey, one way to do that is to write a script in /etc/network/if-up.d/

It will trigger every time internet is up. With mpc you can do what you want.


RE: Autoplay MusicRadioStation after disconnect - Tim Curtis - 10-26-2019

Interesting, I didn't know that feature existed :-)


RE: Autoplay MusicRadioStation after disconnect - TheOldPresbyope - 10-26-2019

(10-26-2019, 02:33 PM)Tim Curtis Wrote: Interesting, I didn't know that feature existed :-)

Isn't the motto of Linux "Oh, yeah, that's in there too."


RE: Autoplay MusicRadioStation after disconnect - TheClaw - 10-28-2019

Hi and thx for Input,

i found this on a German Forum:

Code:
#!/bin/bash

mpc clear
sleep 2
mpc random off
mpc consume off
sleep 2
mpc load "Favorites"
sleep 10
mpc play

exit 0

 Added to /etc/network/ip-up.d
It's works manually, but NOT when I restart the Wifi connection. I have no clue  Confused


RE: Autoplay MusicRadioStation after disconnect - TookaFace - 10-28-2019

(10-28-2019, 05:43 PM)TheClaw Wrote: Hi and thx for Input,

i found this on a German Forum:

Code:
#!/bin/bash

mpc clear
sleep 2
mpc random off
mpc consume off
sleep 2
mpc load "Favorites"
sleep 10
mpc play

exit 0

 Added to /etc/network/ip-up.d
It's works manually, but NOT when I restart the Wifi connection. I have no clue  Confused

Try with #!/bin/sh instead #!/bin/bash

And chmod 755 on your script.

EDIT: It seems it only work when physical interface is activated (like pluging RJ45 cable, or activating wifi), but not reconnection.
So not good for your need.