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?
Results 1 to 10 of 29
-
2020-12-22, 12:07 #1
- Join Date
- Apr 2005
- Location
- Watford, UK
- Posts
- 1,927
Installing extra packages on piCorePlayer
Transporter -> ATC SCM100A
-
2020-12-22, 12:20 #2
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
-
2020-12-22, 12:24 #3
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.
-
2020-12-22, 15:00 #4
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
squeezelite has the Power On/Off GPIO and Power On/Off Script options.Last edited by Jeff07971; 2020-12-22 at 15:58.
-
2020-12-22, 16:18 #5
I think you made the best solution a lot more obvious than I did.
-
2020-12-23, 05:33 #6
- Join Date
- Apr 2005
- Location
- Watford, UK
- Posts
- 1,927
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
-
2020-12-23, 05:46 #7
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
-
2020-12-23, 05:54 #81. 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
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.
JeffLast edited by Jeff07971; 2020-12-23 at 05:57.
-
2020-12-23, 06:00 #9
- Join Date
- Apr 2005
- Location
- Watford, UK
- Posts
- 1,927
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
-
2020-12-23, 06:04 #10