Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 29
  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927

    Installing extra packages on piCorePlayer

    Not sure which forum I should ask this in: here, 3rd party software, DIY?

    Anyhow, I'm setting out on a project to develop a plugin that will toggle a GPIO pin on a pi running piCorePlayer.
    This is to replicate the behaviour of the old PowerSwitchII plugin on SB2/SB3/TP, to drive a relay to switch amps on/off.

    To do this I'll need to install some additional packages to get access to the GPIO pins.
    On Raspbian, I'd apt-get install them, but this isn't available on the TinyLinux that piCoreplayer uses.

    How do I go about installing additional packages into a piCorePlayer system?
    Or is there some other way to access the GPIO pins in TinyLinux?
    Transporter -> ATC SCM100A

  2. #2
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,934
    You could do all that with a shell script. But assuming you want python. It is available, as well as the python rpio package.

    Take a look at the extension page from the main menu.

    If you don't find what you are looking for, ask. We don't package everything, but alot of commonly used stuff is there.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  3. #3
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,175
    piCore/Tiny Core uses Extensions, see pCP GUI [Main page] > [Extensions].

    This kind of thing has already been done many times.

    You can access GPIO directly from userspace or use one of the many libraries.

    wiringPi is depreciated.

    In /home/tc there are a couple of scripts to look at.

    squeezelite has the Power On/Off GPIO and Power On/Off Script options.

    Lots of other stuff that I can't think of just at the moment.

  4. #4
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,591
    Quote Originally Posted by cliveb View Post
    Not sure which forum I should ask this in: here, 3rd party software, DIY?

    Anyhow, I'm setting out on a project to develop a plugin that will toggle a GPIO pin on a pi running piCorePlayer.
    This is to replicate the behaviour of the old PowerSwitchII plugin on SB2/SB3/TP, to drive a relay to switch amps on/off.

    To do this I'll need to install some additional packages to get access to the GPIO pins.
    On Raspbian, I'd apt-get install them, but this isn't available on the TinyLinux that piCoreplayer uses.

    How do I go about installing additional packages into a piCorePlayer system?
    Or is there some other way to access the GPIO pins in TinyLinux?
    Hi Cliveb,

    You don't actually have to do any scripting to do this its built into pCP (SL actually)

    I use Powerswitch3 for my SB3's and pCP built in for my pCP based players

    All drive 16A SSR's directly

    Jeff

    Name:  2020-12-22 21_59_38-Window.jpg
Views: 253
Size:  31.1 KB


    squeezelite has the Power On/Off GPIO and Power On/Off Script options.
    Sorry Greg, Missed this !
    Last edited by Jeff07971; 2020-12-22 at 15:58.

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  5. #5
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,175
    I think you made the best solution a lot more obvious than I did.

  6. #6
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by Jeff07971 View Post
    Hi Cliveb,

    You don't actually have to do any scripting to do this its built into pCP (SL actually)

    I use Powerswitch3 for my SB3's and pCP built in for my pCP based players

    All drive 16A SSR's directly

    Jeff

    Name:  2020-12-22 21_59_38-Window.jpg
Views: 253
Size:  31.1 KB
    Well, my apologies for not finding out about this! A genuinely embarrassing face-palm moment on my part.

    That said, I have now tried playing around with the Squeezelite Power on/off GPIO settings, and haven't been able to make it work. Let me just ask a couple of questions to make sure it does what I'm hoping for:

    1. The help for the setting says: "Squeezelite will toggle this GPIO when the Power On/Off button is pressed"
    I interpret this to mean that when I click the power button for the picoreplayer in the LMS web interface (and by extension, if I switch the player on/off using a Duet controller or phone app such as Squeezer), it should toggle the GPIO pin. Is that correct? I hope it is, because that's exactly what I want it to do.

    2. What numbering for the GPIO pins is used in this setting? Does it use the physical hardware pin numbers, the (non-sequential) RPi numbering, or some other scheme?
    I ask this because I've tried both physical and RPi numbering, and neither seem to work.
    For example, if I set the Squeezelite to use GPIO 13, is this the physical pin #13 (aka GPIO 27 in RPi-speak), or physical pin #33 (aka GPIO 13)? I've tried checking both pins with a multimeter, and neither seem to toggle. Pin #33 (GPIO 13) stays stubbornly high, and pin #13 (GPIO 27) stays stubbornly low.
    Another way of asking the question:
    If I set the Squeezelite power on/off to GPIO 13, which physical pin will it control?
    Transporter -> ATC SCM100A

  7. #7
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,934
    BCM pin numbering. Which is the numbering almost everything uses. https://pinout.xyz/ Almost nowhere in software is physical pin numbering used.

    Are you sure nothing else is using GPIO 13? D9 you have a DAC Hat installed?
    Last edited by paul-; 2020-12-23 at 05:51.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #8
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,591
    1. The help for the setting says: "Squeezelite will toggle this GPIO when the Power On/Off button is pressed"
    I interpret this to mean that when I click the power button for the picoreplayer in the LMS web interface (and by extension, if I switch the player on/off using a Duet controller or phone app such as Squeezer), it should toggle the GPIO pin. Is that correct? I hope it is, because that's exactly what I want it to do
    Yes exactly, I use the "powersave" plugin which mean the power amps etc power down after a set time on pause or stop.

    As Paul says GPIO Pin numbers not physical Pin number is used.

    For example, if I set the Squeezelite to use GPIO 13, is this the physical pin #13 (aka GPIO 27 in RPi-speak), or physical pin #33 (aka GPIO 13)? I've tried checking both pins with a multimeter, and neither seem to toggle. Pin #33 (GPIO 13) stays stubbornly high, and pin #13 (GPIO 27) stays stubbornly low.
    If set for GPIO 13, pin 33 should stay high while the player is on it should go low when you turn the player off.

    Jeff
    Last edited by Jeff07971; 2020-12-23 at 05:57.

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  9. #9
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,927
    Quote Originally Posted by paul- View Post
    BCM pin numbering. Which is the numbering almost everything uses. https://pinout.xyz/ Almost nowhere in software is physical pin numbering used.

    Are you sure nothing else is using GPIO 13? D9 you have a DAC Hat installed?
    OK, thanks. So GPIO 13 is physical pin #33.
    I don't have any HAT installed. This is a fresh piCorePlayer install with nothing added.
    Should the Squeezelite power on/off setting just work, or do I need to enable it somehow?

    Incidentally, is there a recommendation for which GPIO pin would be best to use for the power on/off setting?
    I'm using a RPi4 if that's relevant.
    Transporter -> ATC SCM100A

  10. #10
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,591
    Quote Originally Posted by cliveb View Post
    OK, thanks. So GPIO 13 is physical pin #33.
    I don't have any HAT installed. This is a fresh piCorePlayer install with nothing added.
    Should the Squeezelite power on/off setting just work, or do I need to enable it somehow?

    Incidentally, is there a recommendation for which GPIO pin would be best to use for the power on/off setting?
    I'm using a RPi4 if that's relevant.
    Apart from setting the GPIO and the Active State (High or Low) in the Web settings page nothing else needs to be done.

    I use GPIO13 as its right next to 0v and I know its not used by my Hifiberry Hat

    Jeff

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

Posting Permissions

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