OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How to avoid SD card corruption?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42626

    JimS
    Participant

    Just went through corruption on the beagle bone (not a sprinkler application) and the RPi has similar issues (I have a OSPi). If power is lost the card can be corrupted. It doesn’t happen every time but is a significant risk. With the BBB it was on a UPS but the outage lasted 5 hours so power was lost when the UPS battery was depleted. Many RPi users keep a spare SD card with image on hand so they can swap cards when it happens. Not a very elegant solution IMHO.

    Is there a recommended way to avoid this with OSPi? A number of sites have information on adding a small battery and some sensing to tell when the main power goes away. Then the battery provides enough power to do a controlled shutdown.

    #42655

    Ray
    Keymaster

    I am not familiar with the problem enough to give any useful opinion, but my impression is that using a high quality SD card generally helps. Adding a backup battery certainly helps.

    #42669

    JimS
    Participant

    Quality/speed of SD card may solve other issues but not this one. If the system is writing to the card when power goes down it may stop mid-cycle andcorrupt the card beyond what the startup checks can recover from. It doesn’t happen every time but it is a definite risk.

    A battery backup will help for short outages but is only completely effective if combined with software to shut the board down before the battery runs out. In my case I had a backup battery but the outage lasted 5 hours and was longer than the battery could run the board so eventually I had a uncontrolled shutdown just the same as if I didn’t have any backup battery – possibly worse because it might do strange things as the voltage slowly dropped rather than cutting off quickly. Handling of this would be a nice feature to add to the OSPi and Beaglebone versions. Best case would be that the circuit holds off shutdown for several minutes (which would cover outages where power just briefly goes out) and then shutdown and remove power to the board to handle long outages. Many of the circuits I have seen don’t remove power from the board so it still draws a very small current after shutdown. This isn’t a real problem with running the battery down except in VERY long outages (probably weeks or even months). The real issue I see with this approach is the board doesn’t restart when power source comes back on – power has to be manually disconnected and reapplied.

    If you google this issue you will get lots of hits, circuits, and opinions which may or may not be accurate…

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How to avoid SD card corruption?