atzensepp
Posts: 11
Joined: Sun Sep 23, 2012 8:00 pm

How to shutdown the Raspberry Pi?

Wed Oct 03, 2012 8:17 pm

I want to use my Pi as internet radio with mpd. It should work as a stand alone device. Start up is no problem since mpd is strting automatically. But when I want to turn it off Iam currently pulling the power plug. Since it is a linux device I am afraid that by this rough procedure one time the file system could get corrupted. What would be your advice to do a decent shutdown or is the power off method not so critical for the pi?

rymate1234
Posts: 24
Joined: Wed Oct 03, 2012 8:22 pm

Re: How to shutdown the Raspberry Pi?

Wed Oct 03, 2012 8:25 pm

Just run sudo halt from a console to shut your pi down. This initiates the linux shutdown routine.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2807
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: How to shutdown the Raspberry Pi?

Wed Oct 03, 2012 8:26 pm

Best thing to do is enable ssh (it should be enabled if you haven't disabled it) then ssh into it from another computer (or even your smartphone) and type

Code: Select all

sudo halt
Further info here...

http://raspi.tv/2012/how-to-safely-shut ... spberry-pi
Alex Eames RasPi.TV, RasP.iO

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: How to shutdown the Raspberry Pi?

Wed Oct 03, 2012 11:46 pm

Leave it running, why do you need to shut it down? The power the device uses is minimal.

RockMachine
Posts: 61
Joined: Sat Aug 18, 2012 6:30 pm
Location: Italy

Re: How to shutdown the Raspberry Pi?

Thu Oct 04, 2012 5:06 pm

Sudo poweroff

mckorr
Posts: 12
Joined: Fri Oct 05, 2012 5:01 pm

Re: How to shutdown the Raspberry Pi?

Fri Oct 05, 2012 5:05 pm

ski522 wrote:Leave it running, why do you need to shut it down? The power the device uses is minimal.
In order to move it to a different location, or to swap out the SD card, or.... Lots of reasons you might have to shut it down.

atzensepp
Posts: 11
Joined: Sun Sep 23, 2012 8:00 pm

Re: How to shutdown the Raspberry Pi?

Tue Oct 09, 2012 8:14 pm

rymate1234 wrote:Just run sudo halt from a console to shut your pi down. This initiates the linux shutdown routine.
Sure this is the correct way if one has a terminal connection.
But I am interested in a way to safely power off the Pi with a simple button press without the need for logging in just for the purpose of powering down.
Following ideas I had so far:
  • write a demon that is permanently checking one of the GPIO pins and shutting down the Pi when a special button is pressed
  • write a PHP script to power it down via web with an Iphone as controller ( :? )
  • build a little UPS device that detects a power off, supplies the Pi for some seconds until it powers off after sending a shutdown-signal via GPIO to the Pi. (a demon needed too)

I was hoping this problem has been solved already. More elegant suggestions are welcome.

toxibunny
Posts: 1383
Joined: Thu Aug 18, 2011 9:21 pm

Re: How to shutdown the Raspberry Pi?

Tue Oct 09, 2012 8:26 pm

I use either sudo shutdown, then pull the plug, or sudo shutdown -r to reset.

What's all this 'sudo halt' and 'sudo poweroff' stuff?
note: I may or may not know what I'm talking about...

toxibunny
Posts: 1383
Joined: Thu Aug 18, 2011 9:21 pm

Re: How to shutdown the Raspberry Pi?

Tue Oct 09, 2012 8:27 pm

yeah, I also mostly just leave it running, too... which I feel a bit dodgy about, to be honest.
note: I may or may not know what I'm talking about...

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9471
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How to shutdown the Raspberry Pi?

Tue Oct 09, 2012 8:29 pm

These are shortcuts for the more difficult to remember command
sudu shutdown -h now

why shouldn't you make something easy that you have to do so often.

mak3r
Posts: 1
Joined: Tue Oct 09, 2012 9:05 pm

Re: How to shutdown the Raspberry Pi?

Tue Oct 09, 2012 9:09 pm

atzensepp wrote: [*] build a little UPS device that detects a power off, supplies the Pi for some seconds until it powers off after sending a shutdown-signal via GPIO to the Pi. (a demon needed too)[/list]
I was hoping this problem has been solved already. More elegant suggestions are welcome.
You probably don't need an entire ups. Why not just a switch that signals one of the inputs.

atzensepp
Posts: 11
Joined: Sun Sep 23, 2012 8:00 pm

Re: How to shutdown the Raspberry Pi?

Wed Oct 10, 2012 9:02 pm

mak3r wrote:
atzensepp wrote: [*] build a little UPS device that detects a power off, supplies the Pi for some seconds until it powers off after sending a shutdown-signal via GPIO to the Pi. (a demon needed too)[/list]
I was hoping this problem has been solved already. More elegant suggestions are welcome.
You probably don't need an entire ups. Why not just a switch that signals one of the inputs.
Yes an ups would be overkill. Probably something like that is sufficient:
http://picnote.blogspot.de/2008/10/batt ... oller.html
(The battery could be used for a RTC (e.g. DS1337) too.)

B.t.w. I found a thread in this forum that deals with that problem: "Safe hard power-off"
http://www.raspberrypi.org/phpBB3/viewt ... 29&t=17140

atzensepp
Posts: 11
Joined: Sun Sep 23, 2012 8:00 pm

Re: How to shutdown the Raspberry Pi?

Thu Oct 11, 2012 9:06 pm

What about using a large (Gold Cap) capacitor as back-up power supply to enable a decent shutdown?
The Pi is consuming 2 W at 5 V. For a 30s Shutdown cycle a charge of 12 As is needed which could be provided by a capacitor with 2.4 F capacity.
Do you think that would work?

FruityPenguin
Posts: 7
Joined: Thu Jul 05, 2012 7:44 pm
Location: Berlin, Germany

Re: How to shutdown the Raspberry Pi?

Sun Nov 11, 2012 4:01 pm

I was also thinking about using a Gold Cap for a mini-UPS, as I see several advantages:
  • Doesn't require a complex charging circuit
  • It can easily supply more than enough power for a quick shutdown
  • Has a longer shelf life (up to 10 years) than rechargeable batteries
  • Small
Detecting that mains power has failed and triggering a GPIO pin to initiate the shutdown should also be easy to do.

Unfortunately my skills in electronics are too basic to actually turn this idea into a working circuit. :oops:

Return to “Beginners”

Who is online

Users browsing this forum: kansascrow, Raspomh and 72 guests