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"
sudo reboot
orsudo shutdown -r now
will reboot.sudo poweroff
orsudo halt
orsudo 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 03 '19 at 22:02RUN
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 03 '19 at 22:05