Javascript/html shutdown raspberry pi

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Hello, I have been triying for a while to do a shutdown remote button for the raspberrypi cuz im making a remote controlled rover but whatever i do doesnt work cuz I guess its dificult for people not to be able to shut doen your computer.
What i have tried is making javascript execute a file witha shutdown now -h in it but it doesnt work.
Any help would be apreciated.
 

hrs

Joined Jun 13, 2014
179
systemctl poweroff works for me. This requires some recent enough version of Systemd. On old systems halt might work, I cant remember if that required root or not, or via some obscure dbus command.
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Nevermind, found out a way to do it.
I just told javascriopt that if a button is pushed it turns on a gpio, and i call in python a wait for press that detects if the javascript gpio is pressed
and shutsdown if it is.
Thanks any way.
 
Top