I'm working on a project with a raspberry pi to turn on and off an LED strip using a mobile device.
The last issue I'm running into is getting the scripts to run from the apache server being hosted on the raspberry pi.
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="css/style.css">
exec("sudo python /home/pi/lightOn.py");
exec("sudo python /home/pi/lightOff.py");
<button class="btn" name="LightON">Light ON</button>
<button class="btn" name="LightOFF">Light OFF</button><br><br>
For anyone that stumbles upon this, the problem was simply fixed by adding
sudo in front of the file-path.