http://raspberrywebserver.com/cgiscript ... ry-pi.html
This is what I used for my project. While I used text boxes, you can use buttons, check boxes, and more.
Just be sure to set permissions to allow GPIO to be run from a non-root user:
(I wasn't having luck with Jessie, so I used Wheezy for my project)
-$usermod -a -G group user
adding "root", "pi" and "www-data" to the groups "kmem" and "dialout"
However, I was still having issues accessing GPIO, so I had to do the following:
-$sudo nano /etc/rc.local
Code: Select all
chmod 777 /dev/mem
chmod 777 /dev/gpiomem
(I know it's not the best practice, but it's a $35 hobby project; I'm not too concerned about security.)