Posts by aldebaranhg

    i copied the code exactly. Maybe some characters (space) got into it through later editing (google translater).
    Sorry, I still have to learn how to correctly compose my posts!
    I think the python interpreter cannot recognize the expression os.system..... The normal shellcommando

    LibreELEC: ~ # os.system ("echo" Raspberry Pi Shutdown! "> / Dev / pts / 0")
    sh: syntax error: unexpected word (expecting ")") does not work under Libreelec either.

    with LibreELEC: ~ / .config # echo "3456"> / dev / pts / 0
    3456
    can I send texts between logged-in terminals.

    to your question:
    the script powershutdown_serialless shuts down the raspi at power off. That works fine. I can also do without the additional issue of a message.

    when I start the script manually:
    LibreELEC: ~ / .kodi / userdata / scripts # python powershutdown_serialless.py &
    LibreELEC: ~ / .kodi / userdata / scripts # Safe Shutdown in the case of Powerfailure (CTRL-C for exit)
    Here you can also see that the script is working properly:
    messages are issued.
    Case 1 momentary power failure
    LibreELEC: ~ / .config #
    LibreELEC: ~ / .config # Raspberry Pi Powerfail detected
    Raspberry Pi Power Back Detected!

    Case 2 long failure power
    LibreELEC: ~ / .config #
    LibreELEC: ~ / .config # Raspberry Pi Powerfail detected
    Raspberry Pi Shutdown!

    The main thing is that the script is started automatically and works properly.
    Thanks again :)

    thank you for your prompt reply
    Unfortunately I don't get any output on my terminal (MobaXterm via ssh)
    when I insert the new line:
    if x> = ShutdownTimer:

    print ("Raspberry Pi Shutdown!")

    os.system ("echo" Raspberry Pi Shutdown! "> / dev / pts / 1")

    time.sleep (5)

    os.system ("shutdown -h now")

    the modified script is no longer executed - no display of 687 root 0:00 python /storage/.kodi/userdata/scripts/powershutdown_serialless.py
    more about the processes at ps -ef

    I also tried to add a waiting time so that the message could be read, but it didn't work either.

    the problem was definitely autostart.sh

    I logged in with a terminal program (mobaxterm) and the /storage/.config/autostart.sh file was just one line
    python /storage/.kodi/userdata/scripts/powershutdown_serialless.py &

    created and the rights set with chmod.
    the command is now executed correctly. after entering ps -ef i can also see the running process. 566 root 0:00 python /storage/.kodi/userdata/scripts/powershutdown_serialless.py

    it would be nice if a message could be sent to all logged-in terminals in the event of a power failure - is that possible?

    the print commands from the powershutdown_serialless.py script do not arrive on a logged-in terminal

    Many Thanks

    I installed libreelec using image

    Thesystem boots automatically into KODI.

    if i login over ssh with MobaXterm 20.6 i see:

    LibreELEC (official): 9.2.6 (RPi4.arm)

    LibreELEC:~ #

    So I would like to control my ambilight at the same time via hyperion.ng

    In order to shutdown the Raspi automatically when switching off power

    I use the hardware extension "StromPi3".

    Therefore a python script ("powershutdown_serialless.py)must be

    executed when starting up the Raspi.

    In the forum I found the post by "jakob" from June 13, 2020 and then made all

    the settings :

    - install "Raspberry Pi Tools" add-on

    - create the folder /storage/.kodi/userdata/scripts

    - insert lines in my powershutdown_serialless.py

    import sys

    sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')

    - put powershutdown_serialless.py into /storage/.kodi/userdata/scripts

    - create /storage/.config/autostart.sh

    both files attached in the datei.zip.

    When i start the powershutdown_serialless.py from an ssh terminal see hier :

    LibreELEC (official): 9.2.6 (RPi4.arm)

    LibreELEC:~ #

    LibreELEC:~ # python /storage/.kodi/userdata/scripts/powershutdown_serialless.py &

    LibreELEC:~ # Safe Shutdown in the case of Powerfailure (CTRL-C for exit)

    it works fine. But on booting the raspi the script "powershutdown_serialless.py"

    is not executed.

    Where is the mistake ?

    many thanks for the support