Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Can-o-Worms: Pi Shutdown vs Power Off

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    15
    58
    2.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User?
      A Former User @Phaedrux
      last edited by

      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

      Totally agree, and that's where the risk must be weighed. How much time will be wasted in the case of a failure? How can that time be mitigated with backups, etc?

      I'm not gonna name names, but I think most of us can think of a good handful that would struggle for weeks with such a scenario; which beggs the question why advocate something that is probably safe instead of implementing something that is safe? And accepting that the recommendation while we wait for a safe solution should be to safely shut down the system - anyone can ignore it at their own risk.

      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        @bearer said in Can-o-Worms: Pi Shutdown vs Power Off:

        And accepting that the recommendation while we wait for a safe solution should be to safely shut down the system - anyone can ignore it at their own risk.

        Yes I totally get your point. A clean shutdown is the safest bet and best practice. But it's also good to know that if power is lost unexpectedly that it's not guaranteed catastrophe.

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • gloomyandyundefined
          gloomyandy
          last edited by

          @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

          A Former User? gtj0undefined 2 Replies Last reply Reply Quote 0
          • gtj0undefined
            gtj0 @Danal
            last edited by

            @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

            @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

            @Danal Out of curiosity, how much time elapses between the 12v cutout and the 5v dropping below the Pi's Vin minimum?

            I will see if there is a reasonable way to measure that. For example, if my dual channel scope will go slowly enough to trigger on the 12V and also draw a trace for the 5V.

            If you have any thoughts on how to measure...?

            Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

            Danalundefined 1 Reply Last reply Reply Quote 0
            • A Former User?
              A Former User @gloomyandy
              last edited by

              @gloomyandy said in Can-o-Worms: Pi Shutdown vs Power Off:

              @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

              you get an overlay which is read/write worst case you loose your uploaded files and the os and config remain intact.

              1 Reply Last reply Reply Quote 0
              • gtj0undefined
                gtj0 @gloomyandy
                last edited by

                @gloomyandy said in Can-o-Worms: Pi Shutdown vs Power Off:

                @bearer If you are going to use a read only pi filesystem for the sbc, where are you going to upload gcode files to? Do you intend to use a 2nd disk (network share?) of some sort?

                You could create a partition just for gcode files that's writable and leave the rootfs read only.

                1 Reply Last reply Reply Quote 0
                • DanS79undefined
                  DanS79
                  last edited by

                  The only time I've really seen corruption happen is when you loose power in the middle of a high I/O event. Unless your using a PI to build a NAS that you plan on hammering on, you will probably never see a corruption event.

                  1 Reply Last reply Reply Quote 0
                  • Danalundefined
                    Danal @gtj0
                    last edited by

                    @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                    Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

                    Roughly what I was thinking. What voltage do we consider, as the 5V decays, to be the limit?

                    Delta / Kossel printer fanatic

                    gtj0undefined 1 Reply Last reply Reply Quote 0
                    • Danalundefined
                      Danal @Phaedrux
                      last edited by

                      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                      Worst case scenario for a Pi would be maybe replacing the SD card AND the pi itself.

                      Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                      Delta / Kossel printer fanatic

                      Phaedruxundefined 1 Reply Last reply Reply Quote 0
                      • Phaedruxundefined
                        Phaedrux Moderator @Danal
                        last edited by

                        @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                        Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                        Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                        Z-Bot CoreXY Build | Thingiverse Profile

                        Danalundefined 1 Reply Last reply Reply Quote 0
                        • Danalundefined
                          Danal @Phaedrux
                          last edited by

                          @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                          Totally agree, and that's where the risk must be weighed. How much time will be wasted in the case of a failure? How can that time be mitigated with backups, etc?

                          Obviously varies by user and Pi. If for some reason I thought a given Pi would take more than an hour or so to rebuild its SD, I'd do something. I'd be much more likely to schedule a backup than to worry about shutdown. SDs fail. Whether shutdown or not.

                          Delta / Kossel printer fanatic

                          Phaedruxundefined 1 Reply Last reply Reply Quote 0
                          • Phaedruxundefined
                            Phaedrux Moderator @Danal
                            last edited by

                            @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                            SDs fail. Whether shutdown or not.

                            And power loss can happen even with a UPS. (accidentally unplugging it, battery dying, etc)

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 1
                            • Danalundefined
                              Danal @Phaedrux
                              last edited by

                              @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                              @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                              Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                              Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                              Huh again?

                              It seems we just agreed there is absolutely zero change in the odds of losing or not losing the hardware with shutdown or no shutdown. Therefore, hardware loss events do not enter into this discussion.

                              Yes? No?

                              Delta / Kossel printer fanatic

                              Phaedruxundefined 2 Replies Last reply Reply Quote 0
                              • Phaedruxundefined
                                Phaedrux Moderator @Danal
                                last edited by

                                @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                                @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                Huh? What mechanism increases or decreases the odds of damage to a Pi (not the SD, the Pi) if it is powered off before or after a Raspbian shutdown command?

                                Exactly. But I just chose that as an absolute worst case total loss situation on one side of the balance.

                                Huh again?

                                It seems we just agreed there is absolutely zero change in the odds of losing or not losing the hardware with shutdown or no shutdown. Therefore, hardware loss events do not enter into this discussion.

                                Yes? No?

                                All I was saying that even if the worst case was a total write off of your SD card and Pi it's ~50$ for the sake of argument. If something cost you 50$ and an hour of your time, how much effort would you be willing to put into mitigating it. It's just a thought experiment.

                                Z-Bot CoreXY Build | Thingiverse Profile

                                1 Reply Last reply Reply Quote 0
                                • ChrisPundefined
                                  ChrisP
                                  last edited by

                                  I guess in the context of using a Pi or similar as the SBC on a Duet3, it's pretty rare that anything is going to be written to the filesystem that's of any significance. Aside from doing a software update or uploading a gcode file, typical usage is pretty much just going to be read operations which aren't going to care about getting interrupted anyway.
                                  The test is still really interesting to know how unlikely a failure is. I imagine that the more likely failure more will be due to SD dying due to swap spaces and temporary files being written... but that's a whole separate topic.

                                  While I'd always prefer to do a 'proper' shutdown, I've never felt the need on a Pi, and your test seems to have confirmed that. Though if there was an easy option to do so on the DWC, I'd likely use it.

                                  1 Reply Last reply Reply Quote 0
                                  • Phaedruxundefined
                                    Phaedrux Moderator @Danal
                                    last edited by

                                    @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                    Therefore, hardware loss events do not enter into this discussion.

                                    Is this the can o worms phase of the discussion? I think I'll bow out now. 😉

                                    Z-Bot CoreXY Build | Thingiverse Profile

                                    Danalundefined 1 Reply Last reply Reply Quote 0
                                    • Danalundefined
                                      Danal @Phaedrux
                                      last edited by Danal

                                      @Phaedrux said in Can-o-Worms: Pi Shutdown vs Power Off:

                                      total write off of your SD card and Pi

                                      I get the time 'cost' and completely agree with you. I don't get the "and Pi" part.

                                      Delta / Kossel printer fanatic

                                      1 Reply Last reply Reply Quote 0
                                      • gtj0undefined
                                        gtj0 @Danal
                                        last edited by

                                        @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                        @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                                        Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

                                        Roughly what I was thinking. What voltage do we consider, as the 5V decays, to be the limit?

                                        I've seen 4.8 and 4.75 as the lower limit. Does your scope allow a screen capture? See if you can just capture the slope.

                                        Danalundefined 1 Reply Last reply Reply Quote 0
                                        • chas2706undefined
                                          chas2706
                                          last edited by

                                          The only time I get issues with corrupt sd cards on raspberry pi is when I attempt to upgrade RRF using sudo apt-get update, sudo apt-get upgrade.
                                          (They not actually corrupt, it just doesnt end in success)

                                          Turning power off without shutting down pi causes less problems maybe.

                                          1 Reply Last reply Reply Quote 0
                                          • Danalundefined
                                            Danal @gtj0
                                            last edited by

                                            @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                                            @Danal said in Can-o-Worms: Pi Shutdown vs Power Off:

                                            @gtj0 said in Can-o-Worms: Pi Shutdown vs Power Off:

                                            Connect 12V to channel 1 and 5v to channel 2. Set the scope it to trigger on channel 1 falling edge.

                                            Roughly what I was thinking. What voltage do we consider, as the 5V decays, to be the limit?

                                            I've seen 4.8 and 4.75 as the lower limit. Does your scope allow a screen capture? See if you can just capture the slope.

                                            Setting it up now.

                                            Delta / Kossel printer fanatic

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA