67

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.

SDsolar
  • 2,378
  • 8
  • 26
  • 43
John La Rooy
  • 12,005
  • 9
  • 48
  • 77

5 Answers5

81

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.

nickcrabtree
  • 438
  • 4
  • 15
Steve Robillard
  • 34,988
  • 18
  • 106
  • 110
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.)

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

SDsolar
  • 2,378
  • 8
  • 26
  • 43
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.

Pierz
  • 852
  • 11
  • 9
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)