Rox
Hi all,
i would like to now how we can shut down the RPI after power loss via code, there would be back-up battery or super capacitor during shutdown sequence. the shut down triggers via one of the input pin. if the pin triggers then it would perform a safe shutdown.

i got to think of it after my RPI with Openplc didnt boot-up, as im periodically out for weeks for work assignment and leaving my flat I switching off the Main CB of my distribution board.
Quote 0 0
neuron
I have this baterryless UPS;  https://juice4halt.com/
Works perfectly.
Quote 0 0
Rox
neuron wrote:
I have this baterryless UPS;  https://juice4halt.com/
Works perfectly.


Thanks for the link, but in the "enter your country" there's no UAE where I'm located.  if someone can give the a code or script how to shut it down, it would be simple, i have some 8 pin Pic microcontroller.
Quote 0 0
thiagoralves
You can perform the shutdown from your PLC code. Create a function in ST language with a single input called SHUTDOWN. Then something like this might work:
IF (SHUTDOWN = TRUE) THEN
    (*Initiate system shutdown*)
    {{system("shutdown -P now");}}
END_IF;

Whenever the input pin SHUTDOWN goes to true, this function will initiate the safe shutdown command.
Quote 0 0
Rox
Thanks Thiago,
Ill test this today and will update.  then ill order super capacitors.
Quote 0 0
Rox
It works!!
Thank you!
Quote 0 0
epgodoy
This might be an option: https://www.sequentmicrosystems.com/watchdog.html
Quote 0 0