silent001
Posts: 15
Joined: Sat Oct 29, 2016 9:34 am

Pin that is in powered on OSMC shutdown

Wed Feb 08, 2017 5:07 pm

Good day, I am trying to find a pin to give out power when the Raspberry Pi 3 V1.2 is on but when you power off within OSMC that pin must also be powered off. Please help I have searched but I can't find what I am looking for

User avatar
rpdom
Posts: 11426
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Pin that is in powered on OSMC shutdown

Wed Feb 08, 2017 7:02 pm

I don't know if it will work with OSMC (it should do), you can set an option in /boot/config.txt to make almost any gpio pin a power signal pin.

Code: Select all

Name:   gpio-poweroff
Info:   Drives a GPIO high or low on poweroff (including halt)
Load:   dtoverlay=gpio-poweroff,<param>=<val>
Params: gpiopin                 GPIO for signalling (default 26)

        active_low              Set if the power control device requires a
                                high->low transition to trigger a power-down.
                                Note that this will require the support of a
                                custom dt-blob.bin to prevent a power-down
                                during the boot process, and that a reboot
                                will also cause the pin to go low.
So, if you want to use say pin 29 (GPIO 5) as the controlling pin, you'd put

Code: Select all

dtoverlay=gpio-poweroff,gpiopin=5,active_low=1
in /boot/config.txt

As gpios 0-7 pull high by default, that pin will be high at boot and stay that way until the Pi is shutdown, when it will go low. Note that it will also go low during a reboot.

silent001
Posts: 15
Joined: Sat Oct 29, 2016 9:34 am

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 6:26 am

Thanks rpdom but I don't think you understood what I meant. Lets say I want to connect a LED to the Raspberry Pi 3 Modal B V1.2 but I want the LED to only be on as long as OSMC is on not as long as the board gets power. So for as long as OSMC is running the LED must be on. If I go into OSMC and select power off inside OSMC the LED must turn off as soon as the sytem is off.

User avatar
rpdom
Posts: 11426
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 10:21 am

silent001 wrote:Thanks rpdom but I don't think you understood what I meant. Lets say I want to connect a LED to the Raspberry Pi 3 Modal B V1.2 but I want the LED to only be on as long as OSMC is on not as long as the board gets power. So for as long as OSMC is running the LED must be on. If I go into OSMC and select power off inside OSMC the LED must turn off as soon as the sytem is off.
Yes, that's exactly what that option does, as long as OSMC performs a normal shutdown of the Pi. Note I said "shutdown" not "remove power".

silent001
Posts: 15
Joined: Sat Oct 29, 2016 9:34 am

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 12:07 pm

Thanks rpdom

So my config.txt will look as follows?

Code: Select all

gpu_mem_1024=256  
hdmi_ignore_cec_init=1  
disable_overscan=1
start_x=1  
disable_splash=1
gpu_mem_256=112  
sdtv_aspect=1  
gpu_mem_512=144  
dtoverlay=gpio-poweroff,gpiopin=5,active_low=1
Is this correct? If so and I want to connect a multimeter to it do I connect it to ground and GPIO05 like in the attached picture?

Thanks once again
Attachments
Upload.png
Upload.png (32.01 KiB) Viewed 509 times

User avatar
rpdom
Posts: 11426
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 12:28 pm

Yes, that is correct.

silent001
Posts: 15
Joined: Sat Oct 29, 2016 9:34 am

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 1:22 pm

It doesn't work. I get full 3.12 Volts on it even if I use the shutdown Inside OSMC

silent001
Posts: 15
Joined: Sat Oct 29, 2016 9:34 am

Re: Pin that is in powered on OSMC shutdown

Thu Feb 09, 2017 1:53 pm

I tested it in raspbian and it works but the shutdown doesn't complete. Please help. I can't figure out whats wrong

Return to “Beginners”

Who is online

Users browsing this forum: pcmanbob and 63 guests