shutdown the pi with Rasplex

Hi everyone,

 

new to RPi and rasplex world, I need your help for something which seems very simple but I cannot go through this.

 

My question is. How to shutdown the PI when i leave Plex HT running within rasplex ?

I mean when i left, all the leds on th PI are still turned on.

 

 

FYI. It do it as expected on OpenELEC. Only one red led is still on and others turned off

 

Thx a lot

Olivier

The red light indicates that the power cord is connected. You successfully powered off your PI.

However, why would you want to turn it off?

Most of us leave it on 24/7.


For the record.

There are a couple of ways to turn it off.

  1. Gui: Power off / Shut down
  2. Console/ssh: poweroff
  3. Physical: Pull the power cord (I use this method when I need to turn mine off)

    :slight_smile:


    /G

Hi gby,

thanks to you for answering.

Why i want to turn it off completely ? because i want ;-)

I like controlling my device at my wish and pull the power cord is not a good option for me.

indeed, i already tried the Gui : shutdown case but it did nothing as expected :/

I will test the poweroff from terminall ssh but it's not my preferred way of course:-)

Hi gby,
thanks to you for answering.
 
Why i want to turn it off completely ? because i want ;-)
 
I like controlling my device at my wish and pull the power cord is not a good option for me.
 
indeed, i already tried the Gui : shutdown case but it did nothing as expected :/
 
I will test the poweroff from terminall ssh but it's not my preferred way of course:-)


But to turn it back on you have to pull the power cord and reconnect it anyway.

Regards

@NedtheNerd

yes indeed but there is no way to turn it on automatically ? Imean at least with an easy way like a remote ?

@NedtheNerd
 
yes indeed but there is no way to turn it on automatically ? Imean at least with an easy way like a remote ?


Yes it can be done with a RemotePi Board, Google is your friend.

Regards

thx

nice idea this remotePi board but maybe expensive :/

I will see what to do

thx for the answer and goodjob for Rasplex and supporting it ;-)

i think to something

and via HDMI CEC ?

Dont know about CEC, but you could look in to WOL, (Wake on Lan).

No idea if it’s supported but as Ned said, “Google is your friend” :slight_smile:

You could add an extension cord with a switch before the plug. However you wouldn’t be able to shut down remotely

I solved this by powering the pi of the USB of the TV... I haven't had one not have enough power so far.

I solved this by powering the pi of the USB of the TV... I haven't had one not have enough power so far.

To use that method safely you also need to use CEC, so that the TV tells RasPlex to make a software shutdown before the USB power is removed. Otherwise it's just as bad as pulling the power plug in mid-operation. And if your TV set doesn't support CEC (like mine doesn't) then you should not power the RPi this way. Doing so anyway will eventually lead to SD card corruption, as USB power can disappear during RPi write operations when you turn the TV off.

Best regards: dlanor

Hi guys,

I have tried to connect to rpi and use the command "poweroff" but it do not seem to work either.

What is supposed to do commands like "poweroff" ? be cause here nothing appears on the terminal and i wait for minutes :-)

Hi guys,
 
I have tried to connect to rpi and use the command "poweroff" but it do not seem to work either.
 
What is supposed to do commands like "poweroff" ? be cause here nothing appears on the terminal and i wait for minutes :-)

The ssh command "poweroff" is intended to have the same effect as the GUI command "Shut Down" as found in the top level side menu of PHT/RasPlex. It should cause all ongoing computer processing to cease and then perform the physical poweroff of most of the RPi circuitry, though this will leave one or more LED's shining to indicate that physical power is still applied to the unit. The precise LED usage varíes with different versions.

Note that it is normal for some delay to occur between the manual shutdown command and completion of the shutdown process, as ongoing network transfers and logfile updates must be completed in a valid manner before terminating all operations.

The reliability of this shutdown procedure has also varied with different versions, as some versions of the system software and of PHT can create background threads that don't respond properly to this shutdown method, leading to the total failure of shutdown.

For some cases of such failure it can help to use a combination of two ssh commands in sequence:

First use: "killall plexhometheater"

This will cause the PHT part of RasPlex to terminate, whereafter it is restarted by the OpenELEC part.
You will see this as a recurrence of the "RasPlex now loading" splash screen, but without the rainbow screen and OpenELEC splash that would occur for a full reboot. This restart of PHT often helps terminate stubborn background threads that can impede proper shutdown. You should wait for the PHT menu to appear before proceeding with the second command.

Next use: "poweroff" (or GUI "Shut Down")

This shutdown is more likely to succeed almost instantly, thanks to the cleanup made by the previous command.


Generally the shutdown has become more reliable in later versions, and so far I've seen no failures with the latest RasPlex version 0.5.0, when using the simple "Shut Down" command from the top level side menu.

That said: I do not normally turn my RPi off, except as needed for SD card replacement.
That's something I do more often than the average user, as part of RasPlex beta-testing.
But apart from that my chosen mode of usage is to leave RasPlex running 24/7.

Best regards: dlanor

I attach mine to a USB port on my TV.  When the TV shuts off, so does the Pi.

Haven't had any SD card corruption issues doing it that way.

I attach mine to a USB port on my TV.  When the TV shuts off, so does the Pi.
 
Haven't had any SD card corruption issues doing it that way.

As I stated in an earlier post, your method of powering the RPi is safe ONLY if the TV set sends a shutdown command to the RPi using the CEC protocol, and waits for that shutdown to complete before removing hardware power from the USB connector.

Without such shutdown procedure you are effectively 'rolling dice' about SD corruption at each voltage turnoff.
If any SD card write operations are in progress at that time (log files or whatever) corruption WILL occur.
But you might not notice the corruption, if it only affects files that the system is not dependent on using.

However, no matter what file is being written, it also involves updates of directory sectors, and whenever one of those gets corrupted it can affect more than just the file which was being handled.

So if you power the RPi from TV USB ports whose power is removed when TV is turned off/standby, then you need to ensure that the CEC protocol is used and properly configured at each end (RPi menus and TV menus).

Best regards: dlanor

I have a FLIRC attached to my Rasplex box which emulates a keyboard. Is it possible to map a key on the keyboard to send the terminal poweroff command?

As I stated in an earlier post, your method of powering the RPi is safe ONLY if the TV set sends a shutdown command to the RPi using the CEC protocol, and waits for that shutdown to complete before removing hardware power from the USB connector.

Without such shutdown procedure you are effectively 'rolling dice' about SD corruption at each voltage turnoff.
If any SD card write operations are in progress at that time (log files or whatever) corruption WILL occur.
But you might not notice the corruption, if it only affects files that the system is not dependent on using.

However, no matter what file is being written, it also involves updates of directory sectors, and whenever one of those gets corrupted it can affect more than just the file which was being handled.

So if you power the RPi from TV USB ports whose power is removed when TV is turned off/standby, then you need to ensure that the CEC protocol is used and properly configured at each end (RPi menus and TV menus).

Best regards: dlanor

Good to know. I'll have to check my settings later.

However, good thing about rasplex is that it's easy to set up. Takes a few minutes to write the image back to the SD card should it ever be corrupted. I think you can even back up your settings.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.