I am very new to all of this so be easy on me
I have my PI setup as an airplay server for my car and it works great. Right now I am ssh'ing into the Pi to run a sudo init 0 to shut it down before I turn my car off.
What I would like is a simple way for me to click a button from my iphone (I guess via a webserver running on the PI) to trigger a shutdown.
I have been searching around and found a few things but since I am such a newbie I don't quite get them
What would be the simplest way to accomplish this? It does not have to require a webserver if there is another way.
6 posts • Page 1 of 1
WOW!! Thanks so much for typing all of that out for me. It worked PERFECTLY!ednl wrote:What I'd do:
Code: Select all
sudo apt-get update && sudo apt-get install lighttpd php5-cgi sudo lighty-enable-mod fastcgi fastcgi-php sudo service lighttpd force-reload sudo visudo # Add the following line below "pi ALL etc." and exit the visudo editor: www-data ALL = NOPASSWD: /sbin/shutdown sudo nano /var/www/index.html # Absolute minimum contents of the index.html file: <html><a href="shutdown.php">Shutdown NOW</a></html> sudo nano /var/www/shutdown.php # Absolute minimum contents of the shutdown.php file: <?php system('sudo /sbin/shutdown -h now'); ?>
Thank you very much!
Yeah the wifi is setup as an access point and I need a password to access the Wifi...that should be enough, right?ednl wrote:Secure wpa2 wifi network, for example. Not sure what your setup is like now; you can ssh from iphone to rpi, because you've setup the rpi+wifi stick as an access point?swindmiller wrote:How would I do thatvadim wrote:make sure it is accessible from your iphone only