Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Autoplay MusicRadioStation after disconnect
#1
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.
Reply
#2
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.
Reply
#3
Interesting, I didn't know that feature existed :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
(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."
Reply
#5
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
Reply
#6
(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.
Reply


Forum Jump: