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