Web page button controls GPIO relay
#4
(04-19-2020, 07:50 AM)coolio Wrote: Thanks for the info.  I've researched the ajax XMLhttpRequest and have it working, well I have a web page that allows me to run a "hello Dave"  cgi script
on my pine64...I've written a cgi script that when run from the command line turns ON and OFF a relay momentarily...
When I try to run the cgi script through the XMLHttpRequest event handler, I end up with an INTERNAL ERROR page on my web browser...

From my searching on the web the problem is related to the GPIO pins needing to run as ROOT...
I've spent 2 days (and nights) on this and am now officially giving up trying to do this on the pine64.

FYI - I'm heading back to the Raspberry pi and will use the wiringpi module, then right PHP code to do the same...

You can allow php to run things as root, although generally you wouldn't want this, edit /etc/sudoers and add the following:

Code:
www-data    ALL=(ALL:ALL) ALL

Then you just do:

Code:
sudo <cmd>

As for the INTERNAL ERROR that is coming from the server and can be caused by a number of things
  Reply


Messages In This Thread
Web page button controls GPIO relay - by coolio - 04-17-2020, 06:51 PM
RE: Web page button controls GPIO relay - by evilbunny - 04-19-2020, 08:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)