Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 75
  1. #11
    Junior Member
    Join Date
    Aug 2020
    Posts
    10
    -C option on the squeezelite page was active.
    After deactivating it, the script does as expected:

    "Power on/off" the player in LMS does reliably lead to my speakers being powerd on/off.

  2. #12
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,008
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  3. #13
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    6,614
    Quote Originally Posted by paul- View Post
    That's correct, it works well on a 4, not as good on the older versions. But I see now you said 4, so that works fine..... BUT
    Please read the notes on that github page. As when turning off the power on the pi ports, it will kill more than one USB port, and in some boards all of the USB ports.

    I've added uhubctl.tcz to our repo. Download it from the extension page

    Paul
    Is uhubctl.tcz available in pCP7? I can't find it but I am probably missing something being a piCorePlayer newbie.

    Sent from my Pixel 3a using Tapatalk

  4. #14
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,008
    Iĺll get it on the todo list. Should get it this weekend.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  5. #15
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    6,614
    Quote Originally Posted by paul- View Post
    Iĺll get it on the todo list. Should get it this weekend.


    Sent from my Pixel 3a using Tapatalk

  6. #16
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,008
    uhubctl posted.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #17
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    6,614
    Quote Originally Posted by paul- View Post
    uhubctl posted.
    Thanks for posting it Paul. I was about to post that I couldn't get it working on my Pi 3B but it turns out that the info posted here
    https://github.com/mvp/uhubctl#raspberry-pi-b2b3b
    is incorrect. It states that all the USB ports on the Pi3B are linked together and controlled by Port 2. In fact they are controlled separately and turning off port 2 does not turn off ports 2-5. Turning off port 4 works for me.

  8. #18
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    6,614
    Quote Originally Posted by slartibartfast View Post
    Thanks for posting it Paul. I was about to post that I couldn't get it working on my Pi 3B but it turns out that the info posted here
    https://github.com/mvp/uhubctl#raspberry-pi-b2b3b
    is incorrect. It states that all the USB ports on the Pi3B are linked together and controlled by Port 2. In fact they are controlled separately and turning off port 2 does not turn off ports 2-5. Turning off port 4 works for me.
    Hmm my commands work when I ssh into the pCP but not from the script. I am putting
    -S /home/tc/usb-power-on-off.sh
    in Various Options on the Squeezelite settings page. My script file is
    Code:
    #!/bin/sh
    #----------------------------------------------------------------------------------------
    # Script for turning RPi3 USB output on/off when Squeezelite player is turned on/off.
    # This script requires that extension uhubctl.tcz is installed.
    # Enter the path to this "Power On/Off Script" on the pCP Squeezelite Settings page.
    # https://github.com/mvp/uhubctl#raspberry-pi-b2b3b
    #----------------------------------------------------------------------------------------
    # squeezelite -S /home/tc/usb-power-on-off.sh
    # 
    # squeezelite sets $1 to:
    #	0: off
    #	1: on
    #----------------------------------------------------------------------------------------
    
    case $1 in
        0) uhubctl -l 1-1 -p 4 -a 0 >/dev/null 2>&1 ;;
        1) uhubctl -l 1-1 -p 4 -a 1 >/dev/null 2>&1 ;;
    esac
    Any idea what I am doing wrong?

  9. #19
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,008
    Likely need to reference the full path to the binary.

    /usr/local/sbin/uhubctl
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  10. #20
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    6,614
    Quote Originally Posted by sisiko View Post
    Following the cited thread, I created the following script file:

    Code:
    #!/bin/sh
    #----------------------------------------------------------------------------------------
    # Script for turning RPi4 USB output on/off when Squeezelite player is turned on/off.
    # This script requires that extension uhubctl.tcz is installed.
    # Enter the path to this "Power On/Off Script" on the pCP Squeezelite Settings page.
    # https://github.com/mvp/uhubctl#raspberry-pi-4b
    #----------------------------------------------------------------------------------------
    # squeezelite -S /home/tc/usb-power-on-off.sh
    # 
    # squeezelite sets $1 to:
    #	0: off
    #	1: on
    #	2: initialising
    #----------------------------------------------------------------------------------------
    
    case $1 in
        0) uhubctl -l 2 -a 0 >/dev/null 2>&1 ;;
        1) uhubctl -l 2 -a 1 >/dev/null 2>&1 ;;
        2) uhubctl -l 2 -a 1 >/dev/null 2>&1 ;;
    esac
    also copied it in the folder /home/tc and linked it in the pCP Squeezelite Settings page under "Power On/Off Script".

    Here is what it does for me:

    "Play" powers up my speakers and plays music.
    "Pause" pauses the music and leads to my speakers being shut down.

    "Power on/off" the player in LMS does not reliably lead to my speakers being power on/off.

    Using the "uhubctl -l 2 -a 0 >/dev/null 2>&1" "/ uhubctl -l 2 -a 1 >/dev/null 2>&1" command loged in my piCorePlayer via SSH always works as expected.

    1. I am fine with "Play/Pause" causing my speakers to turn on/off but I expected this solution to work with "Power on/off" in LMS.
    2. "2: initialising": do I really need that line in my script or can I leave it out?
    Hi sisiko, I have modified your script to work with my Pi3 but while the power on/off commands work via an ssh connection to pCP I cannot seem to get the script to do anything. Any ideas how to troubleshoot this?

Tags for this Thread

Posting Permissions

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