Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Junior Member
    Join Date
    May 2022
    Posts
    9

    piCorePlayer with Auto start LMS

    I use the Auto start tweaks of the piCorePlayer and with Auto start LMS and "playlist play https://st01.sslstream.dlf.de/dlf/01/high/aac/stream.aac" the stream is played after each start of the piCorePlayer.
    This works fine.
    Unfortunately the Auto start does not work when I start my Debianserver with Logitech Media Server in the morning using the Wake-on-LAN (WoL) of my piCorePlayer. Here the piCorePlayers seems to boot too fast and the Logitech Media Server is not online yet.
    [ INFO ] pcp_auto_start_lms.log: not Connected...
    Is there a way to delay the command "playlist play..." a bit, so that first the Logitech Media Server is online and then the Auto start LMS is executed?
    Maybe via the "User commands"?

    User command #1: sleep 30
    User command #2: "playlist play..."
    Does not work like this

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    5,331
    Why not put LMS on the piCorePlayer ?



    ronnie

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    5,331
    Or maybe run a crontab job on the piCorePlayer to restart it after the LMS is up

    Code:
    @reboot sleep 30 && /sbin/reboot
    I don't know if this is the correct command, or that, if it would work, that it will work

    ronnie

  4. #4
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Hello Ronnie,
    thank you very much for the advice.
    I will try the crontab job.
    The picoreplayer is running with a hifiberry dac on a raspberry 2b.
    This is a bit too weak for a large music collection.

  5. #5
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,624
    Does the normal Linux method not work?

    Code:
    sleep 20; playlist play
    EDIT: Stupid suggestion! I was thinking of User commands
    Last edited by Greg Erskine; 2022-10-07 at 16:22.

  6. #6
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Quote Originally Posted by Greg Erskine View Post
    Does the normal Linux method not work?

    Code:
    sleep 20; playlist play
    Of course, that would be the simplest solution.
    I just tested it under Auto start LMS and unfortunately it does not work.
    I can save the command successfully but it shows no reaction. Also no message in the logs anymore

  7. #7
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,624
    Sorry, another one of my stupid suggestions.

    Obviously, LMS Auto Start has to be LMS CLI commands. I was thinking about User commands.

    Next stupid suggestion: User commands

    Code:
    sleep 20; pcp play
    might restart the last playlist

  8. #8
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Quote Originally Posted by Greg Erskine View Post
    Sorry, another one of my stupid suggestions.

    Obviously, LMS Auto Start has to be LMS CLI commands. I was thinking about User commands.

    Next stupid suggestion: User commands

    Code:
    sleep 20; pcp play
    might restart the last playlist
    Thanks for the tip. That works.
    But I'm still looking to be able to listen to my stream (https//st01.sslstream.dlf.de/dlf/01/high/aac/stream.aac) via auto start in the morning after switching on.
    Any more idea?

  9. #9
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,624
    hi ferdicharms,

    Here's an idea that might work?

    This script submits a LMS command via the function pcp_lms_start_command with a sleep command included.

    This script should be run from a User Command ie. /home/tc/delaystart.sh

    Code:
    #!/bin/sh
    
    #========================================================================================
    # Delayed start
    #----------------------------------------------------------------------------------------
    
    . /var/www/cgi-bin/pcp-functions
    . /var/www/cgi-bin/pcp-lms-functions
    
    DELAY=2
    LMSCOMMAND="playlist play https://st01.sslstream.dlf.de/dlf/01/high/aac/stream.aac"
    DELAYSTARTLOG="pcp_delay_start_lms.log"
    
    echo "Delayed start: $DELAY"
    sleep $DELAY
    
    echo "LMS command: $LMSCOMMAND" > ${LOGDIR}/${DELAYSTARTLOG}
    pcp_lms_start_command "$LMSCOMMAND" >> ${LOGDIR}/${DELAYSTARTLOG}
    You could, if you wanted, remove the delay from the script and add the delay to the front of the User Command: ie sleep 10; /home/tc/delaystart.sh

    regards
    Greg

  10. #10
    Junior Member
    Join Date
    May 2022
    Posts
    9
    Quote Originally Posted by Greg Erskine View Post
    hi ferdicharms,

    Here's an idea that might work?

    This script submits a LMS command via the function pcp_lms_start_command with a sleep command included.

    This script should be run from a User Command ie. /home/tc/delaystart.sh

    Code:
    #!/bin/sh
    
    #========================================================================================
    # Delayed start
    #----------------------------------------------------------------------------------------
    
    . /var/www/cgi-bin/pcp-functions
    . /var/www/cgi-bin/pcp-lms-functions
    
    DELAY=2
    LMSCOMMAND="playlist play https://st01.sslstream.dlf.de/dlf/01/high/aac/stream.aac"
    DELAYSTARTLOG="pcp_delay_start_lms.log"
    
    echo "Delayed start: $DELAY"
    sleep $DELAY
    
    echo "LMS command: $LMSCOMMAND" > ${LOGDIR}/${DELAYSTARTLOG}
    pcp_lms_start_command "$LMSCOMMAND" >> ${LOGDIR}/${DELAYSTARTLOG}
    You could, if you wanted, remove the delay from the script and add the delay to the front of the User Command: ie sleep 10; /home/tc/delaystart.sh

    regards
    Greg
    Hi Greg,
    that's it! Great! So it works quite wonderfully with a delayed start. My piCorePlayer wakes up my Debianserver via wol and 60 seconds later the stream starts automatically.
    Fantastic. Thanks a lot.
    I'm a beginner in Linux and still have a small problem that I can't solve:
    I had to make the script executable with "chmod +x /home/tc/delaystart.sh". Only then it worked.
    But now that the script is executable, I can't change anything in the script (e.g. change the stream).
    Every change to the script is gone after a reboot and the first version is executed.
    How can I change the script after I made it executable with chmod +x?
    Or was "chmod +x" a mistake and I have to do it differently?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •