Posts by danielristic

    Thanks for the suggestion, both os.system("sudo sleep 5s") and time.sleep(5) seem to work intchangeably.

    The led only blinks buring the few seconds of poweoff, which is the expected behavior (the rest of the time it just stays on).

    Thanks again for your suggestions, I've been trying to make this script work for quite some time and with your help is was much easier than expected!

    Thanks!

    It almost works with your instructions, however there must be some other command that's needed before issuing os.system("sudo shutdown -r now") in the poweroff() function for it to truly replicate the "power off system" item in kodi's menu: without it, the RPi does shut down but it doesn't send a HDMI-CEC signal to TV and amplifyer to shut down as well.

    I've tried adding a os.system("killall kodi") followed by os.system("sudo sleep 5s") or even a os.system("systemctl stop kodi") but that does not help. What am I missing here?

    EDIT: It seems I have figured it out, it works with:

    os.system("kodi-send --action=Powerdown")

    os.system("sudo sleep 5s")

    os.system("shutdown -r now")

    Hello,

    I own a few Raspberry Pi (3&4) that are inside Retroflag cases (SuperPi Case, Nespi4 Case and SuperPi 4 Case). They all support safe shutdown which means that they have physical buttons that allow the OS to send a signal to shutdown itself rather than just being on an off physical switches.

    Retroflag provides their own official script with installers for several OS but LibreElec is not one of them: https://github.com/RetroFlag/retroflag-picase

    There are a few mentions of people trying to do the same thing on this forum in the past but the instructions don't work or seem obsolete. Is there a straightforward way to make this work on the latest version of LibreELEC?

    This is handled automatically when installing the latest version of Recalbox, but it provides an old version of Kodi that brings its own multiple issues.

    Any help or pointing in the right direction would be much appreciated!