Recipe for auto-reset Pi.
Take one Rev 2 Raspberry Pi, a few carefully selected slices of fresh Python, one GPIO port (’25 vintage, preferably), one relay (a twin pack is OK, but not AA), one Darlington array (leave the spikes on), a sprinkling of mixed wires and arrange it all carefully with a breadboard. It should end up looking something like this…
I decided to take the P6 reset header one step
sillier further. Just for fun. ;) The idea here is to use one of the Pi’s own GPIO ports to switch a relay (via Darlington array), which, instead of powering some mighty and powerful device, merely shorts two wires, which happen to coincide at the P6 reset header on the same Raspberry Pi. Thus instead of merely typing
sudo reboot we can get a hardware level reset by going to a lot more trouble.
And since Dom, Alex and the crew have been working so hard to make this sort of thing possible, it would have been simply rude and ungrateful not to have tried it. ;)
If you want the script, you can download it here but you might want to rename it from reset.py_.txt to reset.py.
If you want to learn about how the script works, I do a full walk-through in the video. :)
You could also use this idea to reset one Pi using another one, or even a different device. So if you imagine a scenario where you are away from your Pi and it crashes, you could use another one sitting next to it to perform a remote hardware reset. It might be useful for someone.