0

I've experienced several P3B+ automtically shutdown cases, by skiping the analysis of the root cause, I wonder what is the solution to automatically bring back the Pi again while it shutdown, I mean without manually unplug and plug the power cable?

3
  • Pretty broad question, possibly too broad. How will you detect the Pi has shutdown?
    – joan
    Jul 15, 2018 at 11:00
  • 1
    Worth noting that your other question does not explicitly involve "automatic shutdowns". All you've described there is the system becoming unresponsive. Ingo's answer there is about diagnosing a shutdown; the simplest thing you could do is check /var/log/syslog to see if one actually happened before your reboot. If not, you are now looking for a way to cycle the power on a running system and this could easily come back to haunt you, since it should be shutdown properly first, else you risk filesystem corruption etc.
    – goldilocks
    Jul 15, 2018 at 13:06
  • 1
    Put another way, this is an XY problem. By analogy, if you believe every time a car stalls it is because it has run out of gas, if in fact it stalls for some other reason getting some gas is not a good solution. And there is a gauge in the car that can help distinguish a car that really is out of gas from one that is not.
    – goldilocks
    Jul 15, 2018 at 13:09

1 Answer 1

2

Automatically starting up after a shutdown is impossible without external hardware. With external hardware, you could e.g. put a relay on the 5V power line. Toggling that relay would simulate re-plugging the power cable.

An Arduino and a relay module would be enough for the task.

7
  • 1
    To automate this, you could write a state machine for the Arduino such that once an input line with a pull-down on it gets pulled high, it waits until it goes low again, then trips the relay and waits for it to pull high again (the wait state and pull-down are to accomodate the Pi's GPIO between shutdown and reboot). Of course, this will only work if the system really has shutdown...
    – goldilocks
    Jul 15, 2018 at 13:03
  • Another Pi could do this. OP has many RPi's that could crosscheck each other.
    – OyaMist
    Jul 15, 2018 at 15:23
  • 1
    It is NOT impossible. The Pi has an on chip watchdog!
    – Milliways
    Jul 16, 2018 at 0:09
  • 1
    @Shawn I'm guessing that you are doing serious multi-device development, and will probably end up having different device configurations for testing. I was not sure if you wanted to introduce Arduino into your existing architecture and was simply suggesting using other Pi systems if you have them available for performing as Dmitry proposes.
    – OyaMist
    Jul 16, 2018 at 4:45
  • 1
    Re: "impossible", you don't need to use a relay either, you can short the RUN pin (actually it's just a hole). @Milliways I've never looked at the watchdog, can it trigger pin activity after the system has shut down?
    – goldilocks
    Jul 16, 2018 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.