66

How do I hard reset a Raspberry Pi?

Obviously you can power cycle, but is there a more subtle way, like a reset pin? It would be very useful to connect a watchdog in case the Raspberry Pi crashes (mine crashed last night).

EDIT: The rev 2.0 board has a header you can connect a reset switch to.

2
  • Power cycling is dangerous. Be ready to say goodbye to the contents of the SD card if you use that method. Below I show the answer for the PI 3. Using a reset button is rarely necessary, but is MUCH safer than power cycling.
    – SDsolar
    Oct 31, 2017 at 1:23
  • It is absolutely not normal for a Raspi to just crash. If you have any idea why it happened, I would research for the solution. Mar 29, 2021 at 9:17

5 Answers 5

80

You can use the BCM2708's hardware watchdog.

To use it begin by loading the module:

sudo modprobe bcm2708_wdog

Then edit the /etc/modules file:

sudo nano /etc/modules

and add the following line:

bcm2708_wdog

Next you will need to setup the watchdog daemon.

Install and confiigure it to start on bootup:

sudo apt-get install watchdog chkconfig
chkconfig watchdog on
sudo /etc/init.d/watchdog start

Next configure watchdog:

sudo nano /etc/watchdog.conf

Uncomment the line #watchdog-device = /dev/watchdog so it reads:

watchdog-device = /dev/watchdog

The watchdog daemon will send /dev/watchdog a heartbeat every 10 seconds. If /dev/watchdog does not receive this signal it will restart your Raspberry Pi.

This can be useful if you are accessing your Pi remotely, and it dies or locks up. However, this is not the preferred method of restarting the system, but can be used to restart a locked system, where the only other option is to remove power from the device. Be warned that this can result in filesystem damage that could prevent the Pi from booting and operating correctly.

More info including a method to test this setup can be found in Gadgetoid's blog post Who watches the watcher?. Binerry's tumblr post Raspberry Pi Watchdog Timer should also be a must read.

8
  • 6
    This is a wonderful answer! Not only does it explain how to hard reset the Raspberry Pi but it also answers how to setup a watchdog.
    – user46
    Aug 2, 2012 at 4:43
  • @Steve Excellent answer and I intend to follow these steps right now. Quick off topic question though, if you Pi does lockup for whatever reason what options are available to restart the Pi WITHOUT the risk of filesystem damage?
    – Dan B
    Sep 10, 2012 at 15:29
  • @DanB: The only way to restart Pi without the risk of file system damage is to be sure there are no write opened files before restart. One way of achieving this is to have most of the system run from RAM disk. Then watchdog restart is file system safe. Also, if your application is not hung, you can always "sudo reboot".
    – avra
    Nov 22, 2012 at 9:45
  • 1
    Note that the name of the watchdog module is now bcm2835_wdt, and it is loaded by default on recent raspbian (as of June 2017) so the first section of this answer about loading the module is now obselete Jun 17, 2017 at 13:42
  • 2
    You don't need chkconfig. Instead, use systemctl enable watchdog and systemctl start watchdog. Sep 12, 2017 at 13:39
9

There is not a conventional reset pin. As in that there is no pin or button to push. Instead you can do the following as stated in this post on the Raspberry Pi forums.

Tap a 3K3 resistor between TP2 (ground) and the SoC end of R15. This works even in the new halt state. (The resistor is just to avoid shorting the 3V3 rail if you hit the wrong end. Anything from 1K to 33K will be fine.)

4
  • This is marked as the RUN pin on the schematic. I have seen people wondering whether it's function was RESET or some sort of suspend. Aug 2, 2012 at 4:41
  • I haven't seen the schematics or have any experience in electronic boards so I can't say for sure whether this is the RUN pin.
    – user46
    Aug 2, 2012 at 4:44
  • 1
    schematic in all it's unsearchable glory is over here raspberrypi.org/wp-content/uploads/2012/04/… Aug 2, 2012 at 5:29
  • The RUN pin is at F9 on the first sheet Aug 2, 2012 at 5:30
7

It is very easy to wire a hardware reset to the Rpi3.

Here is where you will find holes already open and waiting:

enter image description here

(Shown here with header pins soldered in place directly above the screw hole)

Don't use too much heat or solder. A little bit will do.
It is delicate underneath, with a thin trace.

I leave them just open, and use the green wire to briefly short them together.
Alternatively, connect to a momentary-on (NO) pushbutton.

For my data-loggers and such there never is a need to hard-reset like this.

A simple

sudo init 6

command works fine for rebooting.


FYI: You can see the real-time displays of my systems at https://www.SDsolarBlog.com/montage

3
  • I also use this, it is far better than pulling the cable out and corrupting the uSD card. Those pins respond well to a 2sec burst of 360°, although tweezers will short them out just fine.
    – user2497
    Apr 24, 2018 at 15:57
  • Yeah, I agree. Plus, I am old school hard-core Unix (ATT System V) where we always had to do a "sync;sync;sync" before either init 6 for a reboot or init 0 for a shutdown. That's the original reason why the actual shutdown command defaults to a minute. Corruption has become a lot less of an issue these days, but I can't help but always think about it. Abrupt power-off or hardware reset is built into my psyche as a no-no unless it is the only option left.
    – SDsolar
    Apr 24, 2018 at 21:10
  • 1
    Moderators usually won't step in on comments unless we drag it out, so let's keep this part brief. Supercaps (even 1,500 uF) are best for smoothing out shorter-term dips. And personally I wouldn't recommend them with a small panel like that. I have tried working with much larger ones with solar rigs but in the end I always opted for more battery. But I wasn't hiking it around. I would say that you will find that pound-for-pound, a gel-type battery (like from a UPS) would be more useful.
    – SDsolar
    Apr 25, 2018 at 0:27
6

As mentioned in the question edit the rev 2.0 boards now have a specific reset header labelled P6 which is positioned in between the HDMI connector and micro-USB port. The header consists of just two holes (into which one could solder a header/pins). To reset the PI you just momentarily connect the two pins.

0

you could use reboot then when it says "hold shift for recovery mode" you hold shift and it resets your raspberry pi.(note:if you want to keep some files put them on a USB or a SD card)

1
  • I think this is just a NOOBS thing. That's not really what this question was about Apr 19, 2018 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.