Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

Beginners • Re: On/Off Switch for Raspberry Pi 4

$
0
0
Next question:

You should really be starting a new thread for each new question. You'll get more eyes on it that way. Too latre now though
Is there a way to turn on the Pi automatically when I login and shut down when I log out using these CMDs? :D

If the Pi isn't on you can't login.

PCs and Macs have Wake on LAN* but Pi's don't. If you're willing to add extra hardware it can be done using a Pico, zero, or another Pi: https://github.com/thagrol/fakewake
The Pi is setup to run the slide-show at start up, so if I could get the CMD commands to turn it off and on at login, that would be ideal.

To shutdown over ssh run

Code:

sudo poweroff
or

Code:

sudo shutdown -h now
It may be possibly to do that automatically on logout but that isn't something I've tried and on "logout" from what? A desktop session, an ssh session, a desktop terminal session?

*: https://en.wikipedia.org/wiki/Wake-on-LAN

Statistics: Posted by thagrol — Wed Nov 12, 2025 12:40 am



Viewing all articles
Browse latest Browse all 8621

Trending Articles