A Raspberry Pi is a pocket-sized computer device. Its main function is to enable the user to program and code.
There may be a time when you need to know how to restart your Raspberry Pi remotely. We have put together the answers on how to do this in a handy guide for you.
How to Shut Down or Reboot Raspberry Pi
Raspberry Pi is connected to the main computer via a power cable.
They don’t have a power button in the traditional sense. Therefore, it can be oh so tempting to just pull the plug and get the immediate gratification of a shut-down device. However, if you do this, you can cause damage to the Raspberry Pi’s internal workings. So, try to avoid it as much as possible.
The device responds to a list of commands which are typed by the person using it. There is one main user, or sudo user (sudo). This profile can execute all commands, including the shut-down. These are known as Sudo commands.
The command for proper shut down of your Raspberry is: sudo halt / sudo shut down -h now.
sudo = sudo user or main profile, administration user if you will. This is normally the default Raspberry Pi user.
halt = the command to stop and cease all activities and shut down.
shut down = shut down now.
—h = instruction the PI to not reboot after it has been shut down until turned back on properly.
now = the time when you want the PI to shut down. This can be substituted for any number, which will dictate how soon the device shuts down.
You are able to manually and safely reboot the PI with a similar chain of command. Again, you must have sudo privileges in order to properly execute this command.
The command prompt for a proper reboot of your Raspberry Pi is sudo reboot now/ sudo shutdown -r now
—r = the instruction to reboot after being shut down
now = the time frame of the reboot. If you want to change this, you can just put any number. The numbers equate to minutes.
Reasons for Needing a Remote Raspberry Reboot
Before we get into how let’s take a look at the why. Why would you even need to reboot your PI remotely?
—It’s had a complete system failure, and it won’t turn on with all the standard tricks and commands.
—You need to effect updates to the system, but you are unable to manually reboot.
—The device is set up as a robotic control and is not responding.
Restarting Raspberry Pi Remotely
Now that we have covered the very basics, let’s move on to the focus of the article.
There are often times when you may need to restart your PI device remotely. Remotely can be defined in this context as, without using the reboot command via the keyboard input.
You have a few options at your disposal. None of them are as simple as entering a command, but they will get the job done.
Restarting Raspberry Pi Remotely Via SSH
SSH stands for Secure Socket Shell.
It is a system that allows remote access to a device from an unsecured network or a public network. Basically, any network that is not your home network. SSH has got you covered.
So, why is it relevant to our Raspberry Pis? Well, with SSH, you can access your PI remotely from anywhere in the world. Literally, anywhere.
Therefore, it stands to reason that, you will be able to reboot the device without having to be either on it or near it.
All you need to do is ensure that your PI is connected to a network, and that’s that. If network capable, you will be able to gain access to it via SSH. You can then enter the shutdown command.
And easy as pie, command complete. Remote reboot, tick.
Voice Commands via SSH
You can also use Voice Commands to enable shutdown and reboot. Again, you have to be connected through the SSH network.
You will need a properly functioning microphone that can be connected via USB. The Raspberry Pi does not have a sound card or even an audio jack port.
You will also need to make sure this microphone is switched on!
You will also need to install voice recognition software onto the PI. There are a few options, and we have listed the two best ones below:
—Pi Voice Recognition (Steven Hickson)
Additionally, it’s a safe bet by now you’ll have guessed that there’s a command.
The command for voice control is: sudo voicecommand -s.
You can also add in time limits on to the end of the command. For example, you can dictate when the reboot should happen, whether that is immediately or in an hour’s time.
What to Note When Remotely Restarting Your Raspberry Pi
Of course, there are risks with remote access. However, if you follow these tips you should be able to eliminate and avoid damage to your device.
—Everything must be up-to-date. This means, all updates activated, all network access updates up to date, operating systems, you name it. Everything needs to be running on the newest possible version.
—A secure connection. Consider using a VPN. A secure connection is the only way to ensure that you are the only person gaining remote access. Anything other than that across a public network, and you open yourself up to a world of pain.
Your IP address should never be accessible. Hackers’ delight.
Raspberry Pi’s are fun and educational devices that have gone from strength to strength since they first appeared on the scene.
You can spend hours getting to know the various commands and programs. Thankfully, now you don’t have to travel too far to find out how to restart your Raspberry Pi remotely. We have collaborated all that information for you in one handy space.
Remember, keep your device secure and up to date with the latest Raspberry Pi OS. Protect your IP address.