Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[SOLVED] Automatically starting a webradio stream at start up
Thank you for your donation

Pages (2): « Previous 1 2
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Solved: Automatically starting a webradio stream at start up
6th Sep, 2013, 10:02 PM
Post: #16
Skywatch Offline
Registered
Posts: 1,018
Joined: Mar 2013
Reputation: 28
RE: Automatically starting a webradio stream at start up
You could build or buy a relay board with timed on/off relay delays. This is how it is done in the por audio installation field. That's the only way I can see this being done in hardware. For the software solution there are more clever people here than me!

Skywatch
Find all posts by this user
Quote this message in a reply
7th Sep, 2013, 12:43 AM
Post: #17
f1vefour Offline
Administrator
******
Posts: 1,342
Joined: Mar 2013
Reputation: 58
Re: Automatically starting a webradio stream at start up
This is a hack but I tested it and it works.

First do this:

Terminal

sudo mv /usr/local/lib/xbmc/xbmc.bin /usr/local/lib/xbmc/xbmc

Then copy this linked file to /usr/local/lib/xbmc/ and run this:

http://db.tt/tf3uaUIL

Terminal

sudo chmod +x /usr/local/lib/xbmc/xbmc.bin

The contents of the downloaded file:

Code:
#!/bin/sh
IP="206.190.36.45"
COUNT=10

until [ $COUNT -lt 1 ]; do
    ping -c 1 $IP > /dev/null
    if [ $? -eq 0 ]; then
       echo "network up"
       /usr/local/lib/xbmc/xbmc --standalone
       break
    else
       echo "network down"
    fi
    let COUNT-=1
    sleep 1
done

Note: XBMC will fail to start if the network is totally down. The IP address used is yahoo.com (what we used back when I was an ISP tech).

To undo do this:
Terminal

sudo rm /usr/local/lib/xbmc/xbmc.bin
sudo mv /usr/local/lib/xbmc/xbmc /usr/local/lib/xbmc/xbmc.bin

Please read rules and do a search before you post! | FAQs | How to post log file? | Can't find an answer? Contact us.
Visit this user's website Find all posts by this user
Quote this message in a reply
8th Sep, 2013, 01:37 AM
Post: #18
pacmyc Offline
Registered
Posts: 13
Joined: Aug 2013
Reputation: 0
RE: Automatically starting a webradio stream at start up
(7th Sep, 2013 12:43 AM)f1vefour Wrote:  This is a hack but I tested it and it works.

First do this:

Terminal

sudo mv /usr/local/lib/xbmc/xbmc.bin /usr/local/lib/xbmc/xbmc

Then copy this linked file to /usr/local/lib/xbmc/ and run this:

http://db.tt/tf3uaUIL

Terminal

sudo chmod +x /usr/local/lib/xbmc/xbmc.bin

The contents of the downloaded file:

Code:
#!/bin/sh
IP="206.190.36.45"
COUNT=10

until [ $COUNT -lt 1 ]; do
    ping -c 1 $IP > /dev/null
    if [ $? -eq 0 ]; then
       echo "network up"
       /usr/local/lib/xbmc/xbmc --standalone
       break
    else
       echo "network down"
    fi
    let COUNT-=1
    sleep 1
done

Note: XBMC will fail to start if the network is totally down. The IP address used is yahoo.com (what we used back when I was an ISP tech).

To undo do this:
Terminal

sudo rm /usr/local/lib/xbmc/xbmc.bin
sudo mv /usr/local/lib/xbmc/xbmc /usr/local/lib/xbmc/xbmc.bin

Hi. Thanx, that might work but it feels a little bit dangerous. Also,
I'd like to be able to boot XBMC even if the internet connection is down.

What about putting only "sleep 60" for example in the file instead of the loop and the ping command? That would give the router and the modem 1 more minute to connect than before, right?
Find all posts by this user
Quote this message in a reply
8th Sep, 2013, 08:46 AM
Post: #19
f1vefour Offline
Administrator
******
Posts: 1,342
Joined: Mar 2013
Reputation: 58
RE: Automatically starting a webradio stream at start up
COUNT=60 would be a minute.

Please read rules and do a search before you post! | FAQs | How to post log file? | Can't find an answer? Contact us.
Visit this user's website Find all posts by this user
Quote this message in a reply
13th Sep, 2013, 03:49 AM
Post: #20
pacmyc Offline
Registered
Posts: 13
Joined: Aug 2013
Reputation: 0
RE: Automatically starting a webradio stream at start up
Solved it by putting a 10 second long silent mp3 in the same directory with the .m3u file.
Then I rewrote the m3u as follows;

http://streamadress:80/myStream.mp3
Silent10sSong.mp3

http://streamadress:80/myStream.mp3
Silent10sSong.mp3

http://streamadress:80/myStream.mp3
Silent10sSong.mp3

http://streamadress:80/myStream.mp3
Silent10sSong.mp3

http://streamadress:80/myStream.mp3


This gives the network additional 40 seconds to get ready, which works perfectly in my case.
Thanx anyway for your comments and tips..
Find all posts by this user
Quote this message in a reply
13th Sep, 2013, 01:48 PM
Post: #21
f1vefour Offline
Administrator
******
Posts: 1,342
Joined: Mar 2013
Reputation: 58
Re: Automatically starting a webradio stream at start up
Thanks for posting your solution. Glad you got it resolved.

Please read rules and do a search before you post! | FAQs | How to post log file? | Can't find an answer? Contact us.
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Pages (2): « Previous 1 2
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 10th May, 2025, 04:01 AM Powered By MyBB, © 2002-2025 MyBB Group.