1

I need an option to reboot an RPI completly (simulate unplugging it from the power and re-plug via command) I've tried sudo reboot But its not going to run power 0 as I know...

sudo halt 

seems more promising , but I don't know how to turn it on after using that ,so the answer to that would be great!

Thank you guys.

  • If Linux is running sudo reboot or sudo shutdown -r now will reboot. sudo poweroff or sudo halt or sudo shutdown -h now will shutdown the operating system but will NOT power off the device. As long as the power supply is connected to the wall (or battery) and connected to the RPi it will draw some power (even if the OS has been halted). In the grand scheme of things that only matters if you're running on batteries. It costs less than £5.00 per year to run a Raspberry. – Dougie Oct 3 at 22:02
  • You can restart a halted OS by connecting the RUN pins together [DO NOT do that while Linux is running - it's will result in absolute DEAD STOP as it pulls the processor RESTART pin low]. There's also ways to assign a GPIO pin to act as a OS restart. – Dougie Oct 3 at 22:05
0

The Pi has 3 "components" the CPU, GPIO and Video Core which are relatively independent.

See https://raspberrypi.stackexchange.com/a/100125/8697

Any of the commands halt, shutdown, reboot (which are equivalent) will reset the CPU to its bootup state.

The Video Core continues to run, and the GPIO pins retail their state.

It is only possible to reset the Video Core and GPIO by cycling power OR pulling the RUN pin low, which will cause a clean restart.

On the odd occasion when I need to do this I run shutdown or pull the gpio-shutdown pin LOW then after this is completed RESET.

On most models (Pi4 excepted) you can use Pin 5 to perform a shutdown and powerup. See Raspberry Pi 3 model B "dtoverlay=gpio-shutdown"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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