Web page button controls GPIO relay
(04-17-2020, 06:51 PM)coolio Wrote: Hi all,
I'm looking for some advice with regards to controlling a relay from a web page. 

I am familiar with using the RPi.GPIO to control the actual relay(s) on the pine64.

What I am confused about it how to have the web page button onClick event send the python code to the pine64.
Does html have an event or method "onClick" or is this only available using javascript?

Would I create a html (PHP) webpage  add a button, then have a cgi script run the python RPi.GPIO code?

I'm trying to come up with the right strategy of how to go about this so any assistance would be greatly appreciated.

Thanks in advance

I'm toying about with a arduino board with wifi and basically did something similar.

I use onclick events to trigger a XMLHttpRequest request so I don't need to refresh the whole page just to use a servo

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-17-2020, 10:16 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)