I have seen various methods to control the GPIO pins via a web interface. A few include
- Python loop pinging for instruction in a MySQL db
- Running NodeJS as the scripting language and webserver
- Interfacing socket.io with NodeJS
- Giving www-data sudo privileges
I already have a lot of PHP code in place that I do not want to convert to Node, so 2 is out. 4 is very insecure. My question comes down to which method is more efficient? Calling a NodeJS script via socket.io or pinging a MySQL db with python?