Hardware reset and P6 riser (rev b / 2) ?


6 posts
by SFX Group » Sun Oct 20, 2013 7:15 pm
Hi

I have seen a video on the internet about how to add a "reset" to the board (as below).

YOUTUBE P6 riser with button
http://www.youtube.com/watch?v=rNhXqjSO-0s

Connect the P6 pins to issue a hardware reset, which can also "wake" the board when its sleeping or halted. This would be identical to a Windows power button...

Can someone please comment officially about this? It appears to be fine and a better idea that removing / re-connecting power (and easier).

Many Thanks
Many Thanks
Ashley

© Copyright 2015 - www.ashleygriffin.ca
User avatar
Posts: 74
Joined: Thu Nov 01, 2012 3:54 am
Location: Cambridge, ON. Canada
by alexeames » Sun Oct 20, 2013 8:48 pm
Eben commented officially about it in the original Rev 2 announcement on the official blog, some time back in September 2012, I believe.

Although I made that video, I find, in practice that I don't bother with the P6 reset header because my Pis hardly ever crash. Simply not necessary (for me, at least). It was an academic and fun exercise. Did you catch the following one? The self-resetting Pi?
Alex Eames RasPi.TV, RasP.iO
User avatar
Forum Moderator
Forum Moderator
Posts: 2807
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
by SFX Group » Sun Oct 20, 2013 8:57 pm
The use of the hardware we have limits what "users" can do once on the desktop, so a hard reset is needed for us (we don't have any icons on the desktop, it boots and does what its supposed to, if that stops OR the users does something wacky then it needs a hard reset (by design) to "reset" the desktop).

We are integrating to Windows so there are many times they need to restart the system (thanks to Microsoft buggy Windows OS).

With this in mind, at the moment the only way is to pull the power cable (as we are sourcing USB cables with switches in), however I would prefer a slightly more "robust" way, your reset looks like it....

Ive not read the release for Sep 2012, do you have a link to it?

Ive not seen the following video, do you have a link?
Many Thanks
Ashley

© Copyright 2015 - www.ashleygriffin.ca
User avatar
Posts: 74
Joined: Thu Nov 01, 2012 3:54 am
Location: Cambridge, ON. Canada
by jojopi » Sun Oct 20, 2013 9:16 pm
SFX Group wrote:Connect the P6 pins to issue a hardware reset, which can also "wake" the board when its sleeping or halted. This would be identical to a Windows power button...
P6 is more like a PC's reset button. It causes an immediate crash, and a reboot when released. A PC's power button lets the operating system shut down gracefully (unless you hold it for several seconds) and it also shuts down most of the power supply circuitry, whereas the Pi leaves its power supply running, but tries to draw as little current as possible when it is halted.

Shorting P6 is definitely better than cycling the power off and on. It eliminates the risk of removing power while the SD card is performing internal remapping. Whether that prevents all types of SD corruption, I do not know.

An even gentler option is to run a daemon (background process) that reboots cleanly when a particular GPIO is pulled to ground. GPIO3 is a good choice, because it can also be used to wake the board from shutdown on modern firmware. See these threads:

viewtopic.php?p=355975 Orderly shutdown your RasPi using a hard disk jumper

viewtopic.php?p=227308 Wake from halt
User avatar
Posts: 2939
Joined: Tue Oct 11, 2011 8:38 pm
by SFX Group » Sun Oct 20, 2013 9:33 pm
Hi

Just so I read this right...

METHOD A
Solder small posts to P6, connection moment contact switch.
Press it will "reset" the PI and reboot.

METHOD B
Run this script (https://github.com/g0to/misc_scripts/blob/master/raspi_gpio_actions.sh) from somewhere (I assume a RUNLEVEL as it would need ROOT access).
Have script check every 5 seconds (for faster action).
Connect switch between pins 5/6, when switch is pressed it would also "reset" the PI?

Questions:
I assume both methods are sound?
Method B assumes the system is running and not "crashed" for any reason?
Do both methods do the same thing or is one better than the other?
Many Thanks
Ashley

© Copyright 2015 - www.ashleygriffin.ca
User avatar
Posts: 74
Joined: Thu Nov 01, 2012 3:54 am
Location: Cambridge, ON. Canada
by anita2r » Thu Oct 31, 2013 2:36 pm
Hello,

I don't know if the following is of any use to you, but I have two Pi's that can each reset the other. As they are both headless and I am sometimes not able to physically get to them to do a reset, I have made a simple reset circuit that uses the reset header and is controlled by a gpio port on the other Pi (hopefully they won't both go down at the same time).

These are the notes that I made when designing the circuit:

Remote reset control

Summary:
The remote reset consists of hardware connected to the two reset pins of an RPi (A) and a control input from one gpio pin of another RPi (B)

A control wire is held low (0v) through a 10k resistor and becomes high (3.3v) when a gpio port on the RPi (B) is turned on.
This control wire is connected to the base of an npn transistor. In the default state the control wire is held low and thus the transistor is non-conductive.
To initiate a reset, the gpio on RPi(B) is turned on and the control wire goes high (3.3v).
When the base of the transistor exceeds about 2v, the transistor becomes conductive and as the emitter is connected to the ground side of the reset pin pair on RPi (A), the collector, which is connected to the other side of the reset pin pair at 3.3v, is drawn to ground (0v) and this causes a reset to occur.

Circuit:
Code: Select all
 
                                          npn transistor e.g. 2N5088
                                           C   B    E
                                          -----------
                                          |    |    |
                          reset high pin <|    |    |> reset ground pin
                                               |
                                               |>-/\/\/\->ground
                                               |   10K
                           gpio port <-/\/\/\-<|
                                        2K2

Note diagram corrected - E & C were reversed in the original version
Operation:
A gpio port such as port 17 is selected and 'enabled' on the controlling RPi (B).
Port 17 is then set as an 'output' port.
Port 17 is connected through a 2K2 ohm resistor to the base of the transistor and a 10K ohm resistor is connected between the base and ground.
The 2K2 ohm resistor limits the current drawn from the port, as in an npn transistor, the base current flow will be high as the flow is to ground with very little inherent resistance in the transistor.
The 10K ohm resistor maintains the base at ground potential when the input from the gpio port is off (or disconnected).

The two pins or wires of a reset circuit on the RPi (A) are tested - one is high (3.3v) and the other is low (0v). The low side is connected to the Collector of the transistor and the high side is connected to the emitter of the transistor.

When port 17 is set 'on', the pin goes high, in this case 3.3v, which is above the 2v threshold required to turn the transistor on. In the 'on' state an npn transistor pulls the emitter down to the ground connected to the collector. This is the required reset signal.
The controlling RPi (B) must immediately set pin 17 low, by turning off port 17, so releasing the reset signal, allowing the 'high' side of the reset pair to return to it's high state (3.3v).

The basic idea for this came from another site, unfortunately I can't remember where now.

An extension of this would be to monitor activity on one Pi from the other - a port on the first Pi is pulsed high/low at set intervals and the second Pi monitors the change. If the change high/low or low/high does not occur within a defined interval, a reset can be initiated.

I use this principle to make one Pi take over temperature monitoring on a 1-wire network if the other Pi is doing a backup and has stopped monitoring (or has crashed).

Regards
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada