Can you shut down Raspberry Pi running LibreELEC?

  • Am I understanding correctly that, other than removing power, there is no shutting down RPi with LE? When I use the Kodi Power System Off, it just reboots.

    So far I've had no problems from just turning off power, but I know with most computers that is a no-no.

    Raspberry Pi 4b

    LibreELEC 10.0.4

  • Go to Best Answer
  • Install raspberry pi tools from repo. Pi3B+ shutdowns, if Kodi power off is used in libreelec 10. You would have to remove power after that to get it reboot. Click link does talk about adding missing button to Pi.

    "with most computers that is a no-no."

    Modern operating systems have features in place to handle abrupt power loss. power off is not recommended, but options for doing it are there and in some cases it is the only recovery option that you have. With libreelec it is even easier cause OS is on readonly file system. Your biggest power off problem would be with attached NTFS storage devices.

    Edited 5 times, last by tokul (February 18, 2023 at 6:41 AM).

  • Install raspberry pi tools from repo. Pi3B+ shutdowns, if Kodi power off is used in libreelec 10.

    This seems to be right. I'm using Raspberry Pi Tools for a long time, because I need it for the power button GPIO's. I usually shutdown by Kodi menu, and it still works since LE 10.

  • I already have Raspberry Pi tools installed.

    I already have an on-off switch on the power line, and don't need a second one.

    Are you saying Raspberry Pi tools is supposed to provide an orderly software shutdown? It doesn't.

    Are you saying in order to have orderly shutdown, you need to install a hardware switch on those IO pins and make some file modifications?

  • I don't know. Menu shutdown works for me, so I eventually just have different settings.

    Please login by SSH, and open /storage/.kodi/userdata/guisettings.xml with the nano editor.

    My power management section looks like this. Try the same settings:

    Code
    <setting id="powermanagement.displaysoff" default="true">0</setting>
    <setting id="powermanagement.shutdowntime" default="true">0</setting>
    <setting id="powermanagement.shutdownstate" default="true">1</setting>
    <setting id="powermanagement.waitfornetwork" default="true">0</setting>
    <setting id="powermanagement.wakeonaccess" default="true">false</setting>
  • Are you saying Raspberry Pi tools is supposed to provide an orderly software shutdown? It doesn't.

    Are you saying in order to have orderly shutdown, you need to install a hardware switch on those IO pins and make some file modifications?

    I am not saying that to have orderly shutdown, you need hardware switch on io pins. I only told that if RPi is powered off via menu, it will need that switch or other way to cut off power to restart. I did assume that tools addon is required and you are free to fact check me on that.

    So far you kept claiming that Kodi power off does not work without providing any information to investigate it further. If you are here for blue twitter checkmark, they have other blue thing too on some posts. My RPi3B+ does not restart, if I use power off option in Kodi. It shutdowns. I don't remember its firmware version. Original RPi3B+ with 1 meg of ram. It does not have any extra hardware mods.

    Checked Pi 4 Model B Rev 1.2 too. 2023 Jan 11 bootloader. It shutdowns via Kodi menu even without RPi tools addon. Technically hardware is not shutdown. It is halted.

    Edited 8 times, last by tokul (February 19, 2023 at 5:05 AM).

  • I don't know. Menu shutdown works for me, so I eventually just have different settings.

    Please login by SSH, and open /storage/.kodi/userdata/guisettings.xml with the nano editor.

    My power management section looks like this. Try the same settings:

    Code
    <setting id="powermanagement.displaysoff" default="true">0</setting>
    <setting id="powermanagement.shutdowntime" default="true">0</setting>
    <setting id="powermanagement.shutdownstate" default="true">1</setting>
    <setting id="powermanagement.waitfornetwork" default="true">0</setting>
    <setting id="powermanagement.wakeonaccess" default="true">false</setting>

    Thanks, yes, my powermanagement lines look exactly like that.

  • I am not saying that to have orderly shutdown, you need hardware switch on io pins. I only told that if RPi is powered off via menu, it will need that switch or other way to cut off power to restart. I did assume that tools addon is required and you are free to fact check me on that.

    So far you kept claiming that Kodi power off does not work without providing any information to investigate it further. If you are here for blue twitter checkmark, they have other blue thing too on some posts. My RPi3B+ does not restart, if I use power off option in Kodi. It shutdowns. I don't remember its firmware version. Original RPi3B+ with 1 meg of ram. It does not have any extra hardware mods.

    Checked Pi 4 Model B Rev 1.2 too. 2023 Jan 11 bootloader. It shutdowns via Kodi menu even without RPi tools addon. Technically hardware is not shutdown. It is halted.

    So I'm getting clear now, that behavior of mine with menu shutdown is not normal. Thanks.

    I don't know what information would be useful. And I have no idea what blue twitter checkmark is; I don't use Twitter.

    LibreELEC 10.0.4

    Raspberry Pi 4b

    I found these commands in another thread; don't know what it means. Bootloader is older than what you referred to, but "latest":

  • Thanks for the verification. Do you have a spare microSD? If yes, install LE 10.0.4 from scratch on it, and try again.

    If no success with those factory defaults:

    1. create an advancedsettings.xml file, and activate log level 1
    2. after your next unwanted reboot, upload kodi.old.log to PasteBin (make sure that it's complete after uploading)
    3. post the resulting PasteBin URL
  • Thanks. No spare microSD, but I put the image on a USB and was able to boot from that. It behaved just like my regular install. But this gave me an opportunity to study the behavior. Here's what happens when I use the Kodi menu "Power Off System":

    1. TV switches off
    2. RPi main light turns off for ~half second, then back on.
    3. RPi access light blinks a few seconds like it does when booting from power off.
    4. The main light stays on, the fan stays on.
    5. When I turn the TV back on, no video from Kodi. I have to switch RPi off and on again to get it back.

    So it seems to be rebooting with lights and fan on, but not working after, until I power cycle it. Is that what it's supposed to do? Anyway, here's the debug log (note I had to power cycle before I could submit it). http://ix.io/4h7V It doesn't look like any Kodi log I've seen before.

  • Disable the CEC adapter on the input settings (click on it, and deactivate it). I think RPi gets a CEC wake-up call after shutdown.

    If you need CEC, only deactivate CEC wake-up functions on those settings.

    If that doesn't help, provide a proper kodi.old.log, like I said above.

  • Okay, your log instructions above seem to have changed.

    Under Settings > System > Input > Peripherals > CEC Adpater, I'm seeing settings mostly for controlling other devices, not for incoming CEC commands, as best I can tell. Exceptions might be:

    When the TV is switched of --> Suspend

    Action when switching to another source --> Pause Playback

    The second one seems good, but the first one I changed to Ignore. I tried it then several times (with power cycle in between) and using the Power System Off menu still put it into that state of being on but not putting out video.

    I found a file that seems relevant:

    When I changed that TV switched off setting, the line

    Code
    <setting id="standby_pc_on_tv_standby" value="13011" />

    changed to a value of 36028. But as noted, that didn't help. The CEC Adapter settings are not documented on the Kodi wiki.

  • So then I did the old kodi log with loglevel 1 as you asked. This is after rebooting, then going immediately to the "Power System Off" menu item. Then after it finishes blinking, turning off power. There's definitely some ERRORs in there, but I don't understand what's going on.

    Line 992 is where it seems to see me navigating to Power system off.

    hastebin

  • Well, somewhere back in the troubleshooting you had me boot to a brand new install of LE, which had the default skin. It behaved exactly the same. But I guess I could see if the loglevel 1 log looks the same.

  • You can use halt target instead of poweroff target:

    Code
    ln -s /usr/lib/systemd/system/halt.target /storage/.config/system.d/poweroff.target
    systemctl daemon-reload