camo200sx
Is sudden loss of power likely to cause corruption to the sd card or damage to the pi? Is openplc running from the sd or ram? I've heard of making the sd read only. I'm trying to work out a system where it is used in my vehicle. There are many options for shutting the pi down when the vehicle turns off and am trying to figure out the best route. Thanks for any input!
Reply 0 0
pmoyle111
If the SD is being written to while the power is lost it can make the SD unusable at least that was so 10 yr ago when I debugged an issue like that at a major teleconferencing system mfr. I've not worked on SD problems since so I don't know if the SD mfr's have done anything to remedy this. But at the least it would trash the file system.

I am currently investigating using open plc with piCore. That runs completely from ram and you can even remove the SD once booted. I have a post to see if anyone else has tried that. 
Reply 1 0
thiagoralves
Once OpenPLC is loaded on the system, it basically runs from RAM. However, it won't prevent the kernel from writing to the disk every once in a while. Shutting down a system during a write can possibly trash the file system, specially if your file system is on an SD card. One thing you can try to do is to send a shutdown signal before cutting off the power so the system can kill all tasks and prepare for shutdown.
Reply 0 0
JeffH
Hi Thiago
This would be good news but for the word 'basically'.  My test system (an early model B) takes 7 seconds from the shutdown GPIO pin changing state to the last blinkenlight going out. The system is a headerless Raspbian with only openplc and ssh running. The shutdown script sends 'sudo shutdown now' within a second. What can I do to kill *ALL* SD card activity before the supply drops out?
Regards, Jeff
Reply 0 0
thiagoralves
Perhaps a better idea would be to make the filesystem read-only. This would prevent any issue on the SD card during an unexpected shutdown
Reply 0 0
Reply