Page 1 of 1

Pin that is in powered on OSMC shutdown

Posted: Wed Feb 08, 2017 5:07 pm
by silent001
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

Re: Pin that is in powered on OSMC shutdown

Posted: Wed Feb 08, 2017 7:02 pm
by rpdom
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.

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 6:26 am
by silent001
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.

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 10:21 am
by rpdom
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".

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 12:07 pm
by silent001
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

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 12:28 pm
by rpdom
Yes, that is correct.

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 1:22 pm
by silent001
It doesn't work. I get full 3.12 Volts on it even if I use the shutdown Inside OSMC

Re: Pin that is in powered on OSMC shutdown

Posted: Thu Feb 09, 2017 1:53 pm
by silent001
I tested it in raspbian and it works but the shutdown doesn't complete. Please help. I can't figure out whats wrong