User avatar
r3d4
Posts: 924
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Wake from halt

Sat Mar 21, 2015 9:41 am

ha107642 wrote:What criteria need to be met
Hi ha1* my guess is that you would at least need to update bcm-firmware-blob and perhaps kernel .

User avatar
DougieLawson
Posts: 33048
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Wake from halt

Sat Mar 21, 2015 11:48 am

On a A/B rev2 you should use the P6 header.
On the A+/B+ and 2B you should use the RUN header.

http://www.noveldevices.co.uk/rp-project-reset
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

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

Re: Wake from halt

Sat Mar 21, 2015 1:57 pm

ha107642 wrote: I connected the fifth and sixth pins on my Raspberry Pi when it was in a halt state. Unfortunately, it did not wake the Pi from halt.
Just to check you have the right pins, by "fifth and sixth", you do mean pins 5 and 6, the third pair of pins from the end?

jt123
Posts: 3
Joined: Thu Feb 05, 2015 6:42 pm

Re: Wake from halt

Tue Sep 20, 2016 6:50 pm

sorry to resurrect this somewhat old thread, but it seems like on the 3B, shorting physical pins 5 and 6 (BCM3 and GND) no longer wakes the system as before (on the Pi2 and earlier).

too bad as otherwise you could use a single button for startup and shutdown... (assuming you don't need the i2c lines active all the time)

hurz
Posts: 8
Joined: Sun Jan 27, 2013 9:00 pm

Re: Wake from halt

Thu Jan 05, 2017 6:39 am

I'd like to chime in as I'm experiencing the same issues as already mentioned by different people in this thread, but with a Raspberry Pi B (Rev2):

If I do halt it differs from shutdown -h for me in that it keeps the Ethernet LEDs alive (so possibly some more functions in the background) as was mentioned before.
halt -p however will fully shut down the Pi.

However in none of these shutdown states can I wake the Pi again by connecting Pin5 to Pin6 (or any other GND for that matter).
I do have a bootcode.bin file in /boot and waking by shorting the P6 contacts does work (although in this case the halt state described above is fully shut down, followed by a regular reboot).

Right now I'm running a Runeaudio image, so it's based on Arch linux rather than Raspbian but I thought it should still work?
I can read GPIO3 high and low normally so the input itself works. I have yet to check if Pin5 is pulled high in the shutdown state though, but I thought that was enforced in hardware with the BCM chip?
The default assignments after boot could be changed via the dt-blob.bin file, but would that affect the halt or shutdown state?

I'd very much prefer to use the Pin5 method rather than the P6 header as I'd like to implement a single shutdown/reboot/wake button. Shorting P6 during regular operation would only reboot the Pi (or is there any other choice in this?) but I'd rather be able to shutdown and start separately (e.g. before disconnecting the equipment box from power) without ssh-ing into it or using the web interface.

I can re-test with my Volumio image later (Raspbian based) to see if it makes a difference but maybe somebody has a clue what could be going on or what I could further test/change?

Best regards,
Raul

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

Re: Wake from halt

Thu Jan 05, 2017 6:51 am

Have you tried poweroff instead of halt? Or shutdown -P ?

hurz
Posts: 8
Joined: Sun Jan 27, 2013 9:00 pm

Re: Wake from halt

Fri Jan 06, 2017 2:48 am

Both poweroff and shutdown -P seem to do the same as shutdown -h or halt -p (only red power LED active).
For any of those I can restart the Pi with the P6 header but for none of those with connecting Pin5 to ground.^

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5141
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Wake from halt

Fri Jan 06, 2017 1:06 pm

hurz wrote:I'd like to chime in as I'm experiencing the same issues as already mentioned by different people in this thread, but with a Raspberry Pi B (Rev2):
Works for me. I've tried a rev1 (Revision=2) and a rev2 (Revision=0xe) Pi1 model B.
"sudo halt" causes shutdown then 10 flashes form ACT led.
I use a jumper between pins 5 and 6 of P1 (GPIO3 and GND) - that is 3rd pair from left and Pi boots up again.

hurz
Posts: 8
Joined: Sun Jan 27, 2013 9:00 pm

Re: Wake from halt

Sat Jan 07, 2017 6:41 am

So I tried all commands again with Volumio2 (Raspbian based, kernel 4.4.9) and there halt behaves just like shutdown -h now or poweroff, without adding a -p.
But also on this OS I can't start with grounding Pin5, only via header P6.
Any ideas what I could do to change this? What OS are you guys running? Maybe the standard Raspbian allows for this?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5141
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Wake from halt

Sat Jan 07, 2017 11:39 am

hurz wrote:So I tried all commands again with Volumio2 (Raspbian based, kernel 4.4.9) and there halt behaves just like shutdown -h now or poweroff, without adding a -p.
But also on this OS I can't start with grounding Pin5, only via header P6.
Any ideas what I could do to change this? What OS are you guys running? Maybe the standard Raspbian allows for this?
Do you get the 10 flashes on ACT LED after halting?
You will only be able to restart from GPIO if you have reached the low power halt state in bootcode.bin (which does the LED flashing).
If the distribution does something different for halt (e.g. just makes the ARM sleep, or hangs on exit) then you won't be able to restart.

hurz
Posts: 8
Joined: Sun Jan 27, 2013 9:00 pm

Re: Wake from halt

Wed Jan 11, 2017 5:43 am

On both RuneAudio and Volumio2 the ACT LED indeed flashes 10 times upon shutdown -h now.
Still I can't start with Pin5 though.

So both distros seem to go into that "low power halt state" but won't wake up with GPIO3, just via P6.
Any easy way I can check the initial pin configuration of the GPIO (via the dt-blob.bin?)?
Or any logs I could check to see if it shut down into the correct state?

@dom: Are you running the vanilla Raspbian or any other OS on your pis?

Another unrelated thing I noticed: In all the shutdown procedures Volumio2 shuts down "gracefully" and properly quits the ssh connection/server before shutting down while RuneAudio most of the time just lets my connection die, often causing my terminal to freeze.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5141
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Wake from halt

Wed Jan 11, 2017 1:30 pm

hurz wrote: @dom: Are you running the vanilla Raspbian or any other OS on your pis?
Yes, vanilla raspbian. Can you test with vanilla raspbian?
If we know that works then it would rule out a hardware issue.

Rene230781
Posts: 11
Joined: Wed Feb 03, 2016 8:01 am

Re: Wake from halt

Wed Mar 22, 2017 12:06 pm

Hi,

I may have a compicated Question / Problem. I use GPIO 3 (Pin5) and GPIO 2 (Pin3) for my Hifiberry Digi board as outputs (SCL1-I2C & SDA1-I2C) - http://fs5.directupload.net/images/160216/7z3zccsj.jpg.

I was about to use a button (momentary switch) to powerdown the RPI 2B and as well the same button to Start it again (Wake from HALT).
This method:

Code: Select all

 
# shutdown script for Raspberry Pi
# watch LOW level on pin 5 to enter sleep mode
# status led on pin 7: ON = ready, BLINK = confirm button

import RPi.GPIO as GPIO
import os
import time

# use the pin number as on the raspi board

GPIO.setmode(GPIO.BOARD)

# set pin 7 as output and HIGH, pin 5 is input

GPIO.setup(7, GPIO.OUT)
GPIO.output(7, True)
GPIO.setup(5, GPIO.IN)

# start the loop for every .5 seconds, waiting for LOW on pin 5
# then 2 short flashes with led to confirm and shutdown to sleep mode

while True:
        if not (GPIO.input(5)):
                GPIO.output(7, False)
                time.sleep(.1)
                GPIO.output(7, True)
                time.sleep(.1)
                GPIO.output(7, False)
                time.sleep(.1)
                GPIO.output(7, True)
                os.system("sudo shutdown -h now")
        time.sleep(.5)
This is working well but my GPIO 3 is changed to be an Input and now is no more able to be output for the digi board.
I tried to use another GPIO than 3 and 2. I tried GPIO 10 & 4 with the result that shutdown is working well but not the start of the Pi (because Pin 5 is the one which should be shorted to GND to wake on halt).

My Idea is to use GPIO 4 to handle the power down but as well connect pins 5 (GPIO 3) and Pin 6 (GND) to the button. Would be interesting to know if the wake on halt will do something if the RPI is already running. If not I'm fine with this solution. If it will reset the RPI or similar I will have to use 2 buttons (restart Pin 5&6 , power down GPIO 4 triggers shutdownscript)

I hope to have not confused you all to much.
René

paulv
Posts: 546
Joined: Tue Jan 15, 2013 12:10 pm
Location: Netherlands

Re: Wake from halt

Wed Mar 29, 2017 6:37 am

The method described in the following post provides a simple one-button start-stop solution.
viewtopic.php?f=37&t=140994&p=1120289#p1120289

Godsman27
Posts: 1
Joined: Sat Aug 19, 2017 8:44 pm

Re: Wake from halt/Using i2C

Sat Aug 19, 2017 8:48 pm

Does anyone know what happens if u pull pin5 low when u have i2c devices connected to it? Because if i make a switch connection on pin5 & 6 it will be pulled low what i want to know is does it damage the i2c bus?

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

Re: Wake from halt/Using i2C

Sat Aug 19, 2017 9:49 pm

Godsman27 wrote:
Sat Aug 19, 2017 8:48 pm
Does anyone know what happens if u pull pin5 low when u have i2c devices connected to it? Because if i make a switch connection on pin5 & 6 it will be pulled low what i want to know is does it damage the i2c bus?
It won't damage the bus. i2c devices work by pulling the bus low. There are resistors on the Pi that provide a pull-up to 3.3V on pins 3 and 5.

qsrc
Posts: 3
Joined: Tue Oct 04, 2016 8:39 pm

Re: Wake from halt

Tue Oct 10, 2017 10:24 pm

@dom:
I've now added a way to wake the board through GPIO.
A falling edge on GPIO1 or GPIO3 will wake the board up, and it will continue to boot into linux.
Is there any way to configure which GPIO pin is used to wakeup? I am working on a CM3+CMIO3, and both GPIO1 and GPIO3 are occupied (I'm using the dpi24 overlay). I am able to shutdown via the gpio-shutdown overlay, and wake by grounding the RUN pin. But it would be ideal if I could configure the same pin for wakeup as well as shutdown. Is this possible?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5141
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Wake from halt

Wed Oct 11, 2017 3:35 pm

qsrc wrote:
Tue Oct 10, 2017 10:24 pm
Is there any way to configure which GPIO pin is used to wakeup? I am working on a CM3+CMIO3, and both GPIO1 and GPIO3 are occupied (I'm using the dpi24 overlay). I am able to shutdown via the gpio-shutdown overlay, and wake by grounding the RUN pin. But it would be ideal if I could configure the same pin for wakeup as well as shutdown. Is this possible?
No. The low power mode following "halt" is achieved by not powering on a number of power domains/clocks.
That means no access to sdcard and hence no support for configuration files to choose wakeup pin.

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 9 guests