I'm a student in electronics department doing a project on home automation using Raspberry Pi (for bulbs, fan, temperature and camera).
I want to access the GPIO pins from a web interface to execute a Python script to control the devices on the server (RPi).
I installed WiringPi but I can't move forward to control them.
See the example below of a webpage to control a simple led (on & off): https://i.sstatic.net/SLNyx.jpg
I have installed apache2 server.
I have paced the code in cgi-bin
and pointed the button on to that link
It says "permission denied" in error log file, it shows to try as root.
led.py
in cgi-bin
folder:
#!/usr/bin/python2.7
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.OUT)
GPIO.output(7,True)