77

My Raspberry Pi runs OpenELEC. The XBMC has a Power-button in the left-bottom corner where I can shutdown the Raspberry Pi. That works fine, but I can't figure out how to turn it on again after the shutdown. The only way I can make it start again is by pulling out the power plug and plug it in again, but that cannot be the only way to do it.

Do I need to create my own hardware-power button for this or can I turn it on in any other way? I'd love to have some kind of remote to turn it on.

2
  • 1
    Wake on lan is the only thing I can think of
    – Meer Borg
    Mar 17, 2013 at 13:35
  • 5
    WoL is available in the LAN controller - but it is not hooked up to anything. So it does nothing :( The fundraisers said that WoL will be considered in newer version. As of revision c we still cannot use it. Only thing I can think of is an external mcu like aTiny triggered somehow to cut the power and supply it again. It quite a big oversight that one cannot remotely turn on the Pi :(
    – Piotr Kula
    Mar 18, 2013 at 14:33

13 Answers 13

38

Revision 2 of the Raspberry Pi board has holes on the board for connecting a reset switch. You can solder two jumper pins there, then connect a push button. This should reboot the Raspberry Pi.

When you shut down the Raspberry Pi, the board and USB ports will still be powered, even if the CPU is not running. If this matters to you, there is this Kickstarter project, constructing a true power switch, with which the Pi can switch itself off from software.

The source for these links.

1
14

You can boot an idle Raspberry Pi via the GPIO pins. All you have to do is connecting pin 5 to ground. Either by a switch or a jumper.


In addition to that, you can also use the same pin/switch as a shut down switch. You just need a simple circuit, a resistor and a Python script for that to work. See the following example (source in German); I am using that for my Raspberry Pi, and it works fine. I just left out the LED as I did not need it.

Source: Hoch- und runterfahren mittels Taster (incl. Status-LED)

2
  • you need a running python script for this to work, and when RPi is shut down, there are likely no python script running, rendering your advice useless.
    – lenik
    Jun 24, 2014 at 10:36
  • 4
    No. The python script is just for shutting down. As that was not the question I didn't go into detail or translated it. This example I referenced does two things. On the one hand use the default behavior of RPI that a connection between pin 5 and ground (for example pin 6) does a power up. And while being powered up it starts a python script listening for high on pin 5 to initiate the shutdown. I use the power up using a power button that I had left from an old PC enclosure. But any piece of wire connecting pin 5&6 does the same trick. Yet that requires a free gpio. Jun 24, 2014 at 12:19
6

Simply connect the Raspberry Pi to the USB of your TV! (if your TV has one). I did it, and it works flawlessly. :)

5
  • 3
    Welcome to Raspberry Pi Stack Exchange! This really doesn't answer the question, as plugging the Pi into the USB port on a TV is just another form of what the OP doesn't want to do (plug/unplug to power-cycle.) Aug 29, 2014 at 21:49
  • 6
    @RPiAwesomeness - that is not at all what I read from the question - rather the ts did not want to do it manually. This way, the Pi will turn on again when the tv starts, presumably by remote control, and that is exactly what the ts wanted.
    – Bex
    Sep 1, 2014 at 11:08
  • 2
    I can see where you're coming from, and from that POV, this answer makes sense. I think if you edited your answer to include that statement, it would be much improved. As the answer stands it appears as I mentioned it, just another form of plug/unplug. Sep 1, 2014 at 13:11
  • 3
    The problem is, that this turns the Raspi always on, if the TV is on. And the TV is also on, if you are playing games with a Playstation or watching TV with a set-top box. And if you switch out the TV after gaming, the OpenElec gets crashed, because no clean shutdown is initiated by the TV.
    – ceving
    Nov 30, 2014 at 22:50
  • 2
    Yes, this is a several-year-old answer and I'm not sure if it answers the OP's question, but I'm upvoting anyway because it's a brilliantly simple solution that worked beautifully for my use case and saved me the hassle of soldering a switch to my RPi Zero. Sep 28, 2017 at 23:17
6

If you want to use a remote controller to turn on the RPi, I suggest the following setup:

Buy an IR photo-diode, or even better, an IR photo-transistor, and connect it to Pin 5 and GND. It acts like a push-button. When it receives IR beams from remote controller, it shorts, and hence connects Pin 5 to GND, hence the RPi turns on.

Fortunately, shorting the pin 5 to GND does not have any effect during the normal operation of RPi; however, when the RPi is shut down, you can use an IR remote controller to turn the RPi on.

This is the setup that I'm currently using on our companies devices ;)

3

The Raspberry Pi cannot be booted remotely over LAN, nor by timer.

Maybe you can use a remote controlled power switch to power your Raspberry Pi? I have never used them, but they are for sale.

2
  • Either that or you create your own power/switch button like you suggested. Specifically, you'd use a button/switch that closes the electrical circuit when it's not pressed and opens it when pressed. Then you'd simply have to hit the button, but you'd have to get up for that
    – TimothyP
    Mar 18, 2013 at 3:37
  • This is no longer correct (was correct 6 years ago when it was posted): now that there is POE support for the PI, if it's plugged into a POE switch, by disabling and re-enabling the port the Pi is connected to on the POE switch, you can cold-boot a Pi even if it was shutdown with sudo systemctl poweroffas detailed in my answer below this one.
    – F1Linux
    Feb 15, 2019 at 11:20
2

I solved it with a simple remote-controlled power outlet. Just turn off the Raspberry Pi and turn it on like you turn on your light switch. Do no soldering or difficult matters. :-).

2
  • 5
    Care to provide a link or picture? Without more information this answer isn't much of use
    – nixda
    Feb 15, 2015 at 18:08
  • NB: do not turn off the Pi by accident without shutting it down first as this might cause corruption of the SD card.
    – DerMike
    Jan 4, 2020 at 0:55
2

Connect your Pi's to a PoE switch and simply disable and then re-enable the port of the Pi you want to bring back up. I just VPN into my network and access the PoE switch on it's local IP and start up a pi from a shutdown-state.

(2) Methods for PoE-enabling a Pi:

PoE Hat: Just whack this on top of your Pi and light it up with an Ethernet cable connected to a PoE switch. PoE Hats are £20 from all Pi Resellers.

PoE Splitter: This doesn't require modifying the Pi. Plug this dongle on the end of the Ethernet cable connected to the PoE switch and the Ethernet cable from the dongle into the Pi's Ethernet Port and the MicroUSB cable from the dongle into the Pi's standard power MicroUSB port. Works with any Pi model and leaves it free to use a different hat (than the PoE hat). £9.90 from Amazon at the time of this writing.

ZyXEL GS1900-8HP-GB0102F PoE Switch: The one I use and recommend to re-animate shutdown Pi's is the ZyXEL GS1900-8HP-GB0102F. Great PoE switch with lots of bells and whistles and supports PoE (802.3af) and PoE+ (802.3at). £97 inc VAT

PoE Splitter

PoE Splitter being used to power both a Pi 3B+ AND a 7" Touchscreen Display

PoE Splitter being used to power both a Pi 3B+ AND a 7" Touchscreen Display

1

If you've already halted the system using the button in XBMC, pulling the power cable out and re-inserting is still the easiest way to power on the Pi. It's not great, but it is quick.

4
  • You're right - sorry, I was tired when I read the question :) I'll remove my comment so I don't mislead anyone
    – eggonlegs
    Sep 30, 2013 at 2:27
  • 1
    It is different from a power button, USB ports have a lifetime rated on a certain number of inserts. A switch is faster and more durable.
    – jiggunjer
    Jan 19, 2017 at 19:56
  • Lifehack --- you can unplug the side of the powercable that is not in the Raspberry Pi. Sounds trivial, but for many people it is more intuitive to unplug the microusb side that goes into PI, rather than more convenient power socket/standard usb.
    – Yrogirg
    Dec 22, 2017 at 4:31
  • This does not answer the question.
    – DerMike
    Jan 4, 2020 at 0:50
1

As the other posters already said the Raspberry Pi hardware does not have a power controller built in, so you would need to rely on hardware add-ons.

One solution would be the RemotePi Board which piggy backs on the Raspberry Pi and enables you to switch OpenElec (or other XBMC distributions) on and off using any infrared remote that you already own (for example your TV's or DVD's remote), by 'learning' the button you choose. It shuts down the OS as well before powering down to avoid SD card corruption. In addition you can use the remote remote to control your mediacenter.

1
  • I've been using the RemotePi board now for a few weeks and love it.
    – Jim
    Dec 13, 2016 at 12:30
0

There really is little to no point to shutting down the media centre. It only costs a couple of pennies a day.

However, after shutting down, remove the power. Then when you would like to boot it up again, just put the lead into the power socket :).

Most TVs allow you to switch between HDMI and other inputs, so there shouldn't be an issue leaving it running anyway.

1
  • 1
    This does not answer the question.
    – DerMike
    Jan 4, 2020 at 0:51
0

Shutting down the Pi will not power off the Pi. But it will tell the Linux to flush the cache and unmount the local storage, also disconnecting any network shares. So it is mainly used for a clean shutdown for unplugging the Pi from power. It is almost the same like you shutdown you computer instead of unplug the power while running Linux, Windows or any other OS.

So the best way might be a remote controlled power. And then first shutdown OpenELEC / Kodi and then switch off the power.

0

I came across this https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi on the internet.

It implements a physical button to turn the Pi on and off. All it needs is tweaking some config files and a bit of Python script.

-1

I had the same problem, so I used a real USB cable (not the power supply to USB) and plugged it in my TV, so if I turn my TV on, the USB got power and so my Raspberry Pi starts...

1
  • 7
    doing that will cause power off in hot, while the raspi can be writing in the SD. This will eventually lead to a corrupted card.
    – javirs
    Mar 27, 2014 at 8:20

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