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
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.
Code: Select all
npn transistor e.g. 2N5088
C B E
| | |
reset high pin <| | |> reset ground pin
gpio port <-/\/\/\-<|
Note diagram corrected - E & C were reversed in the original version
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).