Rev. 8: 29-04-2021
47
time is less that 20 seconds. To know more technical specs about this device, you can consult
the
Raspberry PI UPS and RTC Shield User Manual
.
NOTE:
Do not confuse this UPS with the UPS models of other brands, the behaviour is
different.
14.1.1
How to execute commands before the Power Off process
The UPS has its own configuration file
rpishutdown
and service
rpishutdown-service.
The
placement of both files can be consulted in the
Raspberry Pi PLC OS configuration
manual.
To execute specific commands before finishing the Power Off process, you must follow the
next steps:
•
Create this path inside the /etc folder:
•
Inside this folder, create a file called pre-poweroff:
The file type can be anyone you want (Bash Scripts, Python, C++, etc.) but the most important
thing is that it must be called
pre-poweroff
without any extension (you must indicate the file
type with the corresponding
Shebang
). The script execution time cannot surpass
6
seconds, as
it is the Raspberry’s Power Off
period. Take into account that this code only can be things that
do not depend on the external power supply, like creating a file or things directly related with
the Raspberry. (Following this rule, you cannot do things such as enabling an output so it
depends on the external power supply).
•
Give the execution permissions to the file:
Following these steps, the file must be executed before the Raspberry Power Off.
sudo mkdir -p rpishutdown/hooks/
sudo nano pre-poweroff
sudo chmod ugo+x pre-poweroffs
Summary of Contents for Raspberry PLC 19R+
Page 1: ...RASPBERRY PLC FAMILY RASPBERRY PLC FAMILY...
Page 2: ...Rev 8 29 04 2021 1...
Page 3: ...Rev 8 29 04 2021 2 RASPBERRY PLC FAMILY Quick User Guide Revised February 2021...
Page 9: ...Rev 8 29 04 2021 8 General Description RASPBERRY PLC FAMILY Product Reference Table...
Page 10: ...Rev 8 29 04 2021 9 Zones Table Measures Table...
Page 27: ...Rev 8 29 04 2021 26 Raspberry PLC Family Pinout I Os Table...
Page 29: ...Rev 8 29 04 2021 28 Upper Side POWER INDICATOR RTC BATTERY CAN BUS ETHERNET2 CONNECTOR...
Page 35: ...Rev 8 29 04 2021 34 Equivalence Table Pin Out 11 1 1 Analog Digital Devices Analog I Os...
Page 36: ...Rev 8 29 04 2021 35 11 1 2 Digital I Os 11 1 3 Relay Devices Analog I Os...
Page 37: ...Rev 8 29 04 2021 36 11 1 4 Digital I Os 11 1 5 Relay...
Page 53: ...Rev 8 29 04 2021 52 Mail industrialshields industrialshields com...